📄 people.h
字号:
#include "qdatetime.h"class Person {public: Person(QString name, QDate birthdate) QObject(name.ascii()), m_Birthdate(birthdate) {} Person(const Person& p) : QObject(p), m_Birthdate(p.m_Birthdate) {}private: QDate m_Birthdate;};class Student : virtual public Person { /* note keyword virtual here */ // other class members//end//start};class Teacher : virtual public Person { /* virtual inheritance */ // other class members//end//start}class GraduateTeachingFellow : public Student, public Teacher { /* virtual not needed here */public: GraduateTeachingFellow(const Person& p, const Student& s, const Teacher& t): Person(p), Students(s), Teacher(t) {} /* It is necessary to initialize all virtual base classes explicitly in multiply-derived classes, to resolve ambiguity about how they should be initialized. */}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -