diff --git a/example/qml/window/AboutWindow.qml b/example/qml/window/AboutWindow.qml index a0bebbe..559aef5 100644 --- a/example/qml/window/AboutWindow.qml +++ b/example/qml/window/AboutWindow.qml @@ -35,6 +35,12 @@ FluWindow { FluText{ text:"FluentUI" font: FluTextStyle.Title + MouseArea{ + anchors.fill: parent + onClicked: { + FluApp.navigate("/") + } + } } FluText{ text:"v%1".arg(appInfo.version) diff --git a/example/qml/window/MainWindow.qml b/example/qml/window/MainWindow.qml index 48eff35..4b0e6a9 100644 --- a/example/qml/window/MainWindow.qml +++ b/example/qml/window/MainWindow.qml @@ -15,6 +15,7 @@ FluWindow { closeDestory:false minimumWidth: 520 minimumHeight: 460 + launchMode: FluWindow.SingleTask closeFunc:function(event){ close_app.open() diff --git a/src/FluApp.cpp b/src/FluApp.cpp index 44c7b10..c443e6d 100644 --- a/src/FluApp.cpp +++ b/src/FluApp.cpp @@ -91,29 +91,28 @@ void FluApp::navigate(const QString& route,const QJsonObject& argument,FluRegist properties.insert("pageRegister",QVariant::fromValue(fluRegister)); } properties.insert("argument",argument); - QQuickWindow *view = qobject_cast(component.createWithInitialProperties(properties)); - int launchMode = view->property("launchMode").toInt(); - if(launchMode==1){ - for (auto& pair : wnds) { - QString r = pair->property("route").toString(); - if(r == route){ - pair->setProperty("argument",argument); - pair->show(); - pair->raise(); - pair->requestActivate(); - view->deleteLater(); - return; - } - } - }else if(launchMode==2){ - for (auto& pair : wnds) { - QString r = pair->property("route").toString(); - if(r == route){ - pair->close(); - break; - } + QQuickWindow *view=nullptr; + for (auto& pair : wnds) { + QString r = pair->property("route").toString(); + if(r == route){ + view = pair; + break; } } + if(view){ + //如果窗口存在,则判断启动模式 + int launchMode = view->property("launchMode").toInt(); + if(launchMode == 1){ + view->setProperty("argument",argument); + view->show(); + view->raise(); + view->requestActivate(); + return; + }else if(launchMode == 2){ + view->close(); + } + } + view = qobject_cast(component.createWithInitialProperties(properties)); if(fluTheme->frameless()){ view->setFlag(Qt::FramelessWindowHint,true); } diff --git a/src/imports/FluentUI/Controls/FluTableView.qml b/src/imports/FluentUI/Controls/FluTableView.qml index f1ab7f9..965d67d 100644 --- a/src/imports/FluentUI/Controls/FluTableView.qml +++ b/src/imports/FluentUI/Controls/FluTableView.qml @@ -210,6 +210,7 @@ Item { id:item_mouse hoverEnabled: true anchors.fill: parent + cursorShape: Qt.IBeamCursor acceptedButtons: Qt.NoButton } FluTooltip{