I have some problems with a QDialog that I open from a QMenu. The QDialog shows up fine and in the QDialog I have a QDialogButtonBox with a button to Close the QDialog. BUT if I close the QDialog and then open it from the QMenu again, it will show up but the button from the QDialogButtonBox will not show up. Instead the buttons from the QMainWindow will show but they are grayed out.
How can I get the QDialog buttons to show every time? Maybe I have some problems with setting focus on the QDialog? I really can't see what I'm doing wrong here, the QDialog works fine if I open it from the QMainWindow directly without the QMenu.
It's not much code that I use, you can try it yourself. This is my code:
In QMainWindow I use the following to create the menu:
This shows the QDialog:
QAction *menuButton = new QAction("Menu", this);
QMenu *menu = new QMenu(this);
QAction *popup = new QAction("Show popup",this);
connect(popup, SIGNAL(triggered()), this, SLOT(showPopup()));
This is the TestDialog:
TestDialog *test = new TestDialog(this);
QDesktopWidget* desktopWidget = QApplication::desktop();
QRect rect = desktopWidget->availableGeometry();