mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-01 23:51:48 +08:00
add qcustomplot
This commit is contained in:
@ -210,6 +210,7 @@
|
||||
<file>qml/page/T_OpenGL.qml</file>
|
||||
<file>qml/page/T_Icons.qml</file>
|
||||
<file>qml/window/HotkeyWindow.qml</file>
|
||||
<file>qml/page/T_CustomPlot.qml</file>
|
||||
</qresource>
|
||||
<qresource prefix="/"/>
|
||||
</RCC>
|
||||
|
@ -536,41 +536,46 @@
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="436"/>
|
||||
<source>QRCode</source>
|
||||
<source>QCustomPlot</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="442"/>
|
||||
<source>Tour</source>
|
||||
<source>QRCode</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="448"/>
|
||||
<source>Timeline</source>
|
||||
<source>Tour</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="454"/>
|
||||
<source>Captcha</source>
|
||||
<source>Timeline</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="460"/>
|
||||
<source>Captcha</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="466"/>
|
||||
<source>Network</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="467"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="473"/>
|
||||
<source>Remote Loader</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="481"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="487"/>
|
||||
<source>Hot Loader</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="487"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="493"/>
|
||||
<source>Test Crash</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
@ -1149,6 +1154,14 @@ Updated content:
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_CustomPlot</name>
|
||||
<message>
|
||||
<location filename="qml/page/T_CustomPlot.qml" line="10"/>
|
||||
<source>QCustomPlot</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_DatePicker</name>
|
||||
<message>
|
||||
|
@ -536,36 +536,41 @@
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="436"/>
|
||||
<source>QCustomPlot</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="442"/>
|
||||
<source>QRCode</source>
|
||||
<translation type="unfinished">二维码</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="442"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="448"/>
|
||||
<source>Tour</source>
|
||||
<translation type="unfinished">游览</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="448"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="454"/>
|
||||
<source>Timeline</source>
|
||||
<translation type="unfinished">时间轴</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="454"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="460"/>
|
||||
<source>Captcha</source>
|
||||
<translation type="unfinished">验证码</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="460"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="466"/>
|
||||
<source>Network</source>
|
||||
<translation type="unfinished">网络</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="467"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="473"/>
|
||||
<source>Remote Loader</source>
|
||||
<translation type="unfinished">远程加载</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="481"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="487"/>
|
||||
<source>Hot Loader</source>
|
||||
<translation type="unfinished">热加载</translation>
|
||||
</message>
|
||||
@ -574,7 +579,7 @@
|
||||
<translation type="obsolete">3D</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="487"/>
|
||||
<location filename="qml/global/ItemsOriginal.qml" line="493"/>
|
||||
<source>Test Crash</source>
|
||||
<translation type="unfinished">测试崩溃</translation>
|
||||
</message>
|
||||
@ -1208,6 +1213,46 @@ Updated content:
|
||||
<translation type="unfinished">组合框</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_CustomPlot</name>
|
||||
<message>
|
||||
<source>MultiWindow</source>
|
||||
<translation type="obsolete">多窗口</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><font color='red'>Standard</font> mode window,a new window is created every time</source>
|
||||
<translation type="obsolete"><font color='red'>Standard</font> 模式窗口,每次都会创建新窗口</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Create Window</source>
|
||||
<translation type="obsolete">创建窗口</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><font color='red'>SingleTask</font> mode window,If a window exists, this activates the window</source>
|
||||
<translation type="obsolete"><font color='red'>SingleTask</font> 模式窗口,如果窗口存在,这激活该窗口</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source><font color='red'>SingleInstance</font> mode window,If the window exists, destroy the window and create a new window</source>
|
||||
<translation type="obsolete"><font color='red'>SingleInstance</font> 模式窗口,如果窗口存在,则销毁窗口,然后新建窗口</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Create the window without carrying any parameters</source>
|
||||
<translation type="obsolete">创建一个窗口,不携带任何参数</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Create a window with the parameter username: zhuzichu</source>
|
||||
<translation type="obsolete">创建一个窗口,并携带参数用户名:zhuzichu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Login Window Returned Password - ></source>
|
||||
<translation type="obsolete">登录窗口返回过来的密码 - ></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="qml/page/T_CustomPlot.qml" line="10"/>
|
||||
<source>QCustomPlot</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>T_DatePicker</name>
|
||||
<message>
|
||||
|
@ -432,6 +432,12 @@ FluObject{
|
||||
url: "qrc:/example/qml/page/T_OpenGL.qml"
|
||||
onTap: { navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title: qsTr("QCustomPlot")
|
||||
menuDelegate: paneItemMenu
|
||||
url: "qrc:/example/qml/page/T_CustomPlot.qml"
|
||||
onTap: { navigationView.push(url) }
|
||||
}
|
||||
FluPaneItem{
|
||||
title: qsTr("QRCode")
|
||||
menuDelegate: paneItemMenu
|
||||
|
49
example/qml/page/T_CustomPlot.qml
Normal file
49
example/qml/page/T_CustomPlot.qml
Normal file
@ -0,0 +1,49 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import FluentUI 1.0
|
||||
import "../component"
|
||||
|
||||
FluPage{
|
||||
|
||||
title: qsTr("QCustomPlot")
|
||||
TimePlot {
|
||||
id: timePlot
|
||||
anchors.fill: parent
|
||||
plotTimeRangeInMilliseconds: 10
|
||||
xAxis.visible: true
|
||||
yAxis.visible: true
|
||||
x1Axis.visible: false
|
||||
y1Axis.visible: false
|
||||
yAxis.ticker.tickCount: 6
|
||||
yAxis.ticker.ticks: false
|
||||
yAxis.ticker.subTicks: false
|
||||
yAxis.ticker.baseColor: "transparent"
|
||||
yAxis.grid.lineColor: "mediumaquamarine"
|
||||
xAxis.ticker.baseColor: "midnightblue"
|
||||
xAxis.ticker.baseWidth: 2
|
||||
xAxis.grid.lineColor: "transparent"
|
||||
backgroundColor: "mistyrose"
|
||||
Component.onCompleted: {
|
||||
yAxis.setRange(0, 100)
|
||||
addGraph("1")
|
||||
graphs["1"].graphColor = "slategrey"
|
||||
}
|
||||
}
|
||||
Timer {
|
||||
running: true
|
||||
repeat: true
|
||||
interval: 20
|
||||
property int data: 60
|
||||
onTriggered: {
|
||||
data = data - 1
|
||||
if(data == 20) {
|
||||
data = 60
|
||||
}
|
||||
timePlot.addCurrentTimeValue("1", data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
#include <QDir>
|
||||
@ -51,25 +51,25 @@ int main(int argc, char *argv[])
|
||||
//fix bug UOSv20 v-sync does not work
|
||||
qputenv("QSG_RENDER_LOOP","basic");
|
||||
#endif
|
||||
QGuiApplication::setOrganizationName("ZhuZiChu");
|
||||
QGuiApplication::setOrganizationDomain("https://zhuzichu520.github.io");
|
||||
QGuiApplication::setApplicationName("FluentUI");
|
||||
QGuiApplication::setApplicationDisplayName("FluentUI Example");
|
||||
QGuiApplication::setApplicationVersion(APPLICATION_VERSION);
|
||||
QGuiApplication::setQuitOnLastWindowClosed(false);
|
||||
QApplication::setOrganizationName("ZhuZiChu");
|
||||
QApplication::setOrganizationDomain("https://zhuzichu520.github.io");
|
||||
QApplication::setApplicationName("FluentUI");
|
||||
QApplication::setApplicationDisplayName("FluentUI Example");
|
||||
QApplication::setApplicationVersion(APPLICATION_VERSION);
|
||||
QApplication::setQuitOnLastWindowClosed(false);
|
||||
SettingsHelper::getInstance()->init(argv);
|
||||
Log::setup(argv,uri);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
|
||||
#endif
|
||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
||||
QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
||||
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
|
||||
#endif
|
||||
#endif
|
||||
QGuiApplication app(argc, argv);
|
||||
QApplication app(argc, argv);
|
||||
//@uri example
|
||||
qmlRegisterType<CircularReveal>(uri, major, minor, "CircularReveal");
|
||||
qmlRegisterType<FileWatcher>(uri, major, minor, "FileWatcher");
|
||||
@ -96,7 +96,7 @@ int main(int argc, char *argv[])
|
||||
QCoreApplication::exit(-1);
|
||||
}, Qt::QueuedConnection);
|
||||
engine.load(url);
|
||||
const int exec = QGuiApplication::exec();
|
||||
const int exec = QApplication::exec();
|
||||
if (exec == 931) {
|
||||
QProcess::startDetached(qApp->applicationFilePath(), qApp->arguments());
|
||||
}
|
||||
|
Reference in New Issue
Block a user