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. Wanted - BASIC pop-up dialog
Forum Updated to NodeBB v4.3 + New Features

Wanted - BASIC pop-up dialog

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 373 Views 2 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
    Anonymous_Banned275
    wrote on last edited by
    #1

    I am looking for suggestions - from an experienced , actual user , I did scan examples and they are too fancy.
    I just want very basic , simple pop-up dialog to give users "input options" selection.
    Single QString text to pass to the main widget.
    Prefer something I can build in QDesigner - including events / SIGNAL / slot.

    1 Reply Last reply
    0
    • Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2
      QString s = QInputDialog::getText(parent, "String input dialog", "Type something here:");
      
      1 Reply Last reply
      4
      • RenioR Offline
        RenioR Offline
        Renio
        wrote on last edited by
        #3

        for example:

        https://www.informit.com/articles/article.aspx?p=1405224

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Anonymous_Banned275
          wrote on last edited by
          #4

          Thanks, I started looking at QQuickWidget and quickly got lost...

          Since I like to use QDesigner I am , for time being, trying "group box".
          Run into two problems - cannot figure out how to get the combo box to show all entries.
          My goal is to eliminate users "click this / click that" as much as possible - hence "open the combo box" when the main widget is open.
          Secondly , using QDialog - similar issue - how to add plain combo box , not group box , to QDialog. ( But that can wait)

          {// combobox code block
          QComboBox *endDeviceCombobox = new QComboBox(ui->groupBox); //(ui.groupBox_2);
          endDeviceCombobox->setGeometry(QRect(190, 20, 111, 21));
          endDeviceCombobox->setWindowTitle("Select entry ");
          endDeviceCombobox->maxVisibleItems();
          endDeviceCombobox->setEditable(false);
          endDeviceCombobox->setDuplicatesEnabled(false);
          endDeviceCombobox->setGeometry(QRect(190, 20, 111, 21));
          endDeviceCombobox->setEditable(false);
          endDeviceCombobox->setDuplicatesEnabled(false);
          endDeviceCombobox->addItem("TEST entry 1 ");
          endDeviceCombobox->addItem("TEST entry 2 ");
          endDeviceCombobox->addItem("TEST entry 1 ");
          endDeviceCombobox->addItem("TEST entry 2 ");
          endDviceCombobox->addItem("TEST entry 1 ");
          endDeviceCombobox->addItem("TEST entry 2 ");
          endDeviceCombobox->addItem("TEST entry 1 ");
          endDeviceCombobox->addItem("TEST entry 2 ");
          endDeviceCombobox->show();
          }// combobox code block

          1 Reply Last reply
          0
          • Chris KawaC Online
            Chris KawaC Online
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by Chris Kawa
            #5

            Don't reinvent the wheel. QInputDialog serves exactly this purpose. If you want a combo with predefined values instead of single string then just use QInputDialog::getItem:

            QStringList options {"TEST entry 1", "TEST entry 2", "TEST entry 3"};
            QString result = QInputDialog::getItem(parent, "Combo dialog", "Select entry:", options, 0, false);
            
            1 Reply Last reply
            1

            • Login

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