-
-
Save HaiyongJiang/0fb65bdb6a23f04acd44 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# suppose you have created a ui file called configwin.ui | |
cmake_minimum_required (VERSION 2.6) | |
project(tst) | |
find_package(Qt5Widgets) | |
set(CMAKE_AUTOMOC ON) | |
set(CMAKE_INCLUDE_CURRENT_DIR ON) | |
QT5_WRAP_CPP(tst_hdr_moc configwin.h) | |
QT5_WRAP_UI(tst_form_hdr configwin.ui) | |
add_library(configwin ${tst_hdr_moc} ${tst_form_hdr}) | |
qt5_use_modules(configwin Widgets) | |
add_executable(tst setting.cpp configwin) | |
qt5_use_modules(tst Core Gui Widgets) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "configwin.h" | |
ConfigWin::ConfigWin(QWidget *parent) : | |
QDialog(parent), | |
ui(new Ui::ConfigWin) | |
{ | |
ui->setupUi(this); | |
} | |
ConfigWin::~ConfigWin() | |
{ | |
delete ui; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef CONFIGWIN_H | |
#define CONFIGWIN_H | |
#include "ui_configwin.h" | |
namespace Ui { | |
class ConfigWin; | |
} | |
class ConfigWin : public QDialog | |
{ | |
Q_OBJECT | |
public: | |
explicit ConfigWin(QWidget *parent = 0); | |
~ConfigWin(); | |
private: | |
Ui::ConfigWin *ui; | |
}; | |
#endif // CONFIGWIN_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QApplication> | |
#include "configwin.h" | |
int main(int argc, char *argv[]) | |
{ | |
QApplication a(argc, argv); | |
ConfigWin w; | |
w.show(); | |
return a.exec(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment