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. How to catch the shell command information?
Forum Update on Monday, May 27th 2025

How to catch the shell command information?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 2 Posters 315 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.
  • Y Offline
    Y Offline
    Yen_Chou
    wrote on last edited by
    #1

    Hi All,
    I used the shell command getevent to catch the keypad information.
    I could use getevent to catch the push button interrupt of keypad in shell,but I could not use QT to catch the getevent information.
    Could any function solve the problem?

    jsulmJ 1 Reply Last reply
    0
    • Y Yen_Chou

      Hi All,
      I used the shell command getevent to catch the keypad information.
      I could use getevent to catch the push button interrupt of keypad in shell,but I could not use QT to catch the getevent information.
      Could any function solve the problem?

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

      @Yen_Chou You can use QProcess to execute other executables. And get their output via https://doc.qt.io/qt-5/qprocess.html#readAllStandardOutput

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

      1 Reply Last reply
      3
      • Y Offline
        Y Offline
        Yen_Chou
        wrote on last edited by
        #3

        @jsulm
        Thank you for your help.
        I used the qprocess readAllStandardOutput function,but it still did not output the information immediately until I pushed the button many times.

        jsulmJ 1 Reply Last reply
        0
        • Y Yen_Chou

          @jsulm
          Thank you for your help.
          I used the qprocess readAllStandardOutput function,but it still did not output the information immediately until I pushed the button many times.

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

          @Yen_Chou With that amount of information nobody will be able to tell you what is wrong.
          Please tell us what you did, best would be to show the code.
          Also, you should use https://doc.qt.io/qt-5/qprocess.html#readyReadStandardOutput signal and call readAllStandardOutput in the slot connected to that signal. And you should read the readAllStandardError() (here also connect slot to https://doc.qt.io/qt-5/qprocess.html#readyReadStandardError)

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

          1 Reply Last reply
          4

          • Login

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