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. Key buffer issue with my QWizard program
QtWS25 Last Chance

Key buffer issue with my QWizard program

Scheduled Pinned Locked Moved Solved General and Desktop
qwizardqwizardpagekeysbuffer
12 Posts 3 Posters 3.7k 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.
  • R Offline
    R Offline
    roseicollis
    wrote on 17 Feb 2016, 14:27 last edited by roseicollis
    #1

    Hi again!

    I'm back with my QWizard and QWizardpages program... I'm having some problems with the key buffer...
    My program is like:

    • WP1 : You start here and you have 3 big QPushButton with the first one focused. If you press Enter then you go to the next WP: let's say its WP2:
    • WP2: It's like WP1 (to simplify) so, if you press enter you have selected the first option and you go to WP3.

    The normal behaviour should be: WP1 is loaded > Press Enter > loads WP2 > press Enter > loads WP3 > ... BUT if I'm in WP1 and I pres Enter 4 times quickly it goes directly to WP5 (Imagine the tipical impatient user) or... If I push Enter shakily or somethig like that it skips wizardpages.

    So here is my question: How can avoid that? Can I reset the buffer in every page, if yes how? Of course, changing the behaviour about the program is not an option ( The pushbutton has to be focused, if you press enter then you go to the next page, and so on...)

    Note: In some pages there are no QPushbutton so the wizard's NextButton has the focus and it's the same problem (I say that if someone is wondering why QPushButtons instead of wizard's buttons)

    Thank you!!!
    P.D: I'm almost done with the program or at least I hope so :D

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 17 Feb 2016, 23:13 last edited by
      #2

      Hi,

      In that case shouldn't the Next button be disabled until one of the button is clicked ?

      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
      • R Offline
        R Offline
        roseicollis
        wrote on 18 Feb 2016, 08:10 last edited by
        #3

        It's something strange.. let's say that in the wizardpages where there are QPushButtons, the Wizard's nextButton is disabled and the first QPushButton is focused while in the wizardpages that just contain/show information, the next button is enabled and focused so no matter in which page you are, if I press enter many times it skips the pages... (Imagine that when you press enter in WP1 some information is saved and some things done so it takes 2-3 seconds to change to the next WP (which is ok) but in that seconds you press Enter 4 times more.... then you will see WP5 instead of WP2). Hope it is clearer now :)

        K 1 Reply Last reply 18 Feb 2016, 11:06
        0
        • R roseicollis
          18 Feb 2016, 08:10

          It's something strange.. let's say that in the wizardpages where there are QPushButtons, the Wizard's nextButton is disabled and the first QPushButton is focused while in the wizardpages that just contain/show information, the next button is enabled and focused so no matter in which page you are, if I press enter many times it skips the pages... (Imagine that when you press enter in WP1 some information is saved and some things done so it takes 2-3 seconds to change to the next WP (which is ok) but in that seconds you press Enter 4 times more.... then you will see WP5 instead of WP2). Hope it is clearer now :)

          K Offline
          K Offline
          kshegunov
          Moderators
          wrote on 18 Feb 2016, 11:06 last edited by
          #4

          @roseicollis
          Hello,

          Imagine that when you press enter in WP1 some information is saved and some things done so it takes 2-3 seconds to change to the next WP (which is ok) but in that seconds you press Enter 4 times more.... then you will see WP5 instead of WP2). Hope it is clearer now

          Well, I'd guess you're blocking the event loop and when you after you switch the pages Qt processes the pending events so they get switched yet again. Could you check what happens if you call QApplication::processEvents() immediately before you switch to the next page?

          Kind regards.

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          0
          • R Offline
            R Offline
            roseicollis
            wrote on 19 Feb 2016, 12:41 last edited by
            #5

            @kshegunov said:

            Could you check what happens if you call QApplication::processEvents() immediately before you switch to the next page?

            What should I expect? It's like if it did nothing... should I see a change?

            Anyway I've found that there is another problem with that: If I press Enter WITHOUT releasing the key, its the same as press it infinity times so I guess this is my main problem right now because there are some users that press Enter so slowly that keep it pushed some secs...

            K 1 Reply Last reply 19 Feb 2016, 12:58
            0
            • R roseicollis
              19 Feb 2016, 12:41

              @kshegunov said:

              Could you check what happens if you call QApplication::processEvents() immediately before you switch to the next page?

              What should I expect? It's like if it did nothing... should I see a change?

              Anyway I've found that there is another problem with that: If I press Enter WITHOUT releasing the key, its the same as press it infinity times so I guess this is my main problem right now because there are some users that press Enter so slowly that keep it pushed some secs...

              K Offline
              K Offline
              kshegunov
              Moderators
              wrote on 19 Feb 2016, 12:58 last edited by kshegunov
              #6

              @roseicollis said:

              What should I expect? It's like if it did nothing... should I see a change?

              You'd expect the key events be processed before switching the page. However this as it seems might not be enough.
              Can you share the code where you switch from one page to the next (the Qt part of it, not what you do with the user data)?

              Anyway I've found that there is another problem with that: If I press Enter WITHOUT releasing the key, its the same as press it infinity

              Holding the Enter key will put events in the event loop queue and their number depends on the time you'd been holding the key.

              Kind regards.

              Read and abide by the Qt Code of Conduct

              1 Reply Last reply
              0
              • R Offline
                R Offline
                roseicollis
                wrote on 24 Feb 2016, 10:53 last edited by
                #7

                @kshegunov said:

                You'd expect the key events be processed before switching the page. However this as it seems might not be enough.

                No, it seems its not but don't worry, my mate told me he has desactivated it on the system so I don't have to deal with that problem anymore :D

                Thank you for all @kshegunov !!

                K 1 Reply Last reply 24 Feb 2016, 10:58
                0
                • R roseicollis
                  24 Feb 2016, 10:53

                  @kshegunov said:

                  You'd expect the key events be processed before switching the page. However this as it seems might not be enough.

                  No, it seems its not but don't worry, my mate told me he has desactivated it on the system so I don't have to deal with that problem anymore :D

                  Thank you for all @kshegunov !!

                  K Offline
                  K Offline
                  kshegunov
                  Moderators
                  wrote on 24 Feb 2016, 10:58 last edited by
                  #8

                  @roseicollis
                  No problem. Don't forget to mark your topic as solved (I know it seems tedious, but it looks good on the forum to have more blue than green ;)).

                  Kind regards.

                  Read and abide by the Qt Code of Conduct

                  R 1 Reply Last reply 24 Feb 2016, 12:21
                  0
                  • K kshegunov
                    24 Feb 2016, 10:58

                    @roseicollis
                    No problem. Don't forget to mark your topic as solved (I know it seems tedious, but it looks good on the forum to have more blue than green ;)).

                    Kind regards.

                    R Offline
                    R Offline
                    roseicollis
                    wrote on 24 Feb 2016, 12:21 last edited by
                    #9

                    @kshegunov isn't it marked? I marked it before writting the answer :S (The other topic I have about the dialog, I had to write solved on the title because the "Mark as Solved" option does not appear on Topic Tools dunno why.. and also I lost my pic here and I can't load a new none :( )

                    K 1 Reply Last reply 24 Feb 2016, 18:01
                    0
                    • R roseicollis
                      24 Feb 2016, 12:21

                      @kshegunov isn't it marked? I marked it before writting the answer :S (The other topic I have about the dialog, I had to write solved on the title because the "Mark as Solved" option does not appear on Topic Tools dunno why.. and also I lost my pic here and I can't load a new none :( )

                      K Offline
                      K Offline
                      kshegunov
                      Moderators
                      wrote on 24 Feb 2016, 18:01 last edited by
                      #10

                      @roseicollis
                      Possibly my view hadn't updated.

                      The other topic I have about the dialog, I had to write solved on the title because the "Mark as Solved" option does not appear on Topic Tools dunno why

                      Maybe you hadn't created is as a "question" topic and that's why the option weren't available in the topic tools. As for the picture, the only possibility is to setup a Gravatar account with your forum email and select the option in the profile, uploads are disabled.

                      Read and abide by the Qt Code of Conduct

                      R 1 Reply Last reply 25 Feb 2016, 08:29
                      0
                      • K kshegunov
                        24 Feb 2016, 18:01

                        @roseicollis
                        Possibly my view hadn't updated.

                        The other topic I have about the dialog, I had to write solved on the title because the "Mark as Solved" option does not appear on Topic Tools dunno why

                        Maybe you hadn't created is as a "question" topic and that's why the option weren't available in the topic tools. As for the picture, the only possibility is to setup a Gravatar account with your forum email and select the option in the profile, uploads are disabled.

                        R Offline
                        R Offline
                        roseicollis
                        wrote on 25 Feb 2016, 08:29 last edited by
                        #11

                        @kshegunov said:

                        Maybe you hadn't created is as a "question" topic

                        O.o is there any other type of question? Maybe I did it wrong... :S

                        setup a Gravatar account with your forum email and select the option in the profile

                        I don't get why can't you upload a pic like before and you have to use that which I suppose is another webpage... but this is not the properly place to discuss something like that... Ty @kshegunov ^^

                        K 1 Reply Last reply 25 Feb 2016, 10:16
                        0
                        • R roseicollis
                          25 Feb 2016, 08:29

                          @kshegunov said:

                          Maybe you hadn't created is as a "question" topic

                          O.o is there any other type of question? Maybe I did it wrong... :S

                          setup a Gravatar account with your forum email and select the option in the profile

                          I don't get why can't you upload a pic like before and you have to use that which I suppose is another webpage... but this is not the properly place to discuss something like that... Ty @kshegunov ^^

                          K Offline
                          K Offline
                          kshegunov
                          Moderators
                          wrote on 25 Feb 2016, 10:16 last edited by
                          #12

                          @roseicollis

                          O.o is there any other type of question? Maybe I did it wrong... :S

                          There's a "general topic" and a "question topic".

                          I don't get why can't you upload a pic like before and you have to use that which I suppose is another webpage...

                          Look here.

                          Read and abide by the Qt Code of Conduct

                          1 Reply Last reply
                          0

                          10/12

                          24 Feb 2016, 18:01

                          • Login

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