mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-22 19:00:07 +08:00
Compare commits
No commits in common. "c2b845658d1543dd22b3e146f7f3b85416fb5cce" and "7d1666597f5330f1d253acc6a654d6a8939b96ab" have entirely different histories.
c2b845658d
...
7d1666597f
@ -194,6 +194,7 @@
|
|||||||
<file>res/image/ic_crash.png</file>
|
<file>res/image/ic_crash.png</file>
|
||||||
<file>qml/window/CrashWindow.qml</file>
|
<file>qml/window/CrashWindow.qml</file>
|
||||||
<file>qml/page/T_SplitLayout.qml</file>
|
<file>qml/page/T_SplitLayout.qml</file>
|
||||||
|
<file>qml/window/FluentInitalizrWindow.qml</file>
|
||||||
<file>res/template/CMakeLists.txt.in</file>
|
<file>res/template/CMakeLists.txt.in</file>
|
||||||
<file>res/template/src/App.qml.in</file>
|
<file>res/template/src/App.qml.in</file>
|
||||||
<file>res/template/src/CMakeLists.txt.in</file>
|
<file>res/template/src/CMakeLists.txt.in</file>
|
||||||
@ -208,6 +209,5 @@
|
|||||||
<file>qml/page/T_Sheet.qml</file>
|
<file>qml/page/T_Sheet.qml</file>
|
||||||
<file>qml/page/T_GroupBox.qml</file>
|
<file>qml/page/T_GroupBox.qml</file>
|
||||||
<file>res/image/bg_scenic.jpg</file>
|
<file>res/image/bg_scenic.jpg</file>
|
||||||
<file>qml/window/FluentInitializrWindow.qml</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@ -38,35 +38,35 @@
|
|||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>FluentInitializrWindow</name>
|
<name>FluentInitalizrWindow</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/window/FluentInitializrWindow.qml" line="11"/>
|
<location filename="qml/window/FluentInitalizrWindow.qml" line="11"/>
|
||||||
<location filename="qml/window/FluentInitializrWindow.qml" line="30"/>
|
<location filename="qml/window/FluentInitalizrWindow.qml" line="30"/>
|
||||||
<source>FluentUI Initializr</source>
|
<source>FluentUI Initalizr</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/window/FluentInitializrWindow.qml" line="51"/>
|
<location filename="qml/window/FluentInitalizrWindow.qml" line="51"/>
|
||||||
<source>Name</source>
|
<source>Name</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/window/FluentInitializrWindow.qml" line="59"/>
|
<location filename="qml/window/FluentInitalizrWindow.qml" line="59"/>
|
||||||
<source>Create In</source>
|
<source>Create In</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/window/FluentInitializrWindow.qml" line="63"/>
|
<location filename="qml/window/FluentInitalizrWindow.qml" line="63"/>
|
||||||
<source>Browse</source>
|
<source>Browse</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/window/FluentInitializrWindow.qml" line="93"/>
|
<location filename="qml/window/FluentInitalizrWindow.qml" line="93"/>
|
||||||
<source>Cancel</source>
|
<source>Cancel</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/window/FluentInitializrWindow.qml" line="101"/>
|
<location filename="qml/window/FluentInitalizrWindow.qml" line="101"/>
|
||||||
<source>Create</source>
|
<source>Create</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -85,24 +85,24 @@
|
|||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>InitializrHelper</name>
|
<name>InitalizrHelper</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/helper/InitializrHelper.cpp" line="77"/>
|
<location filename="src/helper/InitalizrHelper.cpp" line="77"/>
|
||||||
<source>The name cannot be empty</source>
|
<source>The name cannot be empty</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/helper/InitializrHelper.cpp" line="81"/>
|
<location filename="src/helper/InitalizrHelper.cpp" line="81"/>
|
||||||
<source>The creation path cannot be empty</source>
|
<source>The creation path cannot be empty</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/helper/InitializrHelper.cpp" line="86"/>
|
<location filename="src/helper/InitalizrHelper.cpp" line="86"/>
|
||||||
<source>The path does not exist</source>
|
<source>The path does not exist</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/helper/InitializrHelper.cpp" line="92"/>
|
<location filename="src/helper/InitalizrHelper.cpp" line="92"/>
|
||||||
<source>%1 folder already exists</source>
|
<source>%1 folder already exists</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -1372,7 +1372,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/page/T_Home.qml" line="32"/>
|
<location filename="qml/page/T_Home.qml" line="32"/>
|
||||||
<source>FluentUI Initializr</source>
|
<source>FluentUI Initalizr</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
@ -2386,6 +2386,14 @@ Some contents...</source>
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>T_TreeView2</name>
|
||||||
|
<message>
|
||||||
|
<location filename="qml/page/T_TreeView2.qml" line="10"/>
|
||||||
|
<source>TreeView2</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>T_Typography</name>
|
<name>T_Typography</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -38,35 +38,35 @@
|
|||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>FluentInitializrWindow</name>
|
<name>FluentInitalizrWindow</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/window/FluentInitializrWindow.qml" line="11"/>
|
<location filename="qml/window/FluentInitalizrWindow.qml" line="11"/>
|
||||||
<location filename="qml/window/FluentInitializrWindow.qml" line="30"/>
|
<location filename="qml/window/FluentInitalizrWindow.qml" line="30"/>
|
||||||
<source>FluentUI Initializr</source>
|
<source>FluentUI Initalizr</source>
|
||||||
<translation type="unfinished">FluentUI脚手架</translation>
|
<translation type="unfinished">FluentUI脚手架</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/window/FluentInitializrWindow.qml" line="51"/>
|
<location filename="qml/window/FluentInitalizrWindow.qml" line="51"/>
|
||||||
<source>Name</source>
|
<source>Name</source>
|
||||||
<translation type="unfinished">名称</translation>
|
<translation type="unfinished">名称</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/window/FluentInitializrWindow.qml" line="59"/>
|
<location filename="qml/window/FluentInitalizrWindow.qml" line="59"/>
|
||||||
<source>Create In</source>
|
<source>Create In</source>
|
||||||
<translation type="unfinished">创建路径</translation>
|
<translation type="unfinished">创建路径</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/window/FluentInitializrWindow.qml" line="63"/>
|
<location filename="qml/window/FluentInitalizrWindow.qml" line="63"/>
|
||||||
<source>Browse</source>
|
<source>Browse</source>
|
||||||
<translation type="unfinished">浏览</translation>
|
<translation type="unfinished">浏览</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/window/FluentInitializrWindow.qml" line="93"/>
|
<location filename="qml/window/FluentInitalizrWindow.qml" line="93"/>
|
||||||
<source>Cancel</source>
|
<source>Cancel</source>
|
||||||
<translation type="unfinished">取消</translation>
|
<translation type="unfinished">取消</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/window/FluentInitializrWindow.qml" line="101"/>
|
<location filename="qml/window/FluentInitalizrWindow.qml" line="101"/>
|
||||||
<source>Create</source>
|
<source>Create</source>
|
||||||
<translation type="unfinished">创建</translation>
|
<translation type="unfinished">创建</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -85,26 +85,26 @@
|
|||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>InitializrHelper</name>
|
<name>InitalizrHelper</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/helper/InitializrHelper.cpp" line="77"/>
|
<location filename="src/helper/InitalizrHelper.cpp" line="77"/>
|
||||||
<source>The name cannot be empty</source>
|
<source>The name cannot be empty</source>
|
||||||
<translation type="unfinished">名称不能为空</translation>
|
<translation type="unfinished">名称不能为空</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/helper/InitializrHelper.cpp" line="81"/>
|
<location filename="src/helper/InitalizrHelper.cpp" line="81"/>
|
||||||
<source>The creation path cannot be empty</source>
|
<source>The creation path cannot be empty</source>
|
||||||
<translation type="unfinished">创建路径不能为空</translation>
|
<translation type="unfinished">创建路径不能为空</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/helper/InitializrHelper.cpp" line="86"/>
|
<location filename="src/helper/InitalizrHelper.cpp" line="86"/>
|
||||||
<source>The path does not exist</source>
|
<source>The path does not exist</source>
|
||||||
<translation type="unfinished">路径不存在</translation>
|
<translation type="unfinished">路径不存在</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="src/helper/InitializrHelper.cpp" line="92"/>
|
<location filename="src/helper/InitalizrHelper.cpp" line="92"/>
|
||||||
<source>%1 folder already exists</source>
|
<source>%1 folder already exists</source>
|
||||||
<translation type="unfinished">%1 文件夹已经存在</translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@ -1403,7 +1403,7 @@ My only desire is to be permitted to drive out the traitors and restore the Han.
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="qml/page/T_Home.qml" line="32"/>
|
<location filename="qml/page/T_Home.qml" line="32"/>
|
||||||
<source>FluentUI Initializr</source>
|
<source>FluentUI Initalizr</source>
|
||||||
<translation type="unfinished">FluentUI脚手架</translation>
|
<translation type="unfinished">FluentUI脚手架</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
@ -2469,6 +2469,14 @@ Some contents...</source>
|
|||||||
<translation type="unfinished">共计选中%1条数据</translation>
|
<translation type="unfinished">共计选中%1条数据</translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
|
<context>
|
||||||
|
<name>T_TreeView2</name>
|
||||||
|
<message>
|
||||||
|
<location filename="qml/page/T_TreeView2.qml" line="10"/>
|
||||||
|
<source>TreeView2</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>T_Typography</name>
|
<name>T_Typography</name>
|
||||||
<message>
|
<message>
|
||||||
|
@ -12,8 +12,8 @@ FluScrollablePage{
|
|||||||
animationEnabled: false
|
animationEnabled: false
|
||||||
header: Item{}
|
header: Item{}
|
||||||
|
|
||||||
FluentInitializrWindow{
|
FluentInitalizrWindow{
|
||||||
id:fluent_Initializr
|
id:fluent_initalizr
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel{
|
ListModel{
|
||||||
@ -29,11 +29,11 @@ FluScrollablePage{
|
|||||||
}
|
}
|
||||||
ListElement{
|
ListElement{
|
||||||
icon: "qrc:/example/res/image/favicon.ico"
|
icon: "qrc:/example/res/image/favicon.ico"
|
||||||
title: qsTr("FluentUI Initializr")
|
title: qsTr("FluentUI Initalizr")
|
||||||
desc: qsTr("FluentUI Initializr is a Tool that helps you create and customize Fluent UI projects with various options.")
|
desc: qsTr("FluentUI Initializr is a Tool that helps you create and customize Fluent UI projects with various options.")
|
||||||
url: "https://github.com/zhuzichu520/FluentUI"
|
url: "https://github.com/zhuzichu520/FluentUI"
|
||||||
clicked: function(model){
|
clicked: function(model){
|
||||||
fluent_Initializr.showDialog()
|
fluent_initalizr.showDialog()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,14 +8,14 @@ import "../component"
|
|||||||
FluWindowDialog {
|
FluWindowDialog {
|
||||||
|
|
||||||
id:window
|
id:window
|
||||||
title:qsTr("FluentUI Initializr")
|
title:qsTr("FluentUI Initalizr")
|
||||||
width: 600
|
width: 600
|
||||||
height: 400
|
height: 400
|
||||||
|
|
||||||
contentDelegate:Component{
|
contentDelegate:Component{
|
||||||
Item{
|
Item{
|
||||||
Connections{
|
Connections{
|
||||||
target: InitializrHelper
|
target: InitalizrHelper
|
||||||
function onError(message){
|
function onError(message){
|
||||||
showError(message)
|
showError(message)
|
||||||
}
|
}
|
||||||
@ -27,7 +27,7 @@ FluWindowDialog {
|
|||||||
|
|
||||||
FluText{
|
FluText{
|
||||||
id:text_title
|
id:text_title
|
||||||
text:qsTr("FluentUI Initializr")
|
text:qsTr("FluentUI Initalizr")
|
||||||
font: FluTextStyle.Title
|
font: FluTextStyle.Title
|
||||||
anchors{
|
anchors{
|
||||||
left: parent.left
|
left: parent.left
|
||||||
@ -102,7 +102,7 @@ FluWindowDialog {
|
|||||||
width: 120
|
width: 120
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
onClicked: {
|
onClicked: {
|
||||||
InitializrHelper.generate(text_box_name.text,text_box_path.text)
|
InitalizrHelper.generate(text_box_name.text,text_box_path.text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,16 +1,16 @@
|
|||||||
#include "InitializrHelper.h"
|
#include "InitalizrHelper.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
|
|
||||||
InitializrHelper::InitializrHelper(QObject *parent) : QObject(parent)
|
InitalizrHelper::InitalizrHelper(QObject *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
InitializrHelper::~InitializrHelper() = default;
|
InitalizrHelper::~InitalizrHelper() = default;
|
||||||
|
|
||||||
bool InitializrHelper::copyDir(const QDir& fromDir, const QDir& toDir, bool coverIfFileExists){
|
bool InitalizrHelper::copyDir(const QDir& fromDir, const QDir& toDir, bool coverIfFileExists){
|
||||||
QDir _formDir = fromDir;
|
QDir _formDir = fromDir;
|
||||||
QDir _toDir = toDir;
|
QDir _toDir = toDir;
|
||||||
if(!_toDir.exists())
|
if(!_toDir.exists())
|
||||||
@ -44,7 +44,7 @@ bool InitializrHelper::copyDir(const QDir& fromDir, const QDir& toDir, bool cove
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename...Args>
|
template <typename...Args>
|
||||||
void InitializrHelper::templateToFile(const QString& source,const QString& dest,Args &&...args){
|
void InitalizrHelper::templateToFile(const QString& source,const QString& dest,Args &&...args){
|
||||||
QFile file(source);
|
QFile file(source);
|
||||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
QTextStream in(&file);
|
QTextStream in(&file);
|
||||||
@ -67,12 +67,12 @@ void InitializrHelper::templateToFile(const QString& source,const QString& dest,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitializrHelper::copyFile(const QString& source,const QString& dest){
|
void InitalizrHelper::copyFile(const QString& source,const QString& dest){
|
||||||
QFile::copy(source,dest);
|
QFile::copy(source,dest);
|
||||||
QFile::setPermissions(dest, QFile::WriteOwner | QFile::WriteUser | QFile::WriteGroup | QFile::WriteOther);
|
QFile::setPermissions(dest, QFile::WriteOwner | QFile::WriteUser | QFile::WriteGroup | QFile::WriteOther);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitializrHelper::generate(const QString& name,const QString& path){
|
void InitalizrHelper::generate(const QString& name,const QString& path){
|
||||||
if(name.isEmpty()){
|
if(name.isEmpty()){
|
||||||
error(tr("The name cannot be empty"));
|
error(tr("The name cannot be empty"));
|
||||||
return;
|
return;
|
@ -1,26 +1,26 @@
|
|||||||
#ifndef INITIALIZRHELPER_H
|
#ifndef INITALIZRHELPER_H
|
||||||
#define INITIALIZRHELPER_H
|
#define INITALIZRHELPER_H
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QtQml/qqml.h>
|
#include <QtQml/qqml.h>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include "src/singleton.h"
|
#include "src/singleton.h"
|
||||||
|
|
||||||
class InitializrHelper : public QObject
|
class InitalizrHelper : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private:
|
private:
|
||||||
explicit InitializrHelper(QObject* parent = nullptr);
|
explicit InitalizrHelper(QObject* parent = nullptr);
|
||||||
bool copyDir(const QDir& fromDir, const QDir& toDir, bool coverIfFileExists = true);
|
bool copyDir(const QDir& fromDir, const QDir& toDir, bool coverIfFileExists = true);
|
||||||
void copyFile(const QString& source,const QString& dest);
|
void copyFile(const QString& source,const QString& dest);
|
||||||
template <typename...Args>
|
template <typename...Args>
|
||||||
void templateToFile(const QString& source,const QString& dest,Args &&...args);
|
void templateToFile(const QString& source,const QString& dest,Args &&...args);
|
||||||
public:
|
public:
|
||||||
SINGLETON(InitializrHelper)
|
SINGLETON(InitalizrHelper)
|
||||||
~InitializrHelper() override;
|
~InitalizrHelper() override;
|
||||||
Q_INVOKABLE void generate(const QString& name,const QString& path);
|
Q_INVOKABLE void generate(const QString& name,const QString& path);
|
||||||
Q_SIGNAL void error(const QString& message);
|
Q_SIGNAL void error(const QString& message);
|
||||||
Q_SIGNAL void success(const QString& path);
|
Q_SIGNAL void success(const QString& path);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // INITIALIZRHELPER_H
|
#endif // INITALIZRHELPER_H
|
@ -15,7 +15,7 @@
|
|||||||
#include "src/component/FileWatcher.h"
|
#include "src/component/FileWatcher.h"
|
||||||
#include "src/component/FpsItem.h"
|
#include "src/component/FpsItem.h"
|
||||||
#include "src/helper/SettingsHelper.h"
|
#include "src/helper/SettingsHelper.h"
|
||||||
#include "src/helper/InitializrHelper.h"
|
#include "src/helper/InitalizrHelper.h"
|
||||||
#include "src/helper/TranslateHelper.h"
|
#include "src/helper/TranslateHelper.h"
|
||||||
#include "src/helper/Network.h"
|
#include "src/helper/Network.h"
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ int main(int argc, char *argv[])
|
|||||||
TranslateHelper::getInstance()->init(&engine);
|
TranslateHelper::getInstance()->init(&engine);
|
||||||
engine.rootContext()->setContextProperty("AppInfo",AppInfo::getInstance());
|
engine.rootContext()->setContextProperty("AppInfo",AppInfo::getInstance());
|
||||||
engine.rootContext()->setContextProperty("SettingsHelper",SettingsHelper::getInstance());
|
engine.rootContext()->setContextProperty("SettingsHelper",SettingsHelper::getInstance());
|
||||||
engine.rootContext()->setContextProperty("InitializrHelper",InitializrHelper::getInstance());
|
engine.rootContext()->setContextProperty("InitalizrHelper",InitalizrHelper::getInstance());
|
||||||
engine.rootContext()->setContextProperty("TranslateHelper",TranslateHelper::getInstance());
|
engine.rootContext()->setContextProperty("TranslateHelper",TranslateHelper::getInstance());
|
||||||
engine.rootContext()->setContextProperty("Network",Network::getInstance());
|
engine.rootContext()->setContextProperty("Network",Network::getInstance());
|
||||||
#ifdef FLUENTUI_BUILD_STATIC_LIB
|
#ifdef FLUENTUI_BUILD_STATIC_LIB
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
#include <QQuickWindow>
|
#include <QQuickWindow>
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QScreen>
|
#include <QScreen>
|
||||||
#include <QDateTime>
|
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#pragma comment (lib,"user32.lib")
|
#pragma comment (lib,"user32.lib")
|
||||||
@ -63,6 +62,9 @@ void FluFrameless::componentComplete(){
|
|||||||
}
|
}
|
||||||
window()->installEventFilter(this);
|
window()->installEventFilter(this);
|
||||||
qApp->installNativeEventFilter(this);
|
qApp->installNativeEventFilter(this);
|
||||||
|
if(_appbar){
|
||||||
|
_appbar->installEventFilter(this);
|
||||||
|
}
|
||||||
if(_maximizeButton){
|
if(_maximizeButton){
|
||||||
setHitTestVisible(_maximizeButton);
|
setHitTestVisible(_maximizeButton);
|
||||||
}
|
}
|
||||||
@ -423,18 +425,7 @@ bool FluFrameless::eventFilter(QObject *obj, QEvent *ev){
|
|||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(_hitAppBar()){
|
if(_hitAppBar()){
|
||||||
qint64 clickTimer = QDateTime::currentMSecsSinceEpoch();
|
window()->startSystemMove();
|
||||||
qint64 offset = clickTimer - this->_clickTimer;
|
|
||||||
this->_clickTimer = clickTimer;
|
|
||||||
if(offset<300){
|
|
||||||
if(_isMaximized()){
|
|
||||||
showNormal();
|
|
||||||
}else{
|
|
||||||
showMaximized();
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
window()->startSystemMove();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -54,7 +54,6 @@ private:
|
|||||||
qint64 _current;
|
qint64 _current;
|
||||||
int _edges = 0;
|
int _edges = 0;
|
||||||
int _margins = 8;
|
int _margins = 8;
|
||||||
qint64 _clickTimer = 0;
|
|
||||||
QList<QPointer<QQuickItem>> _hitTestList;
|
QList<QPointer<QQuickItem>> _hitTestList;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <QMetaEnum>
|
#include <QMetaEnum>
|
||||||
|
|
||||||
FluTreeNode::FluTreeNode(QObject *parent): QObject{parent}{
|
FluNode::FluNode(QObject *parent): QObject{parent}{
|
||||||
}
|
}
|
||||||
|
|
||||||
FluTreeModel::FluTreeModel(QObject *parent): QAbstractItemModel{parent}{
|
FluTreeModel::FluTreeModel(QObject *parent): QAbstractItemModel{parent}{
|
||||||
@ -41,7 +41,7 @@ QHash<int, QByteArray> FluTreeModel::roleNames() const {
|
|||||||
return { {Qt::DisplayRole, "dataModel"} };
|
return { {Qt::DisplayRole, "dataModel"} };
|
||||||
};
|
};
|
||||||
|
|
||||||
void FluTreeModel::setData(QList<FluTreeNode*> data){
|
void FluTreeModel::setData(QList<FluNode*> data){
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
_rows = data;
|
_rows = data;
|
||||||
endResetModel();
|
endResetModel();
|
||||||
@ -51,20 +51,20 @@ void FluTreeModel::removeRows(int row,int count){
|
|||||||
if (row < 0 || row + count > _rows.size() || count==0)
|
if (row < 0 || row + count > _rows.size() || count==0)
|
||||||
return;
|
return;
|
||||||
beginRemoveRows(QModelIndex(),row, row + count - 1);
|
beginRemoveRows(QModelIndex(),row, row + count - 1);
|
||||||
QList<FluTreeNode*> firstPart = _rows.mid(0,row);
|
QList<FluNode*> firstPart = _rows.mid(0,row);
|
||||||
QList<FluTreeNode*> secondPart = _rows.mid(row + count);
|
QList<FluNode*> secondPart = _rows.mid(row + count);
|
||||||
_rows.clear();
|
_rows.clear();
|
||||||
_rows.append(firstPart);
|
_rows.append(firstPart);
|
||||||
_rows.append(secondPart);
|
_rows.append(secondPart);
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
void FluTreeModel::insertRows(int row,QList<FluTreeNode*> data){
|
void FluTreeModel::insertRows(int row,QList<FluNode*> data){
|
||||||
if (row < 0 || row > _rows.size() || data.size() == 0)
|
if (row < 0 || row > _rows.size() || data.size() == 0)
|
||||||
return;;
|
return;;
|
||||||
beginInsertRows(QModelIndex(), row, row + data.size() - 1);
|
beginInsertRows(QModelIndex(), row, row + data.size() - 1);
|
||||||
QList<FluTreeNode*> firstPart = _rows.mid(0, row);
|
QList<FluNode*> firstPart = _rows.mid(0, row);
|
||||||
QList<FluTreeNode*> secondPart = _rows.mid(row);
|
QList<FluNode*> secondPart = _rows.mid(row);
|
||||||
_rows.clear();
|
_rows.clear();
|
||||||
_rows.append(firstPart);
|
_rows.append(firstPart);
|
||||||
_rows.append(data);
|
_rows.append(data);
|
||||||
@ -79,7 +79,7 @@ QObject* FluTreeModel::getRow(int row){
|
|||||||
void FluTreeModel::checkRow(int row,bool checked){
|
void FluTreeModel::checkRow(int row,bool checked){
|
||||||
auto itemData = _rows.at(row);
|
auto itemData = _rows.at(row);
|
||||||
if(itemData->hasChildren()){
|
if(itemData->hasChildren()){
|
||||||
QList<FluTreeNode*> stack = itemData->_children;
|
QList<FluNode*> stack = itemData->_children;
|
||||||
std::reverse(stack.begin(), stack.end());
|
std::reverse(stack.begin(), stack.end());
|
||||||
while (stack.count() > 0) {
|
while (stack.count() > 0) {
|
||||||
auto item = stack.at(stack.count()-1);
|
auto item = stack.at(stack.count()-1);
|
||||||
@ -87,7 +87,7 @@ void FluTreeModel::checkRow(int row,bool checked){
|
|||||||
if(!item->hasChildren()){
|
if(!item->hasChildren()){
|
||||||
item->_checked = checked;
|
item->_checked = checked;
|
||||||
}
|
}
|
||||||
QList<FluTreeNode*> children = item->_children;
|
QList<FluNode*> children = item->_children;
|
||||||
if(!children.isEmpty()){
|
if(!children.isEmpty()){
|
||||||
std::reverse(children.begin(), children.end());
|
std::reverse(children.begin(), children.end());
|
||||||
foreach (auto c, children) {
|
foreach (auto c, children) {
|
||||||
@ -101,8 +101,8 @@ void FluTreeModel::checkRow(int row,bool checked){
|
|||||||
}
|
}
|
||||||
itemData->_checked = checked;
|
itemData->_checked = checked;
|
||||||
}
|
}
|
||||||
Q_EMIT dataChanged(index(0,0),index(rowCount()-1,0));
|
Q_EMIT layoutChanged(QList<QPersistentModelIndex>(),QAbstractItemModel::VerticalSortHint);
|
||||||
QList<FluTreeNode*> data;
|
QList<FluNode*> data;
|
||||||
foreach (auto item, _dataSource) {
|
foreach (auto item, _dataSource) {
|
||||||
if(!item->hasChildren()){
|
if(!item->hasChildren()){
|
||||||
if(item->_checked){
|
if(item->_checked){
|
||||||
@ -119,16 +119,16 @@ void FluTreeModel::setDataSource(QList<QMap<QString,QVariant>> data){
|
|||||||
delete _root;
|
delete _root;
|
||||||
_root = nullptr;
|
_root = nullptr;
|
||||||
}
|
}
|
||||||
_root = new FluTreeNode(this);
|
_root = new FluNode(this);
|
||||||
std::reverse(data.begin(), data.end());
|
std::reverse(data.begin(), data.end());
|
||||||
while (data.count() > 0) {
|
while (data.count() > 0) {
|
||||||
auto item = data.at(data.count()-1);
|
auto item = data.at(data.count()-1);
|
||||||
data.pop_back();
|
data.pop_back();
|
||||||
FluTreeNode* node = new FluTreeNode(this);
|
FluNode* node = new FluNode(this);
|
||||||
node->_title = item.value("title").toString();
|
node->_title = item.value("title").toString();
|
||||||
node->_key = item.value("key").toString();
|
node->_key = item.value("key").toString();
|
||||||
node->_depth = item.value("__depth").toInt();
|
node->_depth = item.value("__depth").toInt();
|
||||||
node->_parent = item.value("__parent").value<FluTreeNode*>();
|
node->_parent = item.value("__parent").value<FluNode*>();
|
||||||
node->_isExpanded = true;
|
node->_isExpanded = true;
|
||||||
if(node->_parent){
|
if(node->_parent){
|
||||||
node->_parent->_children.append(node);
|
node->_parent->_children.append(node);
|
||||||
@ -181,8 +181,8 @@ void FluTreeModel::expand(int row){
|
|||||||
_rows.at(row)->_isExpanded = true;
|
_rows.at(row)->_isExpanded = true;
|
||||||
Q_EMIT dataChanged(index(row,0),index(row,0));
|
Q_EMIT dataChanged(index(row,0),index(row,0));
|
||||||
auto modelData = _rows.at(row);
|
auto modelData = _rows.at(row);
|
||||||
QList<FluTreeNode*> insertData;
|
QList<FluNode*> insertData;
|
||||||
QList<FluTreeNode*> stack = modelData->_children;
|
QList<FluNode*> stack = modelData->_children;
|
||||||
std::reverse(stack.begin(), stack.end());
|
std::reverse(stack.begin(), stack.end());
|
||||||
while (stack.count() > 0) {
|
while (stack.count() > 0) {
|
||||||
auto item = stack.at(stack.count()-1);
|
auto item = stack.at(stack.count()-1);
|
||||||
@ -190,7 +190,7 @@ void FluTreeModel::expand(int row){
|
|||||||
if(item->isShown()){
|
if(item->isShown()){
|
||||||
insertData.append(item);
|
insertData.append(item);
|
||||||
}
|
}
|
||||||
QList<FluTreeNode*> children = item->_children;
|
QList<FluNode*> children = item->_children;
|
||||||
if(!children.isEmpty()){
|
if(!children.isEmpty()){
|
||||||
std::reverse(children.begin(), children.end());
|
std::reverse(children.begin(), children.end());
|
||||||
foreach (auto c, children) {
|
foreach (auto c, children) {
|
||||||
@ -242,7 +242,7 @@ void FluTreeModel::dragAndDrop(int dragIndex,int dropIndex,bool isDropTopArea){
|
|||||||
|
|
||||||
Q_EMIT layoutAboutToBeChanged();
|
Q_EMIT layoutAboutToBeChanged();
|
||||||
if(dragItem->_parent == dropItem->_parent){
|
if(dragItem->_parent == dropItem->_parent){
|
||||||
QList<FluTreeNode*>* children = &(dragItem->_parent->_children);
|
QList<FluNode*>* children = &(dragItem->_parent->_children);
|
||||||
int srcIndex = children->indexOf(dragItem);
|
int srcIndex = children->indexOf(dragItem);
|
||||||
int destIndex = children->indexOf(dropItem);
|
int destIndex = children->indexOf(dropItem);
|
||||||
if(dropIndex > dragIndex){
|
if(dropIndex > dragIndex){
|
||||||
@ -260,14 +260,14 @@ void FluTreeModel::dragAndDrop(int dragIndex,int dropIndex,bool isDropTopArea){
|
|||||||
}
|
}
|
||||||
children->move(srcIndex,targetIndex);
|
children->move(srcIndex,targetIndex);
|
||||||
}else{
|
}else{
|
||||||
QList<FluTreeNode*>* srcChildren = &(dragItem->_parent->_children);
|
QList<FluNode*>* srcChildren = &(dragItem->_parent->_children);
|
||||||
QList<FluTreeNode*>* destChildren = &(dropItem->_parent->_children);
|
QList<FluNode*>* destChildren = &(dropItem->_parent->_children);
|
||||||
int srcIndex = srcChildren->indexOf(dragItem);
|
int srcIndex = srcChildren->indexOf(dragItem);
|
||||||
int destIndex = destChildren->indexOf(dropItem);
|
int destIndex = destChildren->indexOf(dropItem);
|
||||||
dragItem->_depth = dropItem->_depth;
|
dragItem->_depth = dropItem->_depth;
|
||||||
dragItem->_parent = dropItem->_parent;
|
dragItem->_parent = dropItem->_parent;
|
||||||
if(dragItem->hasChildren()){
|
if(dragItem->hasChildren()){
|
||||||
QList<FluTreeNode*> stack = dragItem->_children;
|
QList<FluNode*> stack = dragItem->_children;
|
||||||
foreach (auto node, stack) {
|
foreach (auto node, stack) {
|
||||||
node->_depth = dragItem->_depth+1;
|
node->_depth = dragItem->_depth+1;
|
||||||
}
|
}
|
||||||
@ -275,7 +275,7 @@ void FluTreeModel::dragAndDrop(int dragIndex,int dropIndex,bool isDropTopArea){
|
|||||||
while (stack.count() > 0) {
|
while (stack.count() > 0) {
|
||||||
auto item = stack.at(stack.count()-1);
|
auto item = stack.at(stack.count()-1);
|
||||||
stack.pop_back();
|
stack.pop_back();
|
||||||
QList<FluTreeNode*> children = item->_children;
|
QList<FluNode*> children = item->_children;
|
||||||
if(!children.isEmpty()){
|
if(!children.isEmpty()){
|
||||||
std::reverse(children.begin(), children.end());
|
std::reverse(children.begin(), children.end());
|
||||||
foreach (auto c, children) {
|
foreach (auto c, children) {
|
||||||
@ -302,7 +302,8 @@ void FluTreeModel::dragAndDrop(int dragIndex,int dropIndex,bool isDropTopArea){
|
|||||||
destChildren->insert(targetIndex,dragItem);
|
destChildren->insert(targetIndex,dragItem);
|
||||||
}
|
}
|
||||||
changePersistentIndex(index(qMin(dragIndex,dropIndex),0),index(qMax(dragIndex,dropIndex),0));
|
changePersistentIndex(index(qMin(dragIndex,dropIndex),0),index(qMax(dragIndex,dropIndex),0));
|
||||||
Q_EMIT dataChanged(index(0,0),index(rowCount()-1,0));
|
Q_EMIT layoutChanged(QList<QPersistentModelIndex>(),QAbstractItemModel::VerticalSortHint);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FluTreeModel::hitHasChildrenExpanded(int row){
|
bool FluTreeModel::hitHasChildrenExpanded(int row){
|
||||||
@ -317,14 +318,14 @@ void FluTreeModel::refreshNode(int row){
|
|||||||
Q_EMIT dataChanged(index(row,0),index(row,0));
|
Q_EMIT dataChanged(index(row,0),index(row,0));
|
||||||
};
|
};
|
||||||
|
|
||||||
FluTreeNode* FluTreeModel::getNode(int row){
|
FluNode* FluTreeModel::getNode(int row){
|
||||||
return _rows.at(row);
|
return _rows.at(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FluTreeModel::allExpand(){
|
void FluTreeModel::allExpand(){
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
QList<FluTreeNode*> data;
|
QList<FluNode*> data;
|
||||||
QList<FluTreeNode*> stack = _root->_children;
|
QList<FluNode*> stack = _root->_children;
|
||||||
std::reverse(stack.begin(), stack.end());
|
std::reverse(stack.begin(), stack.end());
|
||||||
while (stack.count() > 0) {
|
while (stack.count() > 0) {
|
||||||
auto item = stack.at(stack.count()-1);
|
auto item = stack.at(stack.count()-1);
|
||||||
@ -333,7 +334,7 @@ void FluTreeModel::allExpand(){
|
|||||||
item->_isExpanded = true;
|
item->_isExpanded = true;
|
||||||
}
|
}
|
||||||
data.append(item);
|
data.append(item);
|
||||||
QList<FluTreeNode*> children = item->_children;
|
QList<FluNode*> children = item->_children;
|
||||||
if(!children.isEmpty()){
|
if(!children.isEmpty()){
|
||||||
std::reverse(children.begin(), children.end());
|
std::reverse(children.begin(), children.end());
|
||||||
foreach (auto c, children) {
|
foreach (auto c, children) {
|
||||||
@ -346,7 +347,7 @@ void FluTreeModel::allExpand(){
|
|||||||
}
|
}
|
||||||
void FluTreeModel::allCollapse(){
|
void FluTreeModel::allCollapse(){
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
QList<FluTreeNode*> stack = _root->_children;
|
QList<FluNode*> stack = _root->_children;
|
||||||
std::reverse(stack.begin(), stack.end());
|
std::reverse(stack.begin(), stack.end());
|
||||||
while (stack.count() > 0) {
|
while (stack.count() > 0) {
|
||||||
auto item = stack.at(stack.count()-1);
|
auto item = stack.at(stack.count()-1);
|
||||||
@ -354,7 +355,7 @@ void FluTreeModel::allCollapse(){
|
|||||||
if(item->hasChildren()){
|
if(item->hasChildren()){
|
||||||
item->_isExpanded = false;
|
item->_isExpanded = false;
|
||||||
}
|
}
|
||||||
QList<FluTreeNode*> children = item->_children;
|
QList<FluNode*> children = item->_children;
|
||||||
if(!children.isEmpty()){
|
if(!children.isEmpty()){
|
||||||
std::reverse(children.begin(), children.end());
|
std::reverse(children.begin(), children.end());
|
||||||
foreach (auto c, children) {
|
foreach (auto c, children) {
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The FluTreeNode class
|
* @brief The FluNode class
|
||||||
*/
|
*/
|
||||||
class FluTreeNode : public QObject{
|
class FluNode : public QObject{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY(QString key READ key CONSTANT)
|
Q_PROPERTY(QString key READ key CONSTANT)
|
||||||
Q_PROPERTY(QString title READ title CONSTANT)
|
Q_PROPERTY(QString title READ title CONSTANT)
|
||||||
@ -18,14 +18,14 @@ class FluTreeNode : public QObject{
|
|||||||
Q_PROPERTY(bool isExpanded READ isExpanded CONSTANT)
|
Q_PROPERTY(bool isExpanded READ isExpanded CONSTANT)
|
||||||
Q_PROPERTY(bool checked READ checked CONSTANT)
|
Q_PROPERTY(bool checked READ checked CONSTANT)
|
||||||
public:
|
public:
|
||||||
explicit FluTreeNode(QObject *parent = nullptr);
|
explicit FluNode(QObject *parent = nullptr);
|
||||||
Q_INVOKABLE QString key(){return _key;};
|
Q_INVOKABLE QString key(){return _key;};
|
||||||
Q_INVOKABLE QString title(){return _title;};
|
Q_INVOKABLE QString title(){return _title;};
|
||||||
Q_INVOKABLE int depth(){return _depth;};
|
Q_INVOKABLE int depth(){return _depth;};
|
||||||
Q_INVOKABLE bool isExpanded(){return _isExpanded;};
|
Q_INVOKABLE bool isExpanded(){return _isExpanded;};
|
||||||
Q_INVOKABLE bool hasChildren(){ return !_children.isEmpty();};
|
Q_INVOKABLE bool hasChildren(){ return !_children.isEmpty();};
|
||||||
Q_INVOKABLE bool hasNextNodeByIndex(int index){
|
Q_INVOKABLE bool hasNextNodeByIndex(int index){
|
||||||
FluTreeNode* p = this;
|
FluNode* p = this;
|
||||||
for(int i=0;i<(_depth - index -1);i++){
|
for(int i=0;i<(_depth - index -1);i++){
|
||||||
p = p->_parent;
|
p = p->_parent;
|
||||||
}
|
}
|
||||||
@ -75,15 +75,15 @@ public:
|
|||||||
int _depth=0;
|
int _depth=0;
|
||||||
bool _checked = false;
|
bool _checked = false;
|
||||||
bool _isExpanded=true;
|
bool _isExpanded=true;
|
||||||
QList<FluTreeNode*> _children;
|
QList<FluNode*> _children;
|
||||||
FluTreeNode* _parent = nullptr;
|
FluNode* _parent = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
class FluTreeModel : public QAbstractItemModel
|
class FluTreeModel : public QAbstractItemModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PROPERTY_AUTO(int,dataSourceSize)
|
Q_PROPERTY_AUTO(int,dataSourceSize)
|
||||||
Q_PROPERTY_AUTO(QList<FluTreeNode*>,selectionModel)
|
Q_PROPERTY_AUTO(QList<FluNode*>,selectionModel)
|
||||||
QML_NAMED_ELEMENT(FluTreeModel)
|
QML_NAMED_ELEMENT(FluTreeModel)
|
||||||
QML_ADDED_IN_MINOR_VERSION(1)
|
QML_ADDED_IN_MINOR_VERSION(1)
|
||||||
public:
|
public:
|
||||||
@ -96,23 +96,23 @@ public:
|
|||||||
QModelIndex index(int row, int column,const QModelIndex &parent = QModelIndex()) const override;
|
QModelIndex index(int row, int column,const QModelIndex &parent = QModelIndex()) const override;
|
||||||
|
|
||||||
Q_INVOKABLE void removeRows(int row,int count);
|
Q_INVOKABLE void removeRows(int row,int count);
|
||||||
Q_INVOKABLE void insertRows(int row,QList<FluTreeNode*> data);
|
Q_INVOKABLE void insertRows(int row,QList<FluNode*> data);
|
||||||
Q_INVOKABLE QObject* getRow(int row);
|
Q_INVOKABLE QObject* getRow(int row);
|
||||||
Q_INVOKABLE void setData(QList<FluTreeNode*> data);
|
Q_INVOKABLE void setData(QList<FluNode*> data);
|
||||||
Q_INVOKABLE void setDataSource(QList<QMap<QString,QVariant>> data);
|
Q_INVOKABLE void setDataSource(QList<QMap<QString,QVariant>> data);
|
||||||
Q_INVOKABLE void collapse(int row);
|
Q_INVOKABLE void collapse(int row);
|
||||||
Q_INVOKABLE void expand(int row);
|
Q_INVOKABLE void expand(int row);
|
||||||
Q_INVOKABLE void dragAndDrop(int dragIndex,int dropIndex,bool isDropTopArea);
|
Q_INVOKABLE void dragAndDrop(int dragIndex,int dropIndex,bool isDropTopArea);
|
||||||
Q_INVOKABLE FluTreeNode* getNode(int row);
|
Q_INVOKABLE FluNode* getNode(int row);
|
||||||
Q_INVOKABLE void refreshNode(int row);
|
Q_INVOKABLE void refreshNode(int row);
|
||||||
Q_INVOKABLE void checkRow(int row,bool checked);
|
Q_INVOKABLE void checkRow(int row,bool checked);
|
||||||
Q_INVOKABLE bool hitHasChildrenExpanded(int row);
|
Q_INVOKABLE bool hitHasChildrenExpanded(int row);
|
||||||
Q_INVOKABLE void allExpand();
|
Q_INVOKABLE void allExpand();
|
||||||
Q_INVOKABLE void allCollapse();
|
Q_INVOKABLE void allCollapse();
|
||||||
private:
|
private:
|
||||||
QList<FluTreeNode*> _rows;
|
QList<FluNode*> _rows;
|
||||||
QList<FluTreeNode*> _dataSource;
|
QList<FluNode*> _dataSource;
|
||||||
FluTreeNode* _root = nullptr;
|
FluNode* _root = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FLUTREEMODEL_H
|
#endif // FLUTREEMODEL_H
|
||||||
|
@ -5,17 +5,16 @@ import Qt.labs.qmlmodels 1.0
|
|||||||
import FluentUI 1.0
|
import FluentUI 1.0
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
readonly property alias rows: table_view.rows
|
|
||||||
readonly property alias columns: table_view.columns
|
|
||||||
readonly property alias current: d.current
|
|
||||||
readonly property alias sourceModel: table_model
|
|
||||||
property var columnSource
|
property var columnSource
|
||||||
property var dataSource
|
property var dataSource
|
||||||
property color borderColor: FluTheme.dark ? Qt.rgba(37/255,37/255,37/255,1) : Qt.rgba(228/255,228/255,228/255,1)
|
property color borderColor: FluTheme.dark ? "#252525" : "#e4e4e4"
|
||||||
|
property alias rows: table_view.rows
|
||||||
|
property alias columns: table_view.columns
|
||||||
property bool horizonalHeaderVisible: true
|
property bool horizonalHeaderVisible: true
|
||||||
property bool verticalHeaderVisible: true
|
property bool verticalHeaderVisible: true
|
||||||
property color selectedBorderColor: FluTheme.primaryColor
|
property color selectedBorderColor: FluTheme.primaryColor
|
||||||
property color selectedColor: FluTools.colorAlpha(FluTheme.primaryColor,0.3)
|
property color selectedColor: FluTools.colorAlpha(FluTheme.primaryColor,0.3)
|
||||||
|
property alias sourceModel: table_model
|
||||||
id:control
|
id:control
|
||||||
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
||||||
onColumnSourceChanged: {
|
onColumnSourceChanged: {
|
||||||
@ -380,7 +379,7 @@ Rectangle {
|
|||||||
model: table_sort_model
|
model: table_sort_model
|
||||||
clip: true
|
clip: true
|
||||||
onRowsChanged: {
|
onRowsChanged: {
|
||||||
control.closeEditor()
|
closeEditor()
|
||||||
}
|
}
|
||||||
delegate: com_table_delegate
|
delegate: com_table_delegate
|
||||||
FluLoader{
|
FluLoader{
|
||||||
@ -493,7 +492,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
onClicked:
|
onClicked:
|
||||||
(event)=>{
|
(event)=>{
|
||||||
control.closeEditor()
|
closeEditor()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluLoader{
|
FluLoader{
|
||||||
@ -624,7 +623,7 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
onClicked:
|
onClicked:
|
||||||
(event)=>{
|
(event)=>{
|
||||||
control.closeEditor()
|
closeEditor()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MouseArea{
|
MouseArea{
|
||||||
|
@ -6,17 +6,16 @@ import Qt.labs.qmlmodels
|
|||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
readonly property alias rows: table_view.rows
|
|
||||||
readonly property alias columns: table_view.columns
|
|
||||||
readonly property alias current: d.current
|
|
||||||
readonly property alias sourceModel: table_model
|
|
||||||
property var columnSource
|
property var columnSource
|
||||||
property var dataSource
|
property var dataSource
|
||||||
property color borderColor: FluTheme.dark ? Qt.rgba(37/255,37/255,37/255,1) : Qt.rgba(228/255,228/255,228/255,1)
|
property color borderColor: FluTheme.dark ? "#252525" : "#e4e4e4"
|
||||||
|
property alias rows: table_view.rows
|
||||||
|
property alias columns: table_view.columns
|
||||||
property bool horizonalHeaderVisible: true
|
property bool horizonalHeaderVisible: true
|
||||||
property bool verticalHeaderVisible: true
|
property bool verticalHeaderVisible: true
|
||||||
property color selectedBorderColor: FluTheme.primaryColor
|
property color selectedBorderColor: FluTheme.primaryColor
|
||||||
property color selectedColor: FluTools.colorAlpha(FluTheme.primaryColor,0.3)
|
property color selectedColor: FluTools.colorAlpha(FluTheme.primaryColor,0.3)
|
||||||
|
property alias sourceModel: table_model
|
||||||
id:control
|
id:control
|
||||||
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
||||||
onColumnSourceChanged: {
|
onColumnSourceChanged: {
|
||||||
|
@ -8,12 +8,12 @@ FluButton {
|
|||||||
property int hourFormat: FluTimePickerType.H
|
property int hourFormat: FluTimePickerType.H
|
||||||
property int isH: hourFormat === FluTimePickerType.H
|
property int isH: hourFormat === FluTimePickerType.H
|
||||||
property var current
|
property var current
|
||||||
property string amText: qsTr("AM")
|
property string amText: "上午"
|
||||||
property string pmText: qsTr("PM")
|
property string pmText: "下午"
|
||||||
property string hourText: qsTr("Hour")
|
property string hourText: "时"
|
||||||
property string minuteText: qsTr("Minute")
|
property string minuteText: "分"
|
||||||
property string cancelText: qsTr("Cancel")
|
property string cancelText: "取消"
|
||||||
property string okText: qsTr("OK")
|
property string okText: "确定"
|
||||||
signal accepted()
|
signal accepted()
|
||||||
id:control
|
id:control
|
||||||
implicitHeight: 30
|
implicitHeight: 30
|
||||||
|
@ -63,6 +63,10 @@
|
|||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>FluCalendarPicker</name>
|
<name>FluCalendarPicker</name>
|
||||||
|
<message>
|
||||||
|
<source>Please select a date</source>
|
||||||
|
<translation type="obsolete">请选择日期</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="Qt5/imports/FluentUI/Controls/FluCalendarPicker.qml" line="13"/>
|
<location filename="Qt5/imports/FluentUI/Controls/FluCalendarPicker.qml" line="13"/>
|
||||||
<location filename="Qt6/imports/FluentUI/Controls/FluCalendarPicker.qml" line="12"/>
|
<location filename="Qt6/imports/FluentUI/Controls/FluCalendarPicker.qml" line="12"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user