I've wrote a simple slot function to show an inputdialog. But it appears as below in android emulator. The code is :
void PriceChecker::showSettings()
{
QInputDialog UrlDialog;
QString baseUrl = UrlDialog.getText(m_pMainWidget, "Settings", "Enter BaseURL");
}
Can someone tell why this happens?
It does this for all QDialog-based widget being displayed. They never have border nor title bar...except QMessageBox.
QMessageBox
-> this shows with title and border QInputDialog
-> this shows with no title and border QDialog
-> this shows with no title and border I workarounded the problem by catching QEvent::ShowToParent
event in QApplication::notify
and making dialog about to be displayed size fit main frame size, it then covers the whole screen. At least controls are not mixed with the main frame controls....
Note: I submitted this Qtbug: https://bugreports.qt-project.org/browse/QTBUG-39623
... either it's a problem of the customized style of my host application (since i'm doing a plugin), or it's the same on windows;
anyway it can be easily worked around by explicitly setting the window flags like:
QInputDialog d;
Qt::WindowFlags f = d.windowFlags();
f |= Qt::Dialog;
d.setWindowFlags(f);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.