QT+VS menu bar use

tags: qt+vs  Experience sharing  c++  qt  

qt5.3.1 +vs2013

Enter the menu bar in UI, edit ObjectName

In the .h file

private slots:

	void on_actionOpen_triggered();
	void on_actionClear_triggered();
	void on_actionStart_triggered();

In .cpp files

    connect(ui.action_open, SIGNAL(triggered()), this, SLOT(on_actionOpen_triggered()));
	connect(ui.action_clear, SIGNAL(triggered()), this, SLOT(on_actionClear_triggered()));
	connect(ui.action_change, SIGNAL(triggered()), this, SLOT(on_actionStart_triggered()));
void ReName::on_actionStart_triggered()
{
	on_pushButton_Start_clicked();
}

Finish. Clicked behavior of the menu

Intelligent Recommendation

Qt custom menu bar

Custom menu bar needs to inherit from qwidgetAction. New desktop application testqmenucustom, base class qmainwindow, check the creation interface file, other options default. The current project adds...

【Qt】 QT menu bar, status bar, toolbar

Menu bar, toolbar, status bar The main window framework (qmainwindow) has its own layout, including the following components: Menu Bar The menu bar contains a list of drop -down menu items, which are ...

The use of QAction in the menu bar, toolbar, status and adding shortcut keys in Qt

"demand analysis: ① "Action/Action" with response is implemented using QAction. The response here is a pop-up "message box". ②The "Action" can be clicked on the menu...

Qt add menu bar and toolbar

Qt add menu bar and toolbar Release notes version Author time Remarks 0.1 loon 2018.10.24 First draft table of Contents Article directory Qt add menu bar and toolbar Release notes table of Contents Fi...

QT-menu bar, toolbar, etc.

In fact, I feel that QT can be understood as a library. Many things in programming are still the same as C++. The main learning is some interface functions of QT. When you meet certain needs, you can ...

More Recommendation

Qt designer-menu bar and toolbar

Adding the first level menu Create a window, select MainWindow Click Type here to add tabs and shortcut keys. Note that you use & when editing shortcut keys, such as menu (&F). After editing, ...

Qt entry series-menu bar

  The menu bar is usually only used in programs with QMainWindow as the base class, and programs with QWidget as the base class usually don't have a menu bar.This article introduces the related operat...

Qt Menu Bar Chapter 2

mainwindow.h main.cpp mainwindow.cpp...

3. Settings of the menu bar in QT

The setting of the menu bar mainly includes the following processes: 1. Add a menu bar: QMenuBar 2. Add a menu to the menu bar: QMenu 3. Add options to the menu and add actions: QAction 4. Add a divid...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top