Compare commits

...

2 Commits

Author SHA1 Message Date
朱子楚\zhuzi
a27554bfb2 update 2024-05-17 21:27:41 +08:00
朱子楚\zhuzi
7a67ccc1e1 update 2024-05-17 21:19:10 +08:00
12 changed files with 97 additions and 90 deletions

View File

@ -2043,108 +2043,108 @@ Some contents...</source>
<translation type="unfinished"></translation>
</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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="74"/>
<location filename="qml/page/T_TableView.qml" line="73"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="92"/>
<location filename="qml/page/T_TableView.qml" line="91"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="134"/>
<location filename="qml/page/T_TableView.qml" line="133"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="177"/>
<location filename="qml/page/T_TableView.qml" line="509"/>
<location filename="qml/page/T_TableView.qml" line="176"/>
<location filename="qml/page/T_TableView.qml" line="508"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="211"/>
<location filename="qml/page/T_TableView.qml" line="210"/>
<source>Delete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="218"/>
<location filename="qml/page/T_TableView.qml" line="217"/>
<source>Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="237"/>
<location filename="qml/page/T_TableView.qml" line="236"/>
<source>Select All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="365"/>
<location filename="qml/page/T_TableView.qml" line="364"/>
<source>Age</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="440"/>
<location filename="qml/page/T_TableView.qml" line="439"/>
<source>Clear All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="447"/>
<location filename="qml/page/T_TableView.qml" line="446"/>
<source>Delete Selection</source>
<translation type="unfinished"></translation>
</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>
<translation type="unfinished"></translation>
</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>
<translation type="unfinished"></translation>
</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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="514"/>
<location filename="qml/page/T_TableView.qml" line="513"/>
<source>Avatar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="528"/>
<location filename="qml/page/T_TableView.qml" line="527"/>
<source>Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="536"/>
<location filename="qml/page/T_TableView.qml" line="535"/>
<source>Nickname</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="543"/>
<location filename="qml/page/T_TableView.qml" line="542"/>
<source>Long String</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="551"/>
<location filename="qml/page/T_TableView.qml" line="550"/>
<source>Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="569"/>
<location filename="qml/page/T_TableView.qml" line="568"/>
<source>&lt;Previous</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="570"/>
<location filename="qml/page/T_TableView.qml" line="569"/>
<source>Next&gt;</source>
<translation type="unfinished"></translation>
</message>

View File

@ -2193,108 +2193,108 @@ Some contents...</source>
<translation type="unfinished"></translation>
</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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="74"/>
<location filename="qml/page/T_TableView.qml" line="73"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="92"/>
<location filename="qml/page/T_TableView.qml" line="91"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="134"/>
<location filename="qml/page/T_TableView.qml" line="133"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="177"/>
<location filename="qml/page/T_TableView.qml" line="509"/>
<location filename="qml/page/T_TableView.qml" line="176"/>
<location filename="qml/page/T_TableView.qml" line="508"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="211"/>
<location filename="qml/page/T_TableView.qml" line="210"/>
<source>Delete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="218"/>
<location filename="qml/page/T_TableView.qml" line="217"/>
<source>Edit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="237"/>
<location filename="qml/page/T_TableView.qml" line="236"/>
<source>Select All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="365"/>
<location filename="qml/page/T_TableView.qml" line="364"/>
<source>Age</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="440"/>
<location filename="qml/page/T_TableView.qml" line="439"/>
<source>Clear All</source>
<translation type="unfinished"></translation>
</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>
<translation type="unfinished"></translation>
</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>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="514"/>
<location filename="qml/page/T_TableView.qml" line="513"/>
<source>Avatar</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="528"/>
<location filename="qml/page/T_TableView.qml" line="527"/>
<source>Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="536"/>
<location filename="qml/page/T_TableView.qml" line="535"/>
<source>Nickname</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="543"/>
<location filename="qml/page/T_TableView.qml" line="542"/>
<source>Long String</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="551"/>
<location filename="qml/page/T_TableView.qml" line="550"/>
<source>Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="569"/>
<location filename="qml/page/T_TableView.qml" line="568"/>
<source>&lt;Previous</source>
<translation type="unfinished">&lt;</translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="570"/>
<location filename="qml/page/T_TableView.qml" line="569"/>
<source>Next&gt;</source>
<translation type="unfinished">&gt;</translation>
</message>
<message>
<location filename="qml/page/T_TableView.qml" line="447"/>
<location filename="qml/page/T_TableView.qml" line="446"/>
<source>Delete Selection</source>
<translation type="unfinished"></translation>
</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>
<translation type="unfinished"></translation>
</message>

View File

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

View File

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

View File

@ -34,7 +34,7 @@ void FluApp::init(QObject *launcher, QLocale locale) {
[[maybe_unused]] QJsonArray FluApp::iconData(const QString &keyword) {
QJsonArray arr;
QMetaEnum enumType = Fluent_Icons::staticMetaObject.enumerator(Fluent_Icons::staticMetaObject.indexOfEnumerator("Fluent_IconType"));
QMetaEnum enumType = FluentIcons::staticMetaObject.enumerator(FluentIcons::staticMetaObject.indexOfEnumerator("Type"));
for (int i = 0; i <= enumType.keyCount() - 1; ++i) {
QString name = enumType.key(i);
int icon = enumType.value(i);

View File

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

View File

@ -3,9 +3,9 @@
#include <QObject>
#include <QtQml/qqml.h>
namespace Fluent_Icons {
namespace FluentIcons {
Q_NAMESPACE
enum class Fluent_IconType {
enum class Type {
GlobalNavButton = 0xe700,
Wifi = 0xe701,
Bluetooth = 0xe702,
@ -1411,7 +1411,7 @@ namespace Fluent_Icons {
ClickedOutLoudSolidBold = 0xf8b3
};
Q_ENUM_NS(Fluent_IconType)
Q_ENUM_NS(Type)
QML_NAMED_ELEMENT(FluentIcons)
}

View File

@ -136,7 +136,7 @@ void FluentUI::registerTypes(const char *uri) const {
qmlRegisterSingletonType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluRouter.qml"), uri, major, minor, "FluRouter");
qmlRegisterSingletonType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluEventBus.qml"), uri, major, minor, "FluEventBus");
qmlRegisterUncreatableMetaObject(Fluent_Icons::staticMetaObject, uri, major, minor, "FluentIcons", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluentIcons::staticMetaObject, uri, major, minor, "FluentIcons", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluThemeType::staticMetaObject, uri, major, minor, "FluThemeType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluPageType::staticMetaObject, uri, major, minor, "FluPageType", "Access to enums & flags only");
qmlRegisterUncreatableMetaObject(FluWindowType::staticMetaObject, uri, major, minor, "FluWindowType", "Access to enums & flags only");
@ -150,20 +150,35 @@ void FluentUI::registerTypes(const char *uri) const {
qmlRegisterUncreatableMetaObject(FluTimelineType::staticMetaObject, uri, major, minor, "FluTimelineType", "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, "FluColors", FluColors::getInstance());
// qmlRegisterSingletonInstance(uri, major, minor, "FluTheme", FluTheme::getInstance());
// qmlRegisterSingletonInstance(uri, major, minor, "FluTools", FluTools::getInstance());
// qmlRegisterSingletonInstance(uri, major, minor, "FluTextStyle", FluTextStyle::getInstance());
qmlRegisterModule(uri, major, minor);
#endif
}
void FluentUI::initializeEngine(QQmlEngine *engine, [[maybe_unused]] const char *uri) {
engine->rootContext()->setContextProperty("FluApp", FluApp::getInstance());
engine->rootContext()->setContextProperty("FluColors", FluColors::getInstance());
engine->rootContext()->setContextProperty("FluTheme", FluTheme::getInstance());
engine->rootContext()->setContextProperty("FluTools", FluTools::getInstance());
engine->rootContext()->setContextProperty("FluTextStyle", FluTextStyle::getInstance());
Q_UNUSED(engine)
}

View File

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

View File

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

View File

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

View File

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