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. How get result from QInputDialog?
Forum Updated to NodeBB v4.3 + New Features

How get result from QInputDialog?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 605 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.
  • EngelardE Offline
    EngelardE Offline
    Engelard
    wrote on last edited by Engelard
    #1

    Since Qt have a bug with all QDialogs which created staticly(for single use), i've made it as normal object, set everything up, everything working, but i can't find only one function - for extracting result what user just entered(and pressed OK afterwards).

    QInputDialog entrVal;
    entrVal.setMinimumSize(178, 90);
    entrVal.setInputMode(QInputDialog::IntInput);
    entrVal.setLabelText("enter your value");
    entrVal.setIntRange(1, 255);
    entrVal.setIntValue(1);
    
    if(entrVal.exec() != 0)   int result = entrVal.????????
    
    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by Christian Ehrlicher
      #2

      By carefully reading the documentation documentation for QInputDialog::intValue().

      /edit: copied the wrong link, sorry

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      EngelardE 1 Reply Last reply
      3
      • Christian EhrlicherC Christian Ehrlicher

        By carefully reading the documentation documentation for QInputDialog::intValue().

        /edit: copied the wrong link, sorry

        EngelardE Offline
        EngelardE Offline
        Engelard
        wrote on last edited by
        #3

        @Christian-Ehrlicher said in How get result from QInputDialog?:

        By carefully reading the documentation.

        So i suggest you do exactly what you suggested))

        It returns result code ,which just mean - return what button user pressed, 1 for accept, 0 for reject button.

        Function .result() do not return result.

        aha_1980A 1 Reply Last reply
        0
        • EngelardE Engelard

          @Christian-Ehrlicher said in How get result from QInputDialog?:

          By carefully reading the documentation.

          So i suggest you do exactly what you suggested))

          It returns result code ,which just mean - return what button user pressed, 1 for accept, 0 for reject button.

          Function .result() do not return result.

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by aha_1980
          #4

          @Engelard said in How get result from QInputDialog?:

          It returns result code ,which just mean - return what button user pressed, 1 for accept, 0 for reject button.
          Function .result() do not return result.

          ????

          Do you mean you want to get intValue?

          Qt has to stay free or it will die.

          EngelardE 1 Reply Last reply
          2
          • aha_1980A aha_1980

            @Engelard said in How get result from QInputDialog?:

            It returns result code ,which just mean - return what button user pressed, 1 for accept, 0 for reject button.
            Function .result() do not return result.

            ????

            Do you mean you want to get intValue?

            EngelardE Offline
            EngelardE Offline
            Engelard
            wrote on last edited by
            #5

            @aha_1980 said in How get result from QInputDialog?:

            Do you mean you want to get intValue?

            was obvious. Tnx for help!

            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