This commit is contained in:
Krad
2021-10-09 16:38:34 +08:00
parent 2b8c18277d
commit e56d43ae97
41 changed files with 1023 additions and 0 deletions

19
src/guimacros.h Normal file
View File

@@ -0,0 +1,19 @@
//
// Created by Krad on 2021/10/8.
//
#ifndef GUI_GUIMACROS_H
#define GUI_GUIMACROS_H
#define ADD_TOOL_BTN_TO_LAYOUT(name,img,layout)\
QToolButton* btn##name= new QToolButton(this);\
btn##name->setToolButtonStyle(Qt::ToolButtonIconOnly);\
btn##name->setIcon(QIcon(img));\
btn##name->setIconSize(QSize(120,120));\
btn##name->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);\
btn##name->setText(#name);\
layout->addWidget(btn##name);
#define ADD_TOOL_BTN(name,img)\
ADD_TOOL_BTN_TO_LAYOUT(name,img,layout)
#endif //GUI_GUIMACROS_H