参考:https://blog.csdn.net/lusirking/article/details/83988421
C++冒号初始化
在C++类的构造函数中经常会看到如下格式的写法:
MyWindow::MyWindow(QWidget* parent , Qt::WindowFlags flag)
: QMainWindow(parent,flag)
上述语句中单冒号(:)后面是初始化列表
作用类似于在构造函数MyWindow被执行时,执行QMainWindow(parent,flag)。