#include "QMainwindow.h" #include #include "BZStruct.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); a.setWindowIcon(QIcon(":/QMainwindow/main.ico")); // 主窗口图标 QFile styleFile("D:\\Projects\\Trade\\QTradeProgram\\QMainwindow\\styles\\dark_theme.qss"); if (styleFile.open(QIODevice::ReadOnly | QIODevice::Text)) { //QString styleSheet = QLatin1String(styleFile.readAll()); //a.setStyleSheet(styleSheet); //styleFile.close(); } // 注册自定义类型(必须调用!) qRegisterMetaType("BigOrderInfo"); // 对于信号槽中的引用类型,还需注册引用版本 qRegisterMetaType("BigOrderInfo&"); QMainwindow w; w.setWindowIcon(QIcon(":/QMainwindow/main.ico")); // 主窗口图标 w.show(); return a.exec(); }