diff --git a/src/FluFramelessHelper.cpp b/src/FluFramelessHelper.cpp index 3d44d507..3f4233e2 100644 --- a/src/FluFramelessHelper.cpp +++ b/src/FluFramelessHelper.cpp @@ -224,8 +224,9 @@ void FluFramelessHelper::componentComplete(){ if(!window.isNull()){ #ifdef Q_OS_WIN #if (QT_VERSION == QT_VERSION_CHECK(6, 5, 3)) - window->setFlags(window->flags() | Qt::FramelessWindowHint | Qt::WindowMinimizeButtonHint); + window->setFlag(Qt::FramelessWindowHint,true); #endif + window->setFlag(Qt::WindowMinimizeButtonHint,true); _nativeEvent =new FramelessEventFilter(this); qApp->installNativeEventFilter(_nativeEvent); HWND hwnd = reinterpret_cast(window->winId()); diff --git a/src/FluentUI.cpp b/src/FluentUI.cpp index 2de90f94..9e99d7ae 100644 --- a/src/FluentUI.cpp +++ b/src/FluentUI.cpp @@ -116,7 +116,6 @@ void FluentUI::registerTypes(const char *uri){ qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluSpinBox.qml"),uri,major,minor,"FluSpinBox"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluStatusView.qml"),uri,major,minor,"FluStatusView"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTabView.qml"),uri,major,minor,"FluTabView"); - qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTableModelColumn.qml"),uri,major,minor,"FluTableModelColumn"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTableView.qml"),uri,major,minor,"FluTableView"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluText.qml"),uri,major,minor,"FluText"); qmlRegisterType(QUrl("qrc:/qt/qml/FluentUI/Controls/FluTextBox.qml"),uri,major,minor,"FluTextBox"); diff --git a/src/Qt5/imports/FluentUI/Controls/FluTableModelColumn.qml b/src/Qt5/imports/FluentUI/Controls/FluTableModelColumn.qml deleted file mode 100644 index b3a1fd01..00000000 --- a/src/Qt5/imports/FluentUI/Controls/FluTableModelColumn.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.labs.qmlmodels 1.0 - -TableModelColumn{ - -} diff --git a/src/Qt5/imports/FluentUI/Controls/FluTableView.qml b/src/Qt5/imports/FluentUI/Controls/FluTableView.qml index 4cdf0139..967721a8 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTableView.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTableView.qml @@ -13,19 +13,17 @@ Rectangle { color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1) onColumnSourceChanged: { if(columnSource.length!==0){ - var com_column = Qt.createComponent("FluTableModelColumn.qml") - if (com_column.status === Component.Ready) { - var columns= [] - var header_rows = {} - columnSource.forEach(function(item){ - var column = com_column.createObject(table_model,{display:item.dataIndex}); - columns.push(column) - header_rows[item.dataIndex] = item.title - }) - table_model.columns = columns - header_model.columns = columns - d.header_rows = [header_rows] - } + var columns= [] + var header_rows = {} + columnSource.forEach(function(item){ + var column = Qt.createQmlObject('import Qt.labs.qmlmodels 1.0;TableModelColumn{}',table_model); + column.display = item.dataIndex + columns.push(column) + header_rows[item.dataIndex] = item.title + }) + table_model.columns = columns + header_model.columns = columns + d.header_rows = [header_rows] } } QtObject{ diff --git a/src/Qt5/imports/FluentUI/qmldir b/src/Qt5/imports/FluentUI/qmldir index c9b0fd6a..0ef5be4f 100644 --- a/src/Qt5/imports/FluentUI/qmldir +++ b/src/Qt5/imports/FluentUI/qmldir @@ -75,7 +75,6 @@ FluSlider 1.0 Controls/FluSlider.qml FluSpinBox 1.0 Controls/FluSpinBox.qml FluStatusView 1.0 Controls/FluStatusView.qml FluTabView 1.0 Controls/FluTabView.qml -FluTableModelColumn 1.0 Controls/FluTableModelColumn.qml FluTableView 1.0 Controls/FluTableView.qml FluText 1.0 Controls/FluText.qml FluTextBox 1.0 Controls/FluTextBox.qml diff --git a/src/Qt5/imports/fluentui.qrc b/src/Qt5/imports/fluentui.qrc index e7109dff..97a71ae5 100644 --- a/src/Qt5/imports/fluentui.qrc +++ b/src/Qt5/imports/fluentui.qrc @@ -71,7 +71,6 @@ FluentUI/Controls/FluSpinBox.qml FluentUI/Controls/FluStaggeredView.qml FluentUI/Controls/FluStatusView.qml - FluentUI/Controls/FluTableModelColumn.qml FluentUI/Controls/FluTableView.qml FluentUI/Controls/FluTabView.qml FluentUI/Controls/FluText.qml diff --git a/src/Qt6/imports/FluentUI/Controls/FluTableModelColumn.qml b/src/Qt6/imports/FluentUI/Controls/FluTableModelColumn.qml deleted file mode 100644 index f3921140..00000000 --- a/src/Qt6/imports/FluentUI/Controls/FluTableModelColumn.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt.labs.qmlmodels - -TableModelColumn{ - -} diff --git a/src/Qt6/imports/FluentUI/Controls/FluTableView.qml b/src/Qt6/imports/FluentUI/Controls/FluTableView.qml index 0f91a282..4c12a2d3 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTableView.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTableView.qml @@ -14,19 +14,17 @@ Rectangle { color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1) onColumnSourceChanged: { if(columnSource.length!==0){ - var com_column = Qt.createComponent("FluTableModelColumn.qml") - if (com_column.status === Component.Ready) { - var columns= [] - var header_rows = {} - columnSource.forEach(function(item){ - var column = com_column.createObject(table_model,{display:item.dataIndex}); - columns.push(column) - header_rows[item.dataIndex] = item.title - }) - table_model.columns = columns - header_model.columns = columns - d.header_rows = [header_rows] - } + var columns= [] + var header_rows = {} + columnSource.forEach(function(item){ + var column = Qt.createQmlObject('import Qt.labs.qmlmodels;TableModelColumn{}',table_model); + column.display = item.dataIndex + columns.push(column) + header_rows[item.dataIndex] = item.title + }) + table_model.columns = columns + header_model.columns = columns + d.header_rows = [header_rows] } } QtObject{