c++ - Not able to set the geometry in QT -
I set the After deleting widgets, if you want to resize everything well, you should change the Apart from this, the widget size on a stacked widget can affect the width and height of the end that ends in your window. Hope that helps. widget to set the coordinates of
setGemometry () I am using But when I delete some
widget and delete it from the main layout, then it is not fully capable of setting geometry. I am using
KeyReleaseEvent () , that is, when I am pressing key D, some widgets should be removed and it should set geometry to a specific location when I first press it The effect is not seen, but the widgets are removed and when I press it for the second time it is set properly.
void mywindow :: popupwindow () {If (stack1-> current index () == 0) {stack3-> Hide (); MainLayout-> AddWidget (stack2); Stack2-> Show (); Stack2-> SetFixedSize (400,200); This- & gt; SetGeometry (100,400,900,200); } If (Stack 1-> Current Index () == 1) {stack2-> Hide (); MainLayout-> AddWidget (stack3); Stack3- & gt; Show (); Stack3- & gt; SetFixedSize (400,200); This- & gt; SetGeometry (100,400,900,200); }} Zero mywindow :: deleteWindow () {mainLayout-> RemoveWidget (stack2); MainLayout-> RemoveWidget (stack3); Stack2-> Hide (); Stack3- & gt; Hide (); This- & gt; SetGeometry (100,400,500,200); }
popup window () linked to a
KeyReleasedEvent () and
deleteWindow () The other key is
Time Fug 4: Again, after calling again window () for the second time
adjustSize () Call .
Comments
Post a Comment