connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(hello()));
void MainWindow::hello()
{
QStringList arguments;
arguments << "Enable custom transitions" << "Droid Sans" << "Black";
QProcess::execute("/path/to/my/script/script.sh", arguments);
}
#include <QProcess> #include <QStringList>
#include <QProcess> #include <QStringList>
#include <QProcess>
#include <QStringList>
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(hello()));
delete ui;
}
void MainWindow::hello()
{
QStringList arguments;
arguments << "Enable custom transitions" << "Droid Sans" << "Black";
QProcess::execute("/path/to/my/script/script.sh", arguments);
}
ui->myComboBox->doStuff();
| The Following User Says Thank You to Venemo For This Useful Post: | ||
#include <QProcess> #include <QStringList>
#include <QtCore> #include <QtGui>
| The Following User Says Thank You to Venemo For This Useful Post: | ||
class MainWindow : .....
{
// ....
public slots:
void hello();
// ....
};
ui->myComboBox->doStuff();


QString myString;
myString = "mydefaultstuff"
myString = text;

ui->myComboBox->currentText(); //This property holds the text of the current item.
connect(ui->myComboBox, SIGNAL(currentIndexChanged(QString), this, SLOT(comboBoxCurrentIndexChanged(QString));
void MainWindow::comboBoxCurrentIndexChanged(const QString &text) {
//Do something
}