тестовый пример 0:
Код: Выделить всё
QApplication a(argc, argv);
MainWindow w; // MainWindow is a class inheriting from QMainWindow
w.show();
return a.exec();
тестовый пример 1:
Код: Выделить всё
execute_python_program("qdiag-with-qapplication.py");
// execute_python_program is a program modified from
// https://docs.python.org/3/extending/embedding.html#very-high-level-embedding
Код: Выделить всё
QApplication
тестовый пример 2:
Код: Выделить всё
QApplication a(argc, argv);
MainWindow w; // MainWindow is a class inheriting from QMainWindow
w.show();
execute_python_program("../qdiag-without-qapplication.py");
return a.exec();
воспроизведите 3 тестовых примера:
Код: Выделить всё
$ git clone https://github.com/w3ntao/Qt-CMake-HelloWorld.git
$ cd Qt-CMake-HelloWorld
$ mkdir build
$ cmake ..
$ make -j4
$ ./hello-qt 0
$ ./hello-qt 1
$ ./hello-qt 2
- Код C++/Qt был заимствован из https://github.com/jasondegraw/Qt-CMake- HelloWorld
- Код внедрения Python был заимствован из https://docs.python.org/3/extending/emb ... #very-high -level-embedding
Подробнее здесь: https://stackoverflow.com/questions/790 ... s-not-show