Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Titlebar and border doesn't appear for QInputDialog.
Forum Updated to NodeBB v4.3 + New Features

Titlebar and border doesn't appear for QInputDialog.

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Abin
    wrote on last edited by
    #1

    I've wrote a simple slot function to show an inputdialog. But it appears without titlebar and border 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?

    I see even my mainwindow doesn't have border and titlebar...

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Android and iOS don't use the same paradigm as desktop OSs so it's perfectly normal to not have such decorations.

      As a side note, you are using getText wrongly, it's as static function

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Abin
        wrote on last edited by
        #3

        Thanks SGaist for the info.

        But it looks unpleasant when a dialog appears over the main widow. Is there any solution for making the view better?

        And as per the side note I modified the code as below

        @void PriceChecker::showSettings()
        {
        QInputDialog UrlDialog;
        QString baseUrl;

        if (QDialog::Accepted == UrlDialog.exec())
        {
            baseUrl = dlg.textValue();
        }
        

        }@

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          The better way is:

          @ QString baseUrl = QInputDialog::getText(m_pMainWidget, "Settings", "Enter BaseURL");@

          What do you mean by "making the view better" ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved