widget swap/widget on top
Hi guys,
if i press a button on mainwindow i want another widget i.e. widget1 to popup, but that widget1 should be on top and the mainwindow should be disabled.. same should happen if i try to open a new widget i.e. widget2 by pressing a button on widget1 (widget 2 should be on top and other 2 widgets should be disabled)
in this process i dont want to hide the disabled widgets/windows..
Can someone plz guide me to achieve the same..
Thanx in advance
Regards,
ad3d
Re: widget swap/widget on top
Hello,
Try using a QDialog instead of a QWidget, then use QDialog::exec();
HTH. :)
Re: widget swap/widget on top
exec() in QDialog serves a purpose of showing dialog as modal widget.
To achieve the same effect but using QWidget set modality parameter. Something along this line should help You:
Code:
w->setWindowModality( Qt::ApplicationModal );
w->show();
This will create modal widget, all mouse.keyboard input are redirected to this widget.
Re: widget swap/widget on top
But while using modality one must HIDE and SHOW the widgets...
I need to Disable the Widget Background and keep the Top level widget enabled..
Re: widget swap/widget on top
You don't hide anything, just create new widget, with is by default hidden/invisible/unpainted into screen, and then show it.
Quote:
I need to Disable the Widget Background and keep the Top level widget enabled..
Please help Us help You. Describe Your problem best You can, and If that's necessary add pix into post for better understanding. Currently I don't know where is your problem, and I think the solution that was posted is what You're looking for.