mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-23 03:10:10 +08:00
update
This commit is contained in:
parent
96071ac8d7
commit
a7e8a5e4cf
@ -13,6 +13,10 @@ FluContentPage{
|
||||
loadData(1,1000)
|
||||
}
|
||||
|
||||
Component.onDestruction: {
|
||||
console.debug("T_TableView已经销毁")
|
||||
}
|
||||
|
||||
function loadData(page,count){
|
||||
var numbers = [100, 300, 500, 1000];
|
||||
function getRandomAge() {
|
||||
|
@ -25,8 +25,8 @@ int main(int argc, char *argv[])
|
||||
FramelessConfig::instance()->set(Global::Option::DisableLazyInitializationForMicaMaterial);
|
||||
FramelessConfig::instance()->set(Global::Option::CenterWindowBeforeShow);
|
||||
FramelessConfig::instance()->set(Global::Option::ForceNonNativeBackgroundBlur);
|
||||
FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow);
|
||||
#ifdef Q_OS_MACOS
|
||||
FramelessConfig::instance()->set(Global::Option::EnableBlurBehindWindow);
|
||||
FramelessConfig::instance()->set(Global::Option::ForceNonNativeBackgroundBlur,false);
|
||||
#endif
|
||||
AppInfo* appInfo = new AppInfo();
|
||||
|
@ -109,3 +109,8 @@ QJsonArray FluApp::awesomelist(const QString& keyword)
|
||||
void FluApp::closeApp(){
|
||||
qApp->exit(0);
|
||||
}
|
||||
|
||||
void FluApp::deleteWindow(QQuickWindow* window){
|
||||
wnds.remove(window->winId());
|
||||
window->deleteLater();
|
||||
}
|
||||
|
@ -73,6 +73,8 @@ public:
|
||||
*/
|
||||
Q_INVOKABLE void closeApp();
|
||||
|
||||
Q_INVOKABLE void deleteWindow(QQuickWindow* window);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief wnds
|
||||
|
@ -87,3 +87,7 @@ void FluTools::setOverrideCursor(Qt::CursorShape shape){
|
||||
void FluTools::restoreOverrideCursor(){
|
||||
qApp->restoreOverrideCursor();
|
||||
}
|
||||
|
||||
void FluTools::deleteItem(QObject *p){
|
||||
p->deleteLater();
|
||||
}
|
||||
|
@ -58,6 +58,7 @@ public:
|
||||
|
||||
Q_INVOKABLE void restoreOverrideCursor();
|
||||
|
||||
Q_INVOKABLE void deleteItem(QObject *p);
|
||||
};
|
||||
|
||||
#endif // FLUTOOLS_H
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include "WindowHelper.h"
|
||||
|
||||
#include "FluRegister.h"
|
||||
#include "FluApp.h"
|
||||
|
||||
WindowHelper::WindowHelper(QObject *parent)
|
||||
: QObject{parent}
|
||||
@ -19,10 +18,3 @@ QVariant WindowHelper::createRegister(QQuickWindow* window,const QString& path){
|
||||
p->path(path);
|
||||
return QVariant::fromValue(p);
|
||||
}
|
||||
|
||||
void WindowHelper::deleteWindow(){
|
||||
if(this->window){
|
||||
FluApp::getInstance()->wnds.remove(this->window->winId());
|
||||
this->window->deleteLater();
|
||||
}
|
||||
}
|
||||
|
@ -24,11 +24,6 @@ public:
|
||||
*/
|
||||
Q_INVOKABLE void initWindow(QQuickWindow* window);
|
||||
|
||||
/**
|
||||
* @brief deleteWindow 销毁窗口,释放资源,QML中的Window close并不会销毁窗口,只是把窗口隐藏了
|
||||
*/
|
||||
Q_INVOKABLE void deleteWindow();
|
||||
|
||||
/**
|
||||
* @brief createRegister 创建一个FluRegsiter对象,在FluWindow中registerForWindowResult方法调用
|
||||
* @param window
|
||||
|
@ -31,7 +31,6 @@ Item {
|
||||
id:control
|
||||
QtObject{
|
||||
id:d
|
||||
property var pageMap: ({})
|
||||
property var stackItems: []
|
||||
property int displayMode: FluNavigationView.Open
|
||||
property bool enableNavigationPanel: false
|
||||
@ -519,7 +518,7 @@ Item {
|
||||
disabled: nav_swipe.depth <= 1
|
||||
iconSize: 13
|
||||
onClicked: {
|
||||
nav_swipe.pop()
|
||||
FluTools.deleteItem(nav_swipe.pop())
|
||||
d.stackItems.pop()
|
||||
var item = d.stackItems[d.stackItems.length-1]
|
||||
if(item.idx<(nav_list.count - layout_footer.count)){
|
||||
@ -997,7 +996,7 @@ Item {
|
||||
case FluNavigationView.SingleTask:
|
||||
while(nav_swipe.currentItem !== page)
|
||||
{
|
||||
nav_swipe.pop()
|
||||
FluTools.deleteItem(nav_swipe.pop())
|
||||
d.stackItems.pop()
|
||||
}
|
||||
return
|
||||
|
@ -44,11 +44,6 @@ Window {
|
||||
id: bg
|
||||
anchors.fill: parent
|
||||
color: backgroundColor
|
||||
Behavior on color{
|
||||
ColorAnimation {
|
||||
duration: 300
|
||||
}
|
||||
}
|
||||
}
|
||||
Item{
|
||||
id:container
|
||||
@ -78,7 +73,7 @@ Window {
|
||||
return helper.createRegister(window,path)
|
||||
}
|
||||
function deleteWindow(){
|
||||
helper.deleteWindow()
|
||||
FluApp.deleteWindow(window)
|
||||
}
|
||||
function onResult(data){
|
||||
if(pageRegister){
|
||||
|
Loading…
Reference in New Issue
Block a user