当前位置:网站首页>Main window in QT application

Main window in QT application

2022-07-05 01:20:00 A raindrop pouring into the sea

1. Toolbar of the main window in the application
The main window is with the user Top level window for long-term interaction
programmatic most Functions are directly provided by the main window
The main window is usually The first window displayed after the application starts
The whole program consists of a main window and Multiple dialog boxes form
Qt The main window in :
Qt The concept of main window is directly supported in the development platform
QMainWindow yes Qt The base class of the main window in
QMainWindow Inherited from QWidget Is a container type component
QMainWindow The secret encapsulated in :
 Insert picture description here QMainWindow Component layout in :
 Insert picture description here stay Qt Provides menu related class components :
 Insert picture description here stay Qt Create a menu in the main window :

QMenubar* mb = menuBar();  //member function
QMenu* menu = new QMenu("File(&F)");
QAction* action = new QAction("New", NULL);

menu->addAction(action);
mb->addMenu(menu);

Shortcut key settings :

action->setShortcut(QKeySequence(KEY));

QKeySeauence - Qt Classes related to shortcut keys in 
KEY - QT Constants representing key values in 

2. Status bar in main window

原网站

版权声明
本文为[A raindrop pouring into the sea]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202141035563344.html