Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved automatic key ?

    General and Desktop
    4
    7
    114
    Loading More Posts
    • 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
      Duy Khang last edited by

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

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • D
          Duy Khang last edited by

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

          mrjj 1 Reply Last reply Reply Quote 0
          • mrjj
            mrjj Lifetime Qt Champion @Duy Khang last edited by mrjj

            @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 Reply Quote 0
            • D
              Duy Khang last edited by

              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 Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                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 Reply Quote 1
                • nagesh
                  nagesh last edited by

                  @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 Reply Quote 0
                  • First post
                    Last post