# include "ui_widget. H"
#include
#include
Widgets: : widgets (QWidget * parent)
: QWidget (parent)
, the UI (new UI: : Widget)
{
The UI - & gt; SetupUi (this);
The connect (& amp; M, & amp; MyPushButton: : sendSignal, [=] () {
The UI - & gt; The label - & gt; Hide ();
//this - & gt; Hide ();
QDebug () & lt; & lt;" The received signal ";
});
}
Widgets: : ~ Widget ()
{
Delete the UI;
}
///////the above is the main window content
# include "mypushbutton. H"
#include
MyPushButton: : myPushButton (QWidget * parent) : QPushButton (parent)
{
}
//mouse into the event
Void myPushButton: : enterEvent (QEvent * event)
{
Emit sendSignal ();
}
//the above is my custom button
MyPushButton m;
Void sendSignal ();
The two is that h defined inside
CodePudding user response:
Title is too long, can not see the back of the problemCodePudding user response:
The main window is not defined in the mypushbutton