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. Need some help in Signal and Slots Connections.
Forum Updated to NodeBB v4.3 + New Features

Need some help in Signal and Slots Connections.

Scheduled Pinned Locked Moved Mobile and Embedded
29 Posts 4 Posters 11.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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #20

    Hi,

    It seems that you are creating new widgets every time you click on a button. May I suggest to simplify things a bit ? It seems that what you want to do with MainWindow2 already exists as "QInputDialog":http://qt-project.org/doc/qt-4.8/qinputdialog.html

    I would also suggest to have a look at the examples from the Qt documentation to better understand how widget interaction may be achieved.

    Hope it helps

    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
    • V Offline
      V Offline
      VPellas
      wrote on last edited by
      #21

      I saw the QInputDialog , I read the whole forum, but I can't understand how I can connect this with my program.

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

        Read the "example":http://qt-project.org/doc/qt-4.8/dialogs-standarddialogs.html

        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
        • V Offline
          V Offline
          VPellas
          wrote on last edited by
          #23

          Hmmm. It's interesting. But, is it possible to do it with Widgets? As you can understand this is just the "problem" i have in my main Program. In there when i Press the Recount Button a New Window(main Class QWidget) pops up in which the user enter the values from a Calculator-type keyboard I created...

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

            Sure it is, apply the same techniques used by QInputDialog.

            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
            • V Offline
              V Offline
              VPellas
              wrote on last edited by
              #25

              After reading tons of posts, questions, answers, i realized that what i need to do is to make my own "QInputDialog::getInteger()" . I read the example you gave me , I Isolated the part that i am interested in, which is to take Int from the pop up dialog that shows up, but i also realized that this is a Standar procedure in Qt Libraries and i cannot change the Widgets used in it. So is there a way to make MainWindow2 on my code to be my own "QInputDialog::getInteger()" - style Dialog?

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

                Read the source from QInputDialog, you'll see the pattern used and you can then replicate it for your purpose.

                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
                • V Offline
                  V Offline
                  VPellas
                  wrote on last edited by
                  #27

                  Ok problem solved

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    koleygr
                    wrote on last edited by
                    #28

                    For them who want to know how the problem solved:

                    The easier way to take something of your dialog back to your mainwindow is to
                    define an external variable at the "top" of your mainwindow.cpp (for example @extern int c@)
                    and then just to pass it to your dialog (just @int c@ at the top of your dialog cpp).
                    For more details search for external variables.

                    I know that we should avoid external declarations, but this way the life of a
                    non-profesional programmer... is realy much easier....

                    This method, interrupts and the problem of arguments in SLOTS...
                    you don't realy need them.

                    Using:Qt Creator 2.4.1 under UBUNTU

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      koleygr
                      wrote on last edited by
                      #29

                      Another way, is to use a public (non void) function in your dialog
                      and to call this function (after executing the dialog) fron your main window.

                      P.S.: If someone need the code,
                      just ask me to post it.

                      Using:Qt Creator 2.4.1 under UBUNTU

                      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