Qt 6 Core Intermediate with C++

1. Welcome to the Course

1.1. What does this course cover

1.2. What this course doesn’t cover

1.3. Challenges with intermediate

1.4. Who should take this course

1.5. Course prerequisites

1.6. If you don’t know C++

1.7. Who is the instructor

1.8. Raw and unfiltered

1.9. Qt overview

1.10. Courses overview

1.11. Qt is massive

1.12. What, why, how, recap

1.13. Goals of the course

1.14. What is Qt

1.15. What can you make with Qt

1.16. Have Qt already installed

1.17. Installation issues

1.18. Expect issues

1.19. Bugs

1.21. Reviews and feedback

1.23. Skipped the beginners course

2. Before we dive in

2.1. Changes from Qt 5

2.2. Installing Qt

3. What is a QObject

3.1. QObject Class

信号(发送信号)和槽(消耗信号)
qt creator

QCoreApplication提供事件循环, 让程序一直运行

#include <QCoreApplication>
#include <QDebug>
#include "test.h"

void lifecycle() {
    // 执行了构造函数和析构函数, 可知qt自动进行了内存管理
    Test t;
}

int main(int argc, char *argv[]) {
    QCoreApplication a(argc, argv);
//    qDebug() << "Hello World";
    lifecycle();
    return QCoreApplication::exec();
}
#include "test.h"
#include <QObject>

Test::Test(QObject *parent) : QObject(parent) {
    qInfo() << this << "Constructed";
}

Test::~Test() {
    qInfo() << this << "Deconstructed";
}
#ifndef QT6CI_3_TEST_H
#define QT6CI_3_TEST_H

#include <QObject>
#include <QDebug>

class Test : public QObject {
    Q_OBJECT

public:
    explicit Test(QObject *parent = nullptr);
    ~Test();

signals:


private:
};


#endif //QT6CI_3_TEST_H

3.2. QObject macro


  目录