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. Get QString from Combobox and use in QPushButton system() call?
Forum Updated to NodeBB v4.3 + New Features

Get QString from Combobox and use in QPushButton system() call?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 3 Posters 756 Views 2 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.
  • V Offline
    V Offline
    vailixi
    wrote on last edited by
    #1

    I'm kinda new to Qt and I want to create a simple interface for a command a command line program. I figured the easiest way to do this with was to use comboBoxes to select the required options then concatenate them together into a single string and use that for system() But I'm having all kinds of trouble actually getting it to work. I have the idea for what I want the program to do. Where should I look for some good examples of programs with currently working syntax for Qt5 C++

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

      Hi
      Qt has a much better alternative that system();
      Its called QProcess.

      QString program = "./path/to/Qt/examples/widgets/analogclock";
      QStringList arguments;
      arguments << "-style" << "motif"; // each argument with << 
       QProcess myProcess;
      myProcess.start(program, arguments);
      
      1 Reply Last reply
      1
      • V vailixi

        I'm kinda new to Qt and I want to create a simple interface for a command a command line program. I figured the easiest way to do this with was to use comboBoxes to select the required options then concatenate them together into a single string and use that for system() But I'm having all kinds of trouble actually getting it to work. I have the idea for what I want the program to do. Where should I look for some good examples of programs with currently working syntax for Qt5 C++

        ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        @vailixi Hi! The wiki has a nice article for newcomers: https://wiki.qt.io/Qt_for_Beginners

        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