A.J
A.J

Reputation: 735

QInputDialog doesn't show title and border in android application

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");    
}

Application window

When Dialog appears in application window

Can someone tell why this happens?

Upvotes: 1

Views: 608

Answers (2)

t_3
t_3

Reputation: 781

... 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);

Upvotes: 0

jpo38
jpo38

Reputation: 21514

It does this for all QDialog-based widget being displayed. They never have border nor title bar...except QMessageBox.

  • Create and display a QMessageBox -> this shows with title and border
  • Create and display a QInputDialog -> this shows with no title and border
  • Create and display a 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

Upvotes: 0

Related Questions