How to find the variables button in Qt creator

非 Y 不嫁゛ 提交于 2019-12-11 12:46:01

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!