-
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
qputenv("QT_MAC_WANTS_LAYER", "1"); //不加这行,程序无响应
MainWindow w;
w.show();
return a.exec();
} -
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
QMenuBar *bar = menuBar();
bar->setNativeMenuBar(false);//不加这样,menu出不来
this->setMenuBar(bar);
QMenu *menu = bar->addMenu("扫描");
}
网友评论