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. QDialog does not sense click when argument are passed
Forum Updated to NodeBB v4.3 + New Features

QDialog does not sense click when argument are passed

Scheduled Pinned Locked Moved Solved General and Desktop
13 Posts 4 Posters 1.0k 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.
  • M MarcoChiesi79

    Hello everyone,
    I'm facing a really strange problem. I'm developing an application for linux embedded platform (imx6 0659). I already designed a lot of window which are working correctly. Some of them are created passing some argument in the constructor (es. Anagrafica(QWidget *parent, QString sNewpat, bool bSelection)) and they are all working fine. Now I added a new window to the project, by now I only added a qpushbutton to go back (this->reject), but, if I change the constructor of this window passing any argument, as already done for some other window of the project, this window (which is ApplicationModal like the others) doesn not work correctly: it is impossible to click button and go back (click is not sensed). If I remove the argument in the constructor, the button works correctly (so, the window is sensing click).
    I'm pretty sure I created this new window like all the others, this thing is very strange to me!
    Any help would be really apprecieated!
    marco Chiesi

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #2

    @MarcoChiesi79 What is this parameter and how is it used? How do you create the instance of that window (actually dialog, right?)?

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    M 1 Reply Last reply
    0
    • jsulmJ jsulm

      @MarcoChiesi79 What is this parameter and how is it used? How do you create the instance of that window (actually dialog, right?)?

      M Offline
      M Offline
      MarcoChiesi79
      wrote on last edited by
      #3

      @jsulm Hi,
      it's not a matter of parameter type, or how I'm using it. Any parameter, even if not used, give the problem.
      Window is a normal Ui window opened throug exec().
      By now, I solved changing window type from ApplicationModal to WindowModal, and this for me is good too, because now the window works as it should and it is not possible to click the calling window as I wanted.
      What I do not understand now, is why other windows of the project, called and created in the same way, passing arguments in the constructor, can be ApplicationModal without giving similar problem.
      Surely I do not understand this because I'm a newbie
      Thank you for answering!
      Marco Chiesi

      jsulmJ 1 Reply Last reply
      0
      • M MarcoChiesi79

        @jsulm Hi,
        it's not a matter of parameter type, or how I'm using it. Any parameter, even if not used, give the problem.
        Window is a normal Ui window opened throug exec().
        By now, I solved changing window type from ApplicationModal to WindowModal, and this for me is good too, because now the window works as it should and it is not possible to click the calling window as I wanted.
        What I do not understand now, is why other windows of the project, called and created in the same way, passing arguments in the constructor, can be ApplicationModal without giving similar problem.
        Surely I do not understand this because I'm a newbie
        Thank you for answering!
        Marco Chiesi

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #4

        @MarcoChiesi79 Well, I don't understand that either. Without more information and/or code it is hard to say.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        3
        • M Offline
          M Offline
          MarcoChiesi79
          wrote on last edited by
          #5

          I did not find ant other solution than using WindowModal, so I can consider this matter solved, at least for my needs

          Pl45m4P 1 Reply Last reply
          0
          • M MarcoChiesi79

            I did not find ant other solution than using WindowModal, so I can consider this matter solved, at least for my needs

            Pl45m4P Offline
            Pl45m4P Offline
            Pl45m4
            wrote on last edited by
            #6

            @MarcoChiesi79

            Your description was not very helpful. If you show, what you did there, maybe we can find a solution. Could be a simple beginner's mistake.
            It's impossible that your QDialog doesnt work anymore, only because you've passed some addiitional stuff in your constructor.


            If debugging is the process of removing software bugs, then programming must be the process of putting them in.

            ~E. W. Dijkstra

            M 1 Reply Last reply
            0
            • Pl45m4P Pl45m4

              @MarcoChiesi79

              Your description was not very helpful. If you show, what you did there, maybe we can find a solution. Could be a simple beginner's mistake.
              It's impossible that your QDialog doesnt work anymore, only because you've passed some addiitional stuff in your constructor.

              M Offline
              M Offline
              MarcoChiesi79
              wrote on last edited by
              #7

              @Pl45m4 said in QDialog does not sense click when argument are passed:

              @MarcoChiesi79

              Your description was not very helpful. If you show, what you did there, maybe we can find a solution. Could be a simple beginner's mistake.
              It's impossible that your QDialog doesnt work anymore, only because you've passed some addiitional stuff in your constructor.

              I can understand your remark. I'll try to explain better what happens in this way:
              MainWindow -> ApplicationModal window (with argument): everything work fine
              MainWindow -> ApplicationModal window (with argument)-> ApplicationModal window (withargument): does not work and should be changed in
              MainWindow -> ApplicationModal window (with argument) ->WindowModal (with argument)

              It seems that the problem appears when you open an ApplicationModal window from an ApplicationModal window. My need is to open window and force the user to interact with it and close it to interact with previous window, so WindowModal is good enough for this

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

                Hi,

                So you have a modal dialog within a modal dialog ?

                This sound a bit bad design wise. In any case, are you calling exec for both dialogs ? If so, you should move to the use of the open method.

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

                M 1 Reply Last reply
                0
                • SGaistS SGaist

                  Hi,

                  So you have a modal dialog within a modal dialog ?

                  This sound a bit bad design wise. In any case, are you calling exec for both dialogs ? If so, you should move to the use of the open method.

                  M Offline
                  M Offline
                  MarcoChiesi79
                  wrote on last edited by MarcoChiesi79
                  #9

                  @SGaist said in QDialog does not sense click when argument are passed:

                  Hi,

                  So you have a modal dialog within a modal dialog ?

                  This sound a bit bad design wise. In any case, are you calling exec for both dialogs ? If so, you should move to the use of the open method.

                  I confirm that I'm using exec for both dialogs, since my goal is to force the user to interact with the dialog before interacting again with the previous one. I will take care of your suggestion to use open method.
                  By the way, I would like to please you to explain better your remark about the design: what's wrong in having a cascade of windows which allow user to interact only with the current one? That's what I want for the application I'm writing.
                  Thank you for your comprehension and patience

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

                    It's not the fact that you need "modal" operations in sequence, it's really just the modal dialog within a modal dialog.

                    Not knowing the logic behind your decision, I can't really say more. It might be worth drawing the flow of that logic to see whether it would maybe make more sense to have a wizard or possibly a state machine to model the sequence of actions.

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

                    M 1 Reply Last reply
                    0
                    • SGaistS SGaist

                      It's not the fact that you need "modal" operations in sequence, it's really just the modal dialog within a modal dialog.

                      Not knowing the logic behind your decision, I can't really say more. It might be worth drawing the flow of that logic to see whether it would maybe make more sense to have a wizard or possibly a state machine to model the sequence of actions.

                      M Offline
                      M Offline
                      MarcoChiesi79
                      wrote on last edited by
                      #11

                      @SGaist said in QDialog does not sense click when argument are passed:

                      It's not the fact that you need "modal" operations in sequence, it's really just the modal dialog within a modal dialog.

                      Not knowing the logic behind your decision, I can't really say more. It might be worth drawing the flow of that logic to see whether it would maybe make more sense to have a wizard or possibly a state machine to model the sequence of actions.

                      I could resume in this way. MainWindow load some settings parameters from a file and load it into an object which has one member for each parameter. I open Settings window passing a reference to the object. In the constructor of the Settings window I set all the parameter coming from main to an object which is a member of Setting window (m_parameter.parameter1 = theparameter->parameter1 and so on...). I want that user can change some of the parameter in Setting window and some of the parameter in a child window (let's call it Setting2), so I repeat the operation passing the member of Setting as reference to Setting2 and in the constructor I repeat assignment. obviously, if the user if changing parameter in Setting2, he should not interact with Setting window. This is what I would like to reach with my application.
                      Thank you for your interest to this!

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

                        Why not separate things like it's done in e.g Qt Creator preferences ?

                        No need for two dialogs. A QListWidget to select which set of parameters to edit and and QStackedWidget to show the corresponding editor. Thus, no need for multiple copies of your parameters object.

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

                        M 1 Reply Last reply
                        1
                        • SGaistS SGaist

                          Why not separate things like it's done in e.g Qt Creator preferences ?

                          No need for two dialogs. A QListWidget to select which set of parameters to edit and and QStackedWidget to show the corresponding editor. Thus, no need for multiple copies of your parameters object.

                          M Offline
                          M Offline
                          MarcoChiesi79
                          wrote on last edited by
                          #13

                          @SGaist

                          Well noted! Thank you for the suggestion!

                          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