11 #include "../core/log.h" 15 QModelIndex indexFromItem(QTreeWidgetItem *item,
int column = 0)
const {
16 return QTreeWidget::indexFromItem(item, column);
18 QTreeWidgetItem *itemFromIndex(
const QModelIndex &index)
const {
19 return QTreeWidget::itemFromIndex(index);
23 void startOnMainThreadAsync(
const std::function<
void()> &fun);
25 void startOnObjectThreadAsync(QObject *
object,
26 const std::function<
void()> &fun);
28 QIcon _createTextIcon(
const QString &str);
29 #define TEXT_ICON(str) \ 31 static QIcon icon = _createTextIcon(str); \ 35 QIcon _createMaterialIcon(
const QString &str,
double padding = 0.1);
36 #define MATERIAL_ICON(...) \ 38 static QIcon icon = _createMaterialIcon(__VA_ARGS__); \ 42 QIcon _create_FA_R_Icon(
const QString &str,
double padding = 0.1);
43 #define FA_R_ICON(...) \ 45 static QIcon icon = _create_FA_R_Icon(__VA_ARGS__); \ 49 QIcon _create_FA_S_Icon(
const QString &str,
double padding = 0.1);
50 #define FA_S_ICON(...) \ 52 static QIcon icon = _create_FA_S_Icon(__VA_ARGS__); \ 65 FlatButton(
const QIcon &icon,
const QString &text) {
74 virtual QSize minimumSizeHint()
const override;
75 virtual QSize sizeHint()
const override;
76 virtual void paintEvent(QPaintEvent *event)
override;