修复generate-qmltypes生成空白的bug

This commit is contained in:
jeffrey0326 2024-08-30 23:34:01 +08:00
parent 12300ef081
commit 8f8a1a6124
4 changed files with 305 additions and 62 deletions

View File

@ -227,7 +227,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE
if ((${QT_VERSION_MAJOR} LESS_EQUAL 6) AND (CMAKE_BUILD_TYPE MATCHES "Release"))
find_program(QML_PLUGIN_DUMP NAMES qmlplugindump)
add_custom_target(Script-Generate-QmlTypes
COMMAND ${QML_PLUGIN_DUMP} -nonrelocatable FluentUI 1.0 ${CMAKE_CURRENT_BINARY_DIR} > ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/imports/FluentUI/plugins.qmltypes
COMMAND ${QML_PLUGIN_DUMP} -nonrelocatable -noinstantiate FluentUI 1.0 ${CMAKE_CURRENT_BINARY_DIR} > ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/imports/FluentUI/plugins.qmltypes
COMMENT "Generate qmltypes........."
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Qt5/imports/FluentUI/plugins.qmltypes
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -498,10 +498,10 @@ void FluFrameless::componentComplete() {
*result = FALSE;
return false;
} else if (uMsg == WM_NCACTIVATE) {
*result = TRUE;
if (effective() || (!effect().isEmpty() && _currentEffect!="normal")) {
return false;
}
*result = TRUE;
return true;
} else if (_isWindows11OrGreater && (uMsg == WM_NCLBUTTONDBLCLK || uMsg == WM_NCLBUTTONDOWN)) {
if (_hitMaximizeButton()) {

View File

@ -162,31 +162,41 @@ 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());
qmlRegisterSingletonType<FluApp>(uri, major, minor, "FluApp",
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
Q_UNUSED(scriptEngine)
QObject *instance = FluApp::getInstance();
engine->setObjectOwnership(instance, QQmlEngine::CppOwnership);
return instance;
});
qmlRegisterSingletonType<FluColors>(uri, major, minor, "FluColors",
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
Q_UNUSED(scriptEngine)
QObject *instance = FluColors::getInstance();
engine->setObjectOwnership(instance, QQmlEngine::CppOwnership);
return instance;
});
qmlRegisterSingletonType<FluTheme>(uri, major, minor, "FluTheme",
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
Q_UNUSED(scriptEngine)
QObject *instance = FluTheme::getInstance();
engine->setObjectOwnership(instance, QQmlEngine::CppOwnership);
return instance;
});
qmlRegisterSingletonType<FluTools>(uri, major, minor, "FluTools",
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
Q_UNUSED(scriptEngine)
QObject *instance = FluTools::getInstance();
engine->setObjectOwnership(instance, QQmlEngine::CppOwnership);
return instance;
});
qmlRegisterSingletonType<FluTextStyle>(uri, major, minor, "FluTextStyle",
[](QQmlEngine *engine, QJSEngine *scriptEngine) -> QObject* {
Q_UNUSED(scriptEngine)
QObject *instance = FluTextStyle::getInstance();
engine->setObjectOwnership(instance, QQmlEngine::CppOwnership);
return instance;
});
qmlRegisterModule(uri, major, minor);
#endif
}

View File

@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
// 'qmlplugindump -nonrelocatable FluentUI 1.0 D:/QtProjects/build-FluentUI-Desktop_Qt_5_15_2_MSVC2019_64bit-Release/src'
// 'qmlplugindump -nonrelocatable -noinstantiate FluentUI 1.0 F:/FluentUI/build/Desktop_Qt_5_15_2_MSVC2019_32bit-Release/src'
Module {
dependencies: ["QtQuick 2.0"]
@ -151,8 +151,8 @@ Module {
Property { name: "disabled"; type: "bool" }
Property { name: "fixSize"; type: "bool" }
Property { name: "effect"; type: "string" }
Property { name: "effective"; type: "bool" }
Property {name: "availableEffects"; type: "QVariant"}
Property { name: "effective"; type: "bool"; isReadonly: true }
Property { name: "availableEffects"; type: "QStringList"; isReadonly: true }
Method { name: "showFullScreen" }
Method { name: "showMaximized" }
Method { name: "showMinimized" }
@ -399,7 +399,6 @@ Module {
Property { name: "nativeText"; type: "bool" }
Property { name: "animationEnabled"; type: "bool" }
Property { name: "blurBehindWindowEnabled"; type: "bool" }
Property { name: "micaBackgroundColor"; type: "QColor" }
}
Component {
name: "FluThemeType"
@ -673,12 +672,12 @@ Module {
}
}
Component {
name: "Fluent_Icons"
name: "FluentIcons"
exports: ["FluentUI/FluentIcons 1.0"]
isCreatable: false
exportMetaObjectRevisions: [0]
Enum {
name: "Fluent_IconType"
name: "Type"
values: {
"GlobalNavButton": 59136,
"Wifi": 59137,
@ -2453,6 +2452,240 @@ Module {
Method { name: "clear" }
Method { name: "invalidate" }
}
Component {
name: "QmlQCustomPlot::Axis"
prototype: "QObject"
exports: ["FluentUI/Axis 1.0"]
isCreatable: false
exportMetaObjectRevisions: [0]
Enum {
name: "TickerType"
values: {
"Fixed": 0,
"Log": 1,
"Pi": 2,
"Text": 3,
"DateTime": 4,
"Time": 5
}
}
Property { name: "visible"; type: "bool" }
Property { name: "label"; type: "string" }
Property { name: "upper"; type: "float" }
Property { name: "lower"; type: "float" }
Property { name: "grid"; type: "QmlQCustomPlot::Grid"; isReadonly: true; isPointer: true }
Property { name: "ticker"; type: "QmlQCustomPlot::Ticker"; isReadonly: true; isPointer: true }
Signal {
name: "visibleChanged"
Parameter { type: "bool" }
}
Signal {
name: "labelChanged"
Parameter { type: "string" }
}
Signal {
name: "upperChanged"
Parameter { type: "float" }
}
Signal {
name: "lowerChanged"
Parameter { type: "float" }
}
Signal {
name: "gridChanged"
Parameter { type: "QmlQCustomPlot::Grid"; isPointer: true }
}
Signal {
name: "tickerChanged"
Parameter { type: "QmlQCustomPlot::Ticker"; isPointer: true }
}
Method {
name: "setTickerType"
Parameter { name: "type"; type: "TickerType" }
}
Method {
name: "setRange"
Parameter { name: "position"; type: "float" }
Parameter { name: "size"; type: "float" }
Parameter { name: "align"; type: "Qt::AlignmentFlag" }
}
Method {
name: "setRange"
Parameter { name: "lower"; type: "float" }
Parameter { name: "upper"; type: "float" }
}
}
Component {
name: "QmlQCustomPlot::BasePlot"
defaultProperty: "data"
prototype: "QQuickPaintedItem"
exports: ["FluentUI/BasePlot 1.0"]
exportMetaObjectRevisions: [0]
Property { name: "backgroundColor"; type: "QColor" }
Property { name: "xAxis"; type: "QmlQCustomPlot::Axis"; isReadonly: true; isPointer: true }
Property { name: "x1Axis"; type: "QmlQCustomPlot::Axis"; isReadonly: true; isPointer: true }
Property { name: "yAxis"; type: "QmlQCustomPlot::Axis"; isReadonly: true; isPointer: true }
Property { name: "y1Axis"; type: "QmlQCustomPlot::Axis"; isReadonly: true; isPointer: true }
Property { name: "graphs"; type: "QVariantMap"; isReadonly: true }
Signal {
name: "backgroundColorChanged"
Parameter { type: "QColor" }
}
Signal {
name: "xAxisChanged"
Parameter { type: "QmlQCustomPlot::Axis"; isPointer: true }
}
Signal {
name: "x1AxisChanged"
Parameter { type: "QmlQCustomPlot::Axis"; isPointer: true }
}
Signal {
name: "yAxisChanged"
Parameter { type: "QmlQCustomPlot::Axis"; isPointer: true }
}
Signal {
name: "y1AxisChanged"
Parameter { type: "QmlQCustomPlot::Axis"; isPointer: true }
}
Method {
name: "addGraph"
Parameter { name: "key"; type: "string" }
}
Method {
name: "removeGraph"
Parameter { name: "key"; type: "string" }
}
Method {
name: "rescaleAxes"
Parameter { name: "onlyVisiblePlottables"; type: "bool" }
}
Method { name: "rescaleAxes" }
}
Component {
name: "QmlQCustomPlot::Grid"
prototype: "QObject"
exports: ["FluentUI/PlotGrid 1.0"]
isCreatable: false
exportMetaObjectRevisions: [0]
Enum {
name: "LineType"
values: {
"NoPen": 0,
"SolidLine": 1,
"DashLine": 2,
"DotLine": 3,
"DashDotLine": 4,
"DashDotDotLine": 5
}
}
Property { name: "visible"; type: "bool" }
Property { name: "subVisible"; type: "bool" }
Property { name: "lineWidth"; type: "int" }
Property { name: "lineColor"; type: "QColor" }
Property { name: "lineType"; type: "LineType" }
Property { name: "subLineWidth"; type: "int" }
Property { name: "subLineColor"; type: "QColor" }
Property { name: "subLineType"; type: "LineType" }
Signal {
name: "visibleChanged"
Parameter { type: "bool" }
}
Signal {
name: "subVisibleChanged"
Parameter { type: "bool" }
}
Signal {
name: "lineWidthChanged"
Parameter { type: "int" }
}
Signal {
name: "lineColorChanged"
Parameter { type: "QColor" }
}
Signal {
name: "lineTypeChanged"
Parameter { type: "LineType" }
}
Signal {
name: "subLineWidthChanged"
Parameter { type: "int" }
}
Signal {
name: "subLineColorChanged"
Parameter { type: "QColor" }
}
Signal {
name: "subLineTypeChanged"
Parameter { type: "LineType" }
}
}
Component {
name: "QmlQCustomPlot::Ticker"
prototype: "QObject"
exports: ["FluentUI/Ticker 1.0"]
isCreatable: false
exportMetaObjectRevisions: [0]
Property { name: "ticks"; type: "bool" }
Property { name: "subTicks"; type: "bool" }
Property { name: "tickCount"; type: "int" }
Property { name: "baseWidth"; type: "int" }
Property { name: "baseColor"; type: "QColor" }
Property { name: "tickColor"; type: "QColor" }
Property { name: "subTickColor"; type: "QColor" }
Signal {
name: "ticksChanged"
Parameter { type: "bool" }
}
Signal {
name: "subTicksChanged"
Parameter { type: "bool" }
}
Signal {
name: "tickCountChanged"
Parameter { type: "int" }
}
Signal {
name: "baseWidthChanged"
Parameter { type: "int" }
}
Signal {
name: "baseColorChanged"
Parameter { type: "QColor" }
}
Signal {
name: "tickColorChanged"
Parameter { type: "QColor" }
}
Signal {
name: "subTickColorChanged"
Parameter { type: "QColor" }
}
}
Component {
name: "QmlQCustomPlot::TimePlot"
defaultProperty: "data"
prototype: "QmlQCustomPlot::BasePlot"
exports: ["FluentUI/TimePlot 1.0"]
exportMetaObjectRevisions: [0]
Property { name: "plotTimeRangeInMilliseconds"; type: "int" }
Signal {
name: "plotTimeRangeInMillisecondsChanged"
Parameter { type: "int" }
}
Method {
name: "setTimeFormat"
Parameter { name: "format"; type: "string" }
}
Method {
name: "addCurrentTimeValue"
Parameter { name: "name"; type: "string" }
Parameter { name: "value"; type: "double" }
}
Method {
name: "addCurrentTimeValues"
Parameter { name: "values"; type: "QVariantMap" }
}
}
Component {
prototype: "QQuickItem"
name: "FluentUI/FluAcrylic 1.0"
@ -2511,37 +2744,37 @@ Module {
Property { name: "darkClickListener"; type: "QVariant" }
Property {
name: "buttonStayTop"
type: "FluIconButton_QMLTYPE_18"
type: "FluIconButton_QMLTYPE_19"
isReadonly: true
isPointer: true
}
Property {
name: "buttonMinimize"
type: "FluIconButton_QMLTYPE_18"
type: "FluIconButton_QMLTYPE_19"
isReadonly: true
isPointer: true
}
Property {
name: "buttonMaximize"
type: "FluIconButton_QMLTYPE_18"
type: "FluIconButton_QMLTYPE_19"
isReadonly: true
isPointer: true
}
Property {
name: "buttonClose"
type: "FluIconButton_QMLTYPE_18"
type: "FluIconButton_QMLTYPE_19"
isReadonly: true
isPointer: true
}
Property {
name: "buttonDark"
type: "FluIconButton_QMLTYPE_18"
type: "FluIconButton_QMLTYPE_19"
isReadonly: true
isPointer: true
}
Property {
name: "layoutMacosButtons"
type: "FluLoader_QMLTYPE_16"
type: "FluLoader_QMLTYPE_18"
isReadonly: true
isPointer: true
}
@ -3234,15 +3467,15 @@ Module {
defaultProperty: "data"
Property { name: "logo"; type: "QUrl" }
Property { name: "title"; type: "string" }
Property { name: "items"; type: "FluObject_QMLTYPE_164"; isPointer: true }
Property { name: "footerItems"; type: "FluObject_QMLTYPE_164"; isPointer: true }
Property { name: "items"; type: "FluObject_QMLTYPE_130"; isPointer: true }
Property { name: "footerItems"; type: "FluObject_QMLTYPE_130"; isPointer: true }
Property { name: "displayMode"; type: "int" }
Property { name: "autoSuggestBox"; type: "QQmlComponent"; isPointer: true }
Property { name: "actionItem"; type: "QQmlComponent"; isPointer: true }
Property { name: "topPadding"; type: "int" }
Property { name: "pageMode"; type: "int" }
Property { name: "navItemRightMenu"; type: "FluMenu_QMLTYPE_36"; isPointer: true }
Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_36"; isPointer: true }
Property { name: "navItemRightMenu"; type: "FluMenu_QMLTYPE_40"; isPointer: true }
Property { name: "navItemExpanderRightMenu"; type: "FluMenu_QMLTYPE_40"; isPointer: true }
Property { name: "navCompactWidth"; type: "int" }
Property { name: "navTopMargin"; type: "int" }
Property { name: "cellHeight"; type: "int" }
@ -3250,13 +3483,13 @@ Module {
Property { name: "hideNavAppBar"; type: "bool" }
Property {
name: "buttonMenu"
type: "FluIconButton_QMLTYPE_18"
type: "FluIconButton_QMLTYPE_19"
isReadonly: true
isPointer: true
}
Property {
name: "buttonBack"
type: "FluIconButton_QMLTYPE_18"
type: "FluIconButton_QMLTYPE_19"
isReadonly: true
isPointer: true
}
@ -3624,7 +3857,7 @@ Module {
Method {
name: "removeWindow"
type: "QVariant"
Parameter { name: "window"; type: "QVariant" }
Parameter { name: "win"; type: "QVariant" }
}
Method {
name: "exit"
@ -4142,6 +4375,9 @@ Module {
Property { name: "fixSize"; type: "bool" }
Property { name: "loadingItem"; type: "QQmlComponent"; isPointer: true }
Property { name: "fitsAppBarWindows"; type: "bool" }
Property { name: "tintOpacity"; type: "QVariant" }
Property { name: "blurRadius"; type: "int" }
Property { name: "availableEffects"; type: "QVariant"; isReadonly: true }
Property { name: "appBar"; type: "QQuickItem"; isPointer: true }
Property { name: "backgroundColor"; type: "QColor" }
Property { name: "stayTop"; type: "bool" }
@ -4154,13 +4390,8 @@ Module {
Property { name: "autoVisible"; type: "bool" }
Property { name: "autoCenter"; type: "bool" }
Property { name: "autoDestroy"; type: "bool" }
Property { name: "effect"; type: "string" }
Property { name: "effective"; type: "bool" }
Property { name: "blurRadius"; type: "int" }
Property { name: "tintOpacity"; type: "QVariant" }
Property { name: "useSystemAppBar"; type: "bool" }
Property { name: "__margins"; type: "int" }
Property { name: "resizeBorderColor"; type: "QColor" }
Property { name: "resizeBorderWidth"; type: "int" }
Property { name: "closeListener"; type: "QVariant" }
@ -4168,6 +4399,8 @@ Module {
Property { name: "_route"; type: "string" }
Property { name: "_hideShadow"; type: "bool" }
Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true }
Property { name: "effect"; type: "string" }
Property { name: "effective"; type: "bool"; isReadonly: true }
Signal {
name: "initArgument"
Parameter { name: "argument"; type: "QVariant" }
@ -4205,11 +4438,6 @@ Module {
Method { name: "clearAllInfo"; type: "QVariant" }
Method { name: "moveWindowToDesktopCenter"; type: "QVariant" }
Method { name: "fixWindowSize"; type: "QVariant" }
Method {
name: "registerForWindowResult"
type: "QVariant"
Parameter { name: "path"; type: "QVariant" }
}
Method {
name: "setResult"
type: "QVariant"
@ -4229,6 +4457,8 @@ Module {
type: "QVariant"
Parameter { name: "val"; type: "QVariant" }
}
Method { name: "deleteLater"; type: "QVariant" }
Method { name: "containerItem"; type: "QVariant" }
}
Component {
prototype: "QQuickWindowQmlImpl"
@ -4251,6 +4481,9 @@ Module {
Property { name: "fixSize"; type: "bool" }
Property { name: "loadingItem"; type: "QQmlComponent"; isPointer: true }
Property { name: "fitsAppBarWindows"; type: "bool" }
Property { name: "tintOpacity"; type: "QVariant" }
Property { name: "blurRadius"; type: "int" }
Property { name: "availableEffects"; type: "QVariant"; isReadonly: true }
Property { name: "appBar"; type: "QQuickItem"; isPointer: true }
Property { name: "backgroundColor"; type: "QColor" }
Property { name: "stayTop"; type: "bool" }
@ -4264,6 +4497,7 @@ Module {
Property { name: "autoCenter"; type: "bool" }
Property { name: "autoDestroy"; type: "bool" }
Property { name: "useSystemAppBar"; type: "bool" }
Property { name: "__margins"; type: "int" }
Property { name: "resizeBorderColor"; type: "QColor" }
Property { name: "resizeBorderWidth"; type: "int" }
Property { name: "closeListener"; type: "QVariant" }
@ -4271,6 +4505,8 @@ Module {
Property { name: "_route"; type: "string" }
Property { name: "_hideShadow"; type: "bool" }
Property { name: "contentData"; type: "QObject"; isList: true; isReadonly: true }
Property { name: "effect"; type: "string" }
Property { name: "effective"; type: "bool"; isReadonly: true }
Signal {
name: "initArgument"
Parameter { name: "argument"; type: "QVariant" }
@ -4308,11 +4544,6 @@ Module {
Method { name: "clearAllInfo"; type: "QVariant" }
Method { name: "moveWindowToDesktopCenter"; type: "QVariant" }
Method { name: "fixWindowSize"; type: "QVariant" }
Method {
name: "registerForWindowResult"
type: "QVariant"
Parameter { name: "path"; type: "QVariant" }
}
Method {
name: "setResult"
type: "QVariant"
@ -4332,6 +4563,8 @@ Module {
type: "QVariant"
Parameter { name: "val"; type: "QVariant" }
}
Method { name: "deleteLater"; type: "QVariant" }
Method { name: "containerItem"; type: "QVariant" }
}
Component {
prototype: "QQuickItem"