📄 toolbar.h
字号:
#ifndef __TOOLBAR_H__#define __TOOLBAR_H__#include <QToolBar>class QMainWindow;namespace gui {class ToolButton;/** Minimal allowed size of one ToolButton */const int MIN_TOOLBUTTON_SIZE=12;/** Maximal allowed size of one ToolButton */const int MAX_TOOLBUTTON_SIZE=128;/** Default size of one ToolButton */const int DEFAULT_TOOLBUTTON_SIZE=22;/** Class wrapping QToolBar, providing "click forwarding" from TButtons. Buttons must be added with addButton() for this to work properly \brief Application toolbar */class ToolBar : public QToolBar { Q_OBJECTpublic: ToolBar(const QString &label,QMainWindow *mainWindow); void addButton(ToolButton *qb);signals: /** Signal emitted to buttons when request to resize them is received @param sz new size of toolbar buttons */ void setNewSize(int sz); /** Signal emitted when clicked on one of toolbar buttons. Send pointer to button with it. @param id pointer to clicked button */ void itemClicked(ToolButton *id); /** Send help message when mouse cursor enters/leaves on of toolbar buttons. Help message is sent on entering and QString::null on leaving. @param message Help message */ void helpText(const QString &message);public slots: void setButtonSizes(int newSize); void slotClicked(ToolButton *id); void receiveHelpText(const QString &message);private: /** Currently set button size, applied on new items */ int currentButtonSize;};} // namespace gui#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -