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. Help: How to design/edit the "push button" slot(e.g. scan())
Forum Update on Monday, May 27th 2025

Help: How to design/edit the "push button" slot(e.g. scan())

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 1.4k 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
    yjwu.nknu
    wrote on last edited by
    #1

    Hello smart guys:
    1)I have installed some "the command line" platforms on Fedora 19(x86_64)
    2)Those platforms with some "command" could scan the system.
    3)I have installed the latest Qt creator.
    4)I find the push button widget in Qt designer, and I hope that I would use it as the "scan" behavior.
    Should I import or edit the new one slot on such button widget?
    How to do it?
    Thank you gratefully

    1 Reply Last reply
    0
    • L Offline
      L Offline
      leon.anavi
      wrote on last edited by
      #2

      Have a look at the "wiki article about using QPushBUtton":http://qt-project.org/wiki/How_to_Use_QPushButton. Implement your scanning functionality to a slot and connect it to the released signal of the button.

      http://anavi.org/

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        yjwu.nknu
        wrote on last edited by
        #3

        **Execuse me,sir:
        I am a newbie for it.
        Could you provide the detailed example or method to implement the scan operation on the QPushBUtton ?
        My schema are as following:

        1. open the terminal
        2. perform scan : keyin "command parameter --output result.file source.file" under the prompt on the terminal
        3. How to convert the 2ndQustion to the button
        4. that is. connect(button, signal(clicked()), slot, scan())
        5. source.file path-->"button" , and then press "the button" to start to scan
        1 Reply Last reply
        0
        • L Offline
          L Offline
          leon.anavi
          wrote on last edited by
          #4

          In general it is not a good idea to run an external application through another app but you can do this in "Qt using class QProcess and its method start":http://qt-project.org/doc/qt-5/qprocess.html#start:
          @
          QProcess process;
          process.start("command");
          @

          As an optional second argument you can specify arguments that should be passed the to the command. So in general you can bind a slot that executes the command to the signal emitted by the button.

          I repeat again that in general running an external application/command through Qt app is not recommended and it is better to implement everything inside you app.

          http://anavi.org/

          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