Answer the question
In order to leave comments, you need to log in
Qt development - structure of a Qt application.?
Where can I find out what the structure of a Qt project looks like? How to separate the user interface from the engine. I would like to know all these subtleties. I am currently developing the STuring program ( GitHub ). There, the interface and the engine are in the same class. I would like to fix this.
Answer the question
In order to leave comments, you need to log in
Watch this video . This is how, for starters, the structure of your application should look like.
1. Use Qt Designer to build a graphical interface (rather than hand-to-hand placement of widgets, as you do).
2. In the first, most simple application, there should be 4 source code files.
main.cpp
MainWindow.h
MainWindow.cpp
MainWindow.ui
// MainWindow.h
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget * parent = 0);
~MainWindow();
signals:
protected:
private:
Ui::MainWindow * ui;
};
// MyTabWidget1.h
#pragma once
#include <QWidget>
namespace Ui {
class MyTabWidget1;
}
class MyTabWidget1: public QWidget
{
Q_OBJECT
public:
explicit MyTabWidget1(QWidget * parent = 0);
~MyTabWidget1();
private:
Ui::MyTabWidget1* ui;
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question