Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » [solved]invalid use of closeEvent()
[solved]invalid use of closeEvent() [message #1605658] Sat, 07 February 2015 12:34 Go to next message
Eclipse UserFriend
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?

[Updated on: Sat, 07 February 2015 16:19] by Moderator

Re: invalid use of closeEvent() [message #1605775 is a reply to message #1605658] Sat, 07 February 2015 14:30 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: invalid use of closeEvent() [message #1605887 is a reply to message #1605775] Sat, 07 February 2015 16:18 Go to previous message
Eclipse UserFriend
hi, thank you very much.

That's it Razz
Previous Topic:CDT under Ubuntu Gnome, lots of errors
Next Topic:How to set build output directory
Goto Forum:
  


Current Time: Wed Jul 16 06:53:17 EDT 2025

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

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

Back to the top