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. Qt- esc key release issue

Qt- esc key release issue

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 4 Posters 2.5k 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.
  • S Offline
    S Offline
    Slyvr
    wrote on last edited by
    #1

    I have an application in which i have a class T derived from X, and X is derived from QWidget class. In class X i have an overwritten key release event handler which treats the esc key code when released by closing the window and performing some actions. If T doesn't overwrite that and enharits the behaviour from X, when i press esc and T is busy handling the key release and performing certain actions, if I press esc again by what handler will it be handled (i get a weird seg fault, and i'm sure it's from my code, but i can't trace where the second esc key release is handled, and I don't have a lot of experience with this framework) thanks in advance :)

    Came here to code and drink coffee... And I'm all out of coffee...

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Please just show us your key handing reimplementations... We can't help you trace down what happens without seeing your (relevant) code.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Slyvr
        wrote on last edited by
        #3

        [quote author="Andre" date="1341920033"]Please just show us your key handing reimplementations... We can't help you trace down what happens without seeing your (relevant) code. [/quote]

        ok, i will come with the code soon, thanks for the answer

        Came here to code and drink coffee... And I'm all out of coffee...

        1 Reply Last reply
        0
        • T Offline
          T Offline
          tucnak
          wrote on last edited by
          #4

          [quote author="Slyvr" date="1341929415"]
          [quote author="Andre" date="1341920033"]Please just show us your key handing reimplementations... We can't help you trace down what happens without seeing your (relevant) code. [/quote]

          ok, i will come with the code soon, thanks for the answer [/quote]

          Yeah, it will be great.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Slyvr
            wrote on last edited by
            #5

            well the classes are something like
            @
            class T:public X{
            ...

            class X: public QWidget {
            ....
            @
            and the handler in X is
            @
            void X::keyReleaseEvent(QKeyEvent* e){

            if(e->key()==X->getEscKeyCode)
            FunctionDoingSomething();

            }
            @
            and T just enharits it from X, no modification.

            So when it is T, in FunctionDoingSomething(), to be more exact, how will the keyrelease of Esc be treated, because i want to trace it's effect, it goes into segmentation fault

            Edit: use @ tags around code sections please, Andre

            Came here to code and drink coffee... And I'm all out of coffee...

            1 Reply Last reply
            0
            • F Offline
              F Offline
              franku
              wrote on last edited by
              #6

              bq. @#
              if(e->key()==X->getEscKeyCode)

                        FunctionDoingSomething();
              

              @

              Where does the X-> come from? You probably ment to use X::getEscKeyCode()? Please send a copy of your original source code, as this "pseudo code" does not help to help you.

              This, Jen, is the internet.

              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