mirror of
https://github.com/jaredtao/TaoQuick.git
synced 2025-01-31 21:22:58 +08:00
updat tables; add PropertyHelper.h
This commit is contained in:
parent
6490901433
commit
bb09cc2a37
47
3rdparty/TaoCommon/Common/PropertyHelper.h
vendored
Normal file
47
3rdparty/TaoCommon/Common/PropertyHelper.h
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
#pragma once
|
||||
#include <QObject>
|
||||
|
||||
#define READ_PROPERTY(TYPE, NAME) \
|
||||
private: \
|
||||
Q_PROPERTY(TYPE NAME READ NAME NOTIFY NAME##Changed) \
|
||||
public: \
|
||||
const TYPE &NAME() const \
|
||||
{ \
|
||||
return m_##NAME; \
|
||||
} \
|
||||
Q_SIGNAL void NAME##Changed(const TYPE &value); \
|
||||
\
|
||||
private: \
|
||||
TYPE m_##NAME;
|
||||
|
||||
#define READONLY_PROPERTY(TYPE, NAME) \
|
||||
private: \
|
||||
Q_PROPERTY(TYPE NAME READ NAME CONSTANT) \
|
||||
public: \
|
||||
const TYPE &NAME() const \
|
||||
{ \
|
||||
return m_##NAME; \
|
||||
} \
|
||||
\
|
||||
private: \
|
||||
TYPE m_##NAME;
|
||||
|
||||
#define AUTO_PROPERTY(TYPE, NAME) \
|
||||
private: \
|
||||
Q_PROPERTY(TYPE NAME READ NAME WRITE NAME NOTIFY NAME##Changed) \
|
||||
public: \
|
||||
const TYPE &NAME() const \
|
||||
{ \
|
||||
return m_##NAME; \
|
||||
} \
|
||||
void NAME(const TYPE &value) \
|
||||
{ \
|
||||
if (m_##NAME == value) \
|
||||
return; \
|
||||
m_##NAME = value; \
|
||||
emit NAME##Changed(value); \
|
||||
} \
|
||||
Q_SIGNAL void NAME##Changed(const TYPE &value); \
|
||||
\
|
||||
private: \
|
||||
TYPE m_##NAME;
|
1
3rdparty/TaoCommon/TaoCommon.pri
vendored
1
3rdparty/TaoCommon/TaoCommon.pri
vendored
@ -6,6 +6,7 @@ INCLUDEPATH += $$PWD
|
||||
|
||||
HEADERS += \
|
||||
$$PWD/Common/FileReadWrite.h \
|
||||
$$PWD/Common/PropertyHelper.h \
|
||||
$$PWD/Common/ObjectMap.h \
|
||||
$$PWD/QuickTool/QuickTool.h \
|
||||
$$PWD/Common/Subject.h \
|
||||
|
@ -16,16 +16,13 @@ Item {
|
||||
Row {
|
||||
spacing: 10
|
||||
CusLabel {
|
||||
text: qsTr("selectCount: %1").arg(
|
||||
deviceAddModel.selectedCount) + trans.transString
|
||||
text: qsTr("selectCount: %1").arg(deviceAddModel.selectedCount) + trans.transString
|
||||
}
|
||||
CusLabel {
|
||||
text: qsTr("checkedCount: %1").arg(
|
||||
deviceAddModel.checkedCount) + trans.transString
|
||||
text: qsTr("checkedCount: %1").arg(deviceAddModel.checkedCount) + trans.transString
|
||||
}
|
||||
CusLabel {
|
||||
text: qsTr("visibledCount: %1").arg(
|
||||
deviceAddModel.visibledCount) + trans.transString
|
||||
text: qsTr("visibledCount: %1").arg(deviceAddModel.visibledCount) + trans.transString
|
||||
}
|
||||
}
|
||||
CusTextField_Search {
|
||||
@ -98,9 +95,7 @@ Item {
|
||||
&& mouseX <= cusHeader.xList[2]) {
|
||||
|
||||
editInput.x = cusHeader.xList[1]
|
||||
editInput.y = cusView.y + (parseInt(
|
||||
mouseY / CusConfig.fixedHeight))
|
||||
* CusConfig.fixedHeight
|
||||
editInput.y = cusView.y + (parseInt(mouseY / CusConfig.fixedHeight)) * CusConfig.fixedHeight
|
||||
editInput.width = cusHeader.widthList[1]
|
||||
editInput.height = CusConfig.fixedHeight
|
||||
editInput.index = index
|
||||
@ -334,8 +329,7 @@ Item {
|
||||
text: qsTr(" * Check All rows by header of Column 0") + trans.transString
|
||||
}
|
||||
CusLabel {
|
||||
text: qsTr(" * Edit Column 1 by double click, and update data to model after edit")
|
||||
+ trans.transString
|
||||
text: qsTr(" * Edit Column 1 by double click, and update data to model after edit") + trans.transString
|
||||
}
|
||||
CusLabel {
|
||||
text: qsTr(" * Fuzzy search") + trans.transString
|
||||
@ -344,8 +338,7 @@ Item {
|
||||
text: qsTr(" * Reset column width by drag header splite line") + trans.transString
|
||||
}
|
||||
CusLabel {
|
||||
text: qsTr(" * Sort by click header, click again can switch ascending or descending")
|
||||
+ trans.transString
|
||||
text: qsTr(" * Sort by click header, click again can switch ascending or descending") + trans.transString
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user