Init
This commit is contained in:
19
src/guimacros.h
Normal file
19
src/guimacros.h
Normal 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
|
||||
Reference in New Issue
Block a user