This commit is contained in:
朱子楚\zhuzi 2024-05-17 21:19:10 +08:00
parent 39f58278ff
commit 7a67ccc1e1
10 changed files with 92 additions and 85 deletions

View File

@ -2043,108 +2043,108 @@ Some contents...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="73"/> <location filename="qml/page/T_TableView.qml" line="72"/>
<source>Modify the column name</source> <source>Modify the column name</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="74"/> <location filename="qml/page/T_TableView.qml" line="73"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="92"/> <location filename="qml/page/T_TableView.qml" line="91"/>
<source>OK</source> <source>OK</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="134"/> <location filename="qml/page/T_TableView.qml" line="133"/>
<source>Search</source> <source>Search</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="177"/> <location filename="qml/page/T_TableView.qml" line="176"/>
<location filename="qml/page/T_TableView.qml" line="509"/> <location filename="qml/page/T_TableView.qml" line="508"/>
<source>Name</source> <source>Name</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="211"/> <location filename="qml/page/T_TableView.qml" line="210"/>
<source>Delete</source> <source>Delete</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="218"/> <location filename="qml/page/T_TableView.qml" line="217"/>
<source>Edit</source> <source>Edit</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="237"/> <location filename="qml/page/T_TableView.qml" line="236"/>
<source>Select All</source> <source>Select All</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="365"/> <location filename="qml/page/T_TableView.qml" line="364"/>
<source>Age</source> <source>Age</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="440"/> <location filename="qml/page/T_TableView.qml" line="439"/>
<source>Clear All</source> <source>Clear All</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="447"/> <location filename="qml/page/T_TableView.qml" line="446"/>
<source>Delete Selection</source> <source>Delete Selection</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="470"/> <location filename="qml/page/T_TableView.qml" line="469"/>
<source>Add a row of Data</source> <source>Add a row of Data</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="476"/> <location filename="qml/page/T_TableView.qml" line="475"/>
<source>Insert a Row</source> <source>Insert a Row</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="483"/> <location filename="qml/page/T_TableView.qml" line="482"/>
<source>Focus not acquired: Please click any item in the form as the target for insertion!</source> <source>Focus not acquired: Please click any item in the form as the target for insertion!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="514"/> <location filename="qml/page/T_TableView.qml" line="513"/>
<source>Avatar</source> <source>Avatar</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="528"/> <location filename="qml/page/T_TableView.qml" line="527"/>
<source>Address</source> <source>Address</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="536"/> <location filename="qml/page/T_TableView.qml" line="535"/>
<source>Nickname</source> <source>Nickname</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="543"/> <location filename="qml/page/T_TableView.qml" line="542"/>
<source>Long String</source> <source>Long String</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="551"/> <location filename="qml/page/T_TableView.qml" line="550"/>
<source>Options</source> <source>Options</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="569"/> <location filename="qml/page/T_TableView.qml" line="568"/>
<source>&lt;Previous</source> <source>&lt;Previous</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="570"/> <location filename="qml/page/T_TableView.qml" line="569"/>
<source>Next&gt;</source> <source>Next&gt;</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -2193,108 +2193,108 @@ Some contents...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="73"/> <location filename="qml/page/T_TableView.qml" line="72"/>
<source>Modify the column name</source> <source>Modify the column name</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="74"/> <location filename="qml/page/T_TableView.qml" line="73"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="92"/> <location filename="qml/page/T_TableView.qml" line="91"/>
<source>OK</source> <source>OK</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="134"/> <location filename="qml/page/T_TableView.qml" line="133"/>
<source>Search</source> <source>Search</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="177"/> <location filename="qml/page/T_TableView.qml" line="176"/>
<location filename="qml/page/T_TableView.qml" line="509"/> <location filename="qml/page/T_TableView.qml" line="508"/>
<source>Name</source> <source>Name</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="211"/> <location filename="qml/page/T_TableView.qml" line="210"/>
<source>Delete</source> <source>Delete</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="218"/> <location filename="qml/page/T_TableView.qml" line="217"/>
<source>Edit</source> <source>Edit</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="237"/> <location filename="qml/page/T_TableView.qml" line="236"/>
<source>Select All</source> <source>Select All</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="365"/> <location filename="qml/page/T_TableView.qml" line="364"/>
<source>Age</source> <source>Age</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="440"/> <location filename="qml/page/T_TableView.qml" line="439"/>
<source>Clear All</source> <source>Clear All</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="476"/> <location filename="qml/page/T_TableView.qml" line="475"/>
<source>Insert a Row</source> <source>Insert a Row</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="483"/> <location filename="qml/page/T_TableView.qml" line="482"/>
<source>Focus not acquired: Please click any item in the form as the target for insertion!</source> <source>Focus not acquired: Please click any item in the form as the target for insertion!</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="514"/> <location filename="qml/page/T_TableView.qml" line="513"/>
<source>Avatar</source> <source>Avatar</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="528"/> <location filename="qml/page/T_TableView.qml" line="527"/>
<source>Address</source> <source>Address</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="536"/> <location filename="qml/page/T_TableView.qml" line="535"/>
<source>Nickname</source> <source>Nickname</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="543"/> <location filename="qml/page/T_TableView.qml" line="542"/>
<source>Long String</source> <source>Long String</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="551"/> <location filename="qml/page/T_TableView.qml" line="550"/>
<source>Options</source> <source>Options</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="569"/> <location filename="qml/page/T_TableView.qml" line="568"/>
<source>&lt;Previous</source> <source>&lt;Previous</source>
<translation type="unfinished">&lt;</translation> <translation type="unfinished">&lt;</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="570"/> <location filename="qml/page/T_TableView.qml" line="569"/>
<source>Next&gt;</source> <source>Next&gt;</source>
<translation type="unfinished">&gt;</translation> <translation type="unfinished">&gt;</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="447"/> <location filename="qml/page/T_TableView.qml" line="446"/>
<source>Delete Selection</source> <source>Delete Selection</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_TableView.qml" line="470"/> <location filename="qml/page/T_TableView.qml" line="469"/>
<source>Add a row of Data</source> <source>Add a row of Data</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -40,5 +40,3 @@ FluScrollablePage{
} }
} }

View File

@ -11,7 +11,6 @@ FluContentPage{
title: qsTr("TableView") title: qsTr("TableView")
signal checkBoxChanged signal checkBoxChanged
property var dataSource : []
property int sortType: 0 property int sortType: 0
property bool selectedAll: true property bool selectedAll: true
property string nameKeyword: "" property string nameKeyword: ""
@ -621,7 +620,6 @@ FluContentPage{
for(var i=0;i<count;i++){ for(var i=0;i<count;i++){
dataSource.push(genTestObject()) dataSource.push(genTestObject())
} }
root.dataSource = dataSource table_view.dataSource = dataSource
table_view.dataSource = root.dataSource
} }
} }

View File

@ -136,9 +136,9 @@ void FluFrameless::componentComplete() {
if (_fixSize) { if (_fixSize) {
window()->setMaximumSize(QSize(w, h)); window()->setMaximumSize(QSize(w, h));
window()->setMinimumSize(QSize(w, h)); window()->setMinimumSize(QSize(w, h));
}else{ } else {
window()->setMinimumHeight(window()->minimumHeight()+appBarHeight); window()->setMinimumHeight(window()->minimumHeight() + appBarHeight);
window()->setMaximumHeight(window()->maximumHeight()+appBarHeight); window()->setMaximumHeight(window()->maximumHeight() + appBarHeight);
} }
window()->resize(QSize(w, h)); window()->resize(QSize(w, h));
connect(this, &FluFrameless::topmostChanged, this, [this] { connect(this, &FluFrameless::topmostChanged, this, [this] {
@ -192,8 +192,8 @@ void FluFrameless::componentComplete() {
bool isMaximum = ::IsZoomed(hwnd); bool isMaximum = ::IsZoomed(hwnd);
if (isMaximum) { if (isMaximum) {
auto geometry = window()->screen()->geometry(); auto geometry = window()->screen()->geometry();
auto offsetX = qAbs(geometry.left()-originalLeft); auto offsetX = qAbs(geometry.left() - originalLeft);
auto offsetY = qAbs(geometry.top()-originalTop); auto offsetY = qAbs(geometry.top() - originalTop);
clientRect->top = originalTop + offsetY; clientRect->top = originalTop + offsetY;
clientRect->bottom = originalBottom - offsetY; clientRect->bottom = originalBottom - offsetY;
clientRect->left = originalLeft + offsetX; clientRect->left = originalLeft + offsetX;
@ -273,16 +273,8 @@ void FluFrameless::componentComplete() {
return true; return true;
#endif #endif
} else if (uMsg == WM_NCACTIVATE) { } else if (uMsg == WM_NCACTIVATE) {
#if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3) || QT_VERSION == QT_VERSION_CHECK(6, 6, 0))
*result = TRUE; *result = TRUE;
return true; return true;
#else
if (isCompositionEnabled()) {
return false;
}
*result = TRUE;
return true;
#endif
} else if (uMsg == WM_GETMINMAXINFO) { } else if (uMsg == WM_GETMINMAXINFO) {
#if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3) || QT_VERSION == QT_VERSION_CHECK(6, 6, 0)) #if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3) || QT_VERSION == QT_VERSION_CHECK(6, 6, 0))
auto *minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam); auto *minmaxInfo = reinterpret_cast<MINMAXINFO *>(lParam);
@ -406,13 +398,13 @@ bool FluFrameless::_hitMaximizeButton() {
} }
void FluFrameless::_setMaximizePressed(bool val) { void FluFrameless::_setMaximizePressed(bool val) {
if(_maximizeButton){ if (_maximizeButton) {
_maximizeButton->setProperty("down", val); _maximizeButton->setProperty("down", val);
} }
} }
void FluFrameless::_setMaximizeHovered(bool val) { void FluFrameless::_setMaximizeHovered(bool val) {
if(_maximizeButton){ if (_maximizeButton) {
_maximizeButton->setProperty("hover", val); _maximizeButton->setProperty("hover", val);
} }
} }

View File

@ -150,20 +150,35 @@ void FluentUI::registerTypes(const char *uri) const {
qmlRegisterUncreatableMetaObject(FluTimelineType::staticMetaObject, uri, major, minor, "FluTimelineType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluTimelineType::staticMetaObject, uri, major, minor, "FluTimelineType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluSheetType::staticMetaObject, uri, major, minor, "FluSheetType", "Access to enums & flags only"); qmlRegisterUncreatableMetaObject(FluSheetType::staticMetaObject, uri, major, minor, "FluSheetType", "Access to enums & flags only");
qmlRegisterSingletonType(uri, major, minor, "FluApp", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
Q_UNUSED(engine)
return scriptEngine->newQObject(FluApp::getInstance());
});
qmlRegisterSingletonType(uri, major, minor, "FluColors", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
Q_UNUSED(engine)
return scriptEngine->newQObject(FluColors::getInstance());
});
qmlRegisterSingletonType(uri, major, minor, "FluTheme", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
Q_UNUSED(engine)
return scriptEngine->newQObject(FluTheme::getInstance());
});
qmlRegisterSingletonType(uri, major, minor, "FluTools", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
Q_UNUSED(engine)
return scriptEngine->newQObject(FluTools::getInstance());
});
qmlRegisterSingletonType(uri, major, minor, "FluTextStyle", [](QQmlEngine *engine, QJSEngine *scriptEngine) -> QJSValue {
Q_UNUSED(engine)
return scriptEngine->newQObject(FluTextStyle::getInstance());
});
// qmlRegisterSingletonInstance(uri, major, minor, "FluApp", FluApp::getInstance()); // qmlRegisterSingletonInstance(uri, major, minor, "FluApp", FluApp::getInstance());
// qmlRegisterSingletonInstance(uri, major, minor, "FluColors", FluColors::getInstance()); // qmlRegisterSingletonInstance(uri, major, minor, "FluColors", FluColors::getInstance());
// qmlRegisterSingletonInstance(uri, major, minor, "FluTheme", FluTheme::getInstance()); // qmlRegisterSingletonInstance(uri, major, minor, "FluTheme", FluTheme::getInstance());
// qmlRegisterSingletonInstance(uri, major, minor, "FluTools", FluTools::getInstance()); // qmlRegisterSingletonInstance(uri, major, minor, "FluTools", FluTools::getInstance());
// qmlRegisterSingletonInstance(uri, major, minor, "FluTextStyle", FluTextStyle::getInstance()); // qmlRegisterSingletonInstance(uri, major, minor, "FluTextStyle", FluTextStyle::getInstance());
qmlRegisterModule(uri, major, minor); qmlRegisterModule(uri, major, minor);
#endif #endif
} }
void FluentUI::initializeEngine(QQmlEngine *engine, [[maybe_unused]] const char *uri) { void FluentUI::initializeEngine(QQmlEngine *engine, [[maybe_unused]] const char *uri) {
engine->rootContext()->setContextProperty("FluApp", FluApp::getInstance()); Q_UNUSED(engine)
engine->rootContext()->setContextProperty("FluColors", FluColors::getInstance());
engine->rootContext()->setContextProperty("FluTheme", FluTheme::getInstance());
engine->rootContext()->setContextProperty("FluTools", FluTools::getInstance());
engine->rootContext()->setContextProperty("FluTextStyle", FluTextStyle::getInstance());
} }

View File

@ -10,19 +10,19 @@ QtObject {
windows.push(window) windows.push(window)
} }
} }
function removeWindow(window) { function removeWindow(win) {
if(!window.transientParent){ if(!win.transientParent){
var index = windows.indexOf(window) var index = windows.indexOf(win)
if (index !== -1) { if (index !== -1) {
windows.splice(index, 1) windows.splice(index, 1)
FluTools.deleteLater(window) win.deleteLater()
} }
} }
} }
function exit(retCode){ function exit(retCode){
for(var i =0 ;i< windows.length; i++){ for(var i =0 ;i< windows.length; i++){
var item = windows[i] var win = windows[i]
FluTools.deleteLater(item) win.deleteLater()
} }
windows = [] windows = []
Qt.exit(retCode) Qt.exit(retCode)

View File

@ -353,4 +353,7 @@ Window {
function setHitTestVisible(val){ function setHitTestVisible(val){
frameless.setHitTestVisible(val) frameless.setHitTestVisible(val)
} }
function deleteLater(){
FluTools.deleteLater(window)
}
} }

View File

@ -11,19 +11,19 @@ QtObject {
windows.push(window) windows.push(window)
} }
} }
function removeWindow(window) { function removeWindow(win) {
if(!window.transientParent){ if(!win.transientParent){
var index = windows.indexOf(window) var index = windows.indexOf(win)
if (index !== -1) { if (index !== -1) {
windows.splice(index, 1) windows.splice(index, 1)
FluTools.deleteLater(window) win.deleteLater()
} }
} }
} }
function exit(retCode){ function exit(retCode){
for(var i =0 ;i< windows.length; i++){ for(var i =0 ;i< windows.length; i++){
var item = windows[i] var win = windows[i]
FluTools.deleteLater(item) win.deleteLater()
} }
windows = [] windows = []
Qt.exit(retCode) Qt.exit(retCode)
@ -56,9 +56,7 @@ QtObject {
var launchMode = win.launchMode var launchMode = win.launchMode
if(launchMode === 1){ if(launchMode === 1){
win.argument = argument win.argument = argument
if(!win.visible){ win.show()
win.visible = true
}
win.raise() win.raise()
win.requestActivate() win.requestActivate()
return return

View File

@ -352,4 +352,7 @@ Window {
function setHitTestVisible(val){ function setHitTestVisible(val){
frameless.setHitTestVisible(val) frameless.setHitTestVisible(val)
} }
function deleteLater(){
FluTools.deleteLater(window)
}
} }