The QDockWidget * dock2=new QDockWidget (this);
The QDockWidget * myWidget2=new QDockWidget;
Dock2 - & gt; SetWidget (myWidget2);
This - & gt; AddDockWidget (Qt: : LeftDockWidgetArea, dock2);
QPushButton * BTN=new QPushButton (this);
BTN - & gt; SetText (tr (" something "));
BTN - & gt; Move (600, 600);
BTN - & gt; Show ();
The connect (BTN, & amp; QAction: : triggered, this dock2 - & gt; Hide ());
The last line error: error: invalid use of void expression
The connect (BTN, & amp; QAction: : triggered, this dock2 - & gt; Hide ())
Pray god give directions!!!!!!!!!!
CodePudding user response:
The QDockWidget * dock2=new QDockWidget (this);
QWidget * widget=new QWidget;
Dock2 - & gt; SetWidget (widget);
.
The connect (BTN, & amp; QPushButton: : clicked, dock2, & amp; QWidget: : hide);
CodePudding user response:
Dock2 - & gt; Hide () to the dock - & gt; Hide, do not add parentheses
CodePudding user response:
Connect the written response function have not seen you,
The connect (BTN, & amp; The QAction: : triggered, this, dockHide ())
void dockHide ()
{
Dock2 - & gt; Hide ();
}
CodePudding user response:
To the dock - & gt; Hide,
CodePudding user response:
The connect (BTN, & amp; QAction: : triggered, this dock2 - & gt; Hide ());
Instead of
The connect (BTN, & amp; QAction: : triggered, dock, & amp; QDockWidet: : hide);
CodePudding user response: