问题
I'm reading Qt Documentation, Specifying Build Settings section. Under the 'Using Qt Creator Variables' I found following sentence.
Select the (Variables) button in a field to select from a list of variables that are available in a particular context.
But I found no Variables button in Qt Creator 3.3.0. Just found the same question asked in a forum.
Can anybody explain me what it is or where I can find the button?
回答1:
You can use SIGNAL AND SLOT
Drop in form some button,
cpp file.
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(ui->button1,SIGNAL(clicked),this,SLOT(someRecivedFunc));
}
MainWindow::~MainWindow()
{
delete ui;
conn.close();
}
void MainWindow::someRecivedFunc(){
}
h file
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "QMainWindow" </pre>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void someRecivedFunc();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
回答2:
I think some fields can have a select variable button, and some don't. For example, in "Left Panel -> Projects -> Run Settings" both Run: argument field and Run:working directory field can use the select variable buttons to the right side of the fields.
来源:https://stackoverflow.com/questions/34280801/how-to-find-the-variables-button-in-qt-creator