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. automatic key ?

automatic key ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 420 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.
  • D Offline
    D Offline
    Duy Khang
    wrote on last edited by
    #1

    how to automatic press a key in Qt5.///

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Its a little vague what you want to do :)

      You mean press a key in your own app for some other app ?

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Duy Khang
        wrote on last edited by
        #3

        i just want to automatic reload and display infomation to a widget by Key_F5 but not touch F5 .

        mrjjM 1 Reply Last reply
        0
        • D Duy Khang

          i just want to automatic reload and display infomation to a widget by Key_F5 but not touch F5 .

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #4

          @Duy-Khang
          well you can try sending it a key event (up and down events)

          QKeyEvent * eve1 = new QKeyEvent (QEvent::KeyPress,Qt::Key_F5,Qt::NoModifier,"F5");
          QKeyEvent * eve2 = new QKeyEvent (QEvent::KeyRelease,Qt::Key_F5,Qt::NoModifier,"F5");
          
          qApp->postEvent((QObject*)ui->thewidget,(QEvent *)eve1);
          qApp->postEvent((QObject*)ui->thewidget,(QEvent *)eve2);
          

          Does F5 normally call your own code or is it a widget HTML browser and it is its code ?

          1 Reply Last reply
          0
          • D Offline
            D Offline
            Duy Khang
            wrote on last edited by
            #5

            Untitled.png

            in picture 1, i will change information and after picture 1 closed, I want picture 2 automatic update information. How I o=do it ?

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

              Hi,

              Looks like picture 2 is a dialog, so if you are using exec, just update the content of picture 1 and it will be refreshed automatically.

              Other than that, you should provide more information about what is picture 1.

              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
              1
              • nageshN Offline
                nageshN Offline
                nagesh
                wrote on last edited by
                #7

                @Duy-Khang It all depends on how the picture-2 data is populated?
                if this information is through database of student? then ,
                in picture-1 you are having "Update" button right? Store the updated information into database first and reload the picture-2 to reflect that data is updated.

                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