Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » [solved]invalid use of closeEvent()
[solved]invalid use of closeEvent() [message #1605658] Sat, 07 February 2015 17:34 Go to next message
Nick Schweyer is currently offline Nick SchweyerFriend
Messages: 175
Registered: July 2009
Senior Member
In my application there shall be some actions before finally closing a dialog.
The following code shall do this:
Quote:

void Dialog_graph::closeEvent(QCloseEvent *event) {
... // do some actions
event->accept(); // this line generates a compiler error!
}

In another application I did it exactly the same way with the main window. And it runs.

Now I want to do it with the dialog (Dialog_graph) but the compiler generates an error:
Quote:
Fehler: invalid use of incomplete type »struct QCloseEvent«


What is wrong?


Niko

Eclipse-CDT Version: 2019-12 (4.14.0), Win10 64bit

[Updated on: Sat, 07 February 2015 21:19]

Report message to a moderator

Re: invalid use of closeEvent() [message #1605775 is a reply to message #1605658] Sat, 07 February 2015 19:30 Go to previous messageGo to next message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
Nick Schweyer wrote on Sat, 07 February 2015 19:34
In my application there shall be some actions before finally closing a dialog.
The following code shall do this:
Quote:

void Dialog_graph::closeEvent(QCloseEvent *event) {
... // do some actions
event->accept(); // this line generates a compiler error!
}

In another application I did it exactly the same way with the main window. And it runs.

Now I want to do it with the dialog (Dialog_graph) but the compiler generates an error:
Quote:
Fehler: invalid use of incomplete type »struct QCloseEvent«


What is wrong?


This is the compiler's way of telling that it knows that QCloseEvent is a class or struct, but the compiler does know its components (here: the function/method accept()). It seems to me that you need to include the header describing the components of the class/struct.


--

Tauno Voipio
Re: invalid use of closeEvent() [message #1605887 is a reply to message #1605775] Sat, 07 February 2015 21:18 Go to previous message
Nick Schweyer is currently offline Nick SchweyerFriend
Messages: 175
Registered: July 2009
Senior Member
hi, thank you very much.

That's it Razz


Niko

Eclipse-CDT Version: 2019-12 (4.14.0), Win10 64bit
Previous Topic:CDT under Ubuntu Gnome, lots of errors
Next Topic:How to set build output directory
Goto Forum:
  


Current Time: Thu Mar 28 17:33:02 GMT 2024

Powered by FUDForum. Page generated in 0.01873 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top