Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Non-Blocking DialogBox (NonModal?) required for Statusmessages

Non-Blocking DialogBox (NonModal?) required for Statusmessages

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 3.9k Views
  • 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.
  • H Offline
    H Offline
    huckfinn
    wrote on last edited by
    #1

    Hello,

    I need a DialogBox which shall present a String to the user.
    -> This Dialogbox should be on top of the application, e.g. as a splashscreen,
    -> But never blocking user interaction to the parent application window.

    @
    if (!dlg_IDList)
    {
    dlg_IDList = new QInputDialog(0, Qt::SplashScreen);
    dlg_IDList->setOkButtonText("Encode Route");
    dlg_IDList->setCancelButtonText("Reset Route");
    dlg_IDList->setModal(false);
    }

    // if resultString changes
    QString text = dlg_IDList->getText( this, tr("Title"), tr("ID List"), QLineEdit::Normal, resultString);
    @

    Everytime resultString changes, I getText() that String in a Dialog. But here, it blocks the user interaction to my main window.
    I'd rather prefer not to block me..

    Do you have any suggestions?

    Thank you
    Huck

    1 Reply Last reply
    0
    • G Offline
      G Offline
      giesbert
      wrote on last edited by
      #2

      If you use a QInputDialog and call get_Text, you make a synchronous call to the dialog to show and return a user entered value. That will always block the UI.

      You would have to display the dialog and then connect some signals and slots to check, when the user presses OK. I never did such things with QInputDialog, so I have no code ready here.

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

      1 Reply Last reply
      0
      • H Offline
        H Offline
        huckfinn
        wrote on last edited by
        #3

        Yes you're right.

        So I'll build up a new QDialog with my own requirements for this.

        Thank you!

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          You can make use of [[Doc:QInputDialog]] without the static convenience methods too. Just connect to the special signals. I would say "textValueSelected() ":/doc/qt-4.8/qinputdialog.html#textValueSelected is what you need here:

          bq. This signal is emitted whenever the user selects a text string by accepting the dialog; for example, by clicking the OK button. The selected string is specified by text.

          You will have to call the respective setters for that parameters of your input box, that go into the call of the static convenience methods.

          http://www.catb.org/~esr/faqs/smart-questions.html

          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