├── .qmake.stash ├── Animation.pro ├── Animation.pro.user ├── README.md ├── chart ├── realtimecurveqchartwidget.cpp ├── realtimecurveqchartwidget.h ├── themewidget.cpp └── themewidget.h ├── doc ├── @美术入门基础教程.pdf ├── CTK插件框架介绍.docx └── QmlBook-In-Chinese.pdf ├── main.cpp ├── plugins ├── plugin.h ├── plugin_manager.cpp ├── plugin_manager.h ├── pluginmanagerprivate.cpp └── pluginmanagerprivate.h ├── widget.cpp ├── widget.h └── 曾家豪--FH项目预研报告.pptx /.qmake.stash: -------------------------------------------------------------------------------- 1 | QMAKE_CXX.INCDIRS = \ 2 | "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\INCLUDE" \ 3 | "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\ATLMFC\\INCLUDE" \ 4 | "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.10150.0\\ucrt" \ 5 | "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6\\include\\um" \ 6 | "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\shared" \ 7 | "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\um" \ 8 | "C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\winrt" 9 | QMAKE_CXX.LIBDIRS = \ 10 | "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\LIB" \ 11 | "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\ATLMFC\\LIB" \ 12 | "C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.10150.0\\ucrt\\x86" \ 13 | "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6\\lib\\um\\x86" \ 14 | "C:\\Program Files (x86)\\Windows Kits\\8.1\\lib\\winv6.3\\um\\x86" 15 | QMAKE_CXX.QT_COMPILER_STDCXX = 199711L 16 | QMAKE_CXX.QMAKE_MSC_VER = 1900 17 | QMAKE_CXX.QMAKE_MSC_FULL_VER = 190023026 18 | QMAKE_CXX.COMPILER_MACROS = \ 19 | QT_COMPILER_STDCXX \ 20 | QMAKE_MSC_VER \ 21 | QMAKE_MSC_FULL_VER 22 | -------------------------------------------------------------------------------- /Animation.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-12-13T08:40:36 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui charts 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = Animation 12 | TEMPLATE = app 13 | 14 | 15 | SOURCES += main.cpp\ 16 | widget.cpp \ 17 | chart/themewidget.cpp \ 18 | chart/realtimecurveqchartwidget.cpp \ 19 | plugins/plugin_manager.cpp \ 20 | plugins/pluginmanagerprivate.cpp 21 | 22 | HEADERS += widget.h \ 23 | chart/themewidget.h \ 24 | chart/realtimecurveqchartwidget.h \ 25 | plugins/plugin.h \ 26 | plugins/plugin_manager.h \ 27 | plugins/pluginmanagerprivate.h 28 | -------------------------------------------------------------------------------- /Animation.pro.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | EnvironmentId 7 | {1e6aa655-e03d-45c3-b230-579eaf3de651} 8 | 9 | 10 | ProjectExplorer.Project.ActiveTarget 11 | 0 12 | 13 | 14 | ProjectExplorer.Project.EditorSettings 15 | 16 | true 17 | false 18 | true 19 | 20 | Cpp 21 | 22 | CppGlobal 23 | 24 | 25 | 26 | QmlJS 27 | 28 | QmlJSGlobal 29 | 30 | 31 | 2 32 | GBK 33 | false 34 | 4 35 | false 36 | 80 37 | true 38 | true 39 | 1 40 | true 41 | false 42 | 0 43 | true 44 | true 45 | 0 46 | 8 47 | true 48 | 1 49 | true 50 | true 51 | true 52 | false 53 | 54 | 55 | 56 | ProjectExplorer.Project.PluginSettings 57 | 58 | 59 | 60 | ProjectExplorer.Project.Target.0 61 | 62 | Desktop Qt 5.9.3 MSVC2015 32bit 63 | Desktop Qt 5.9.3 MSVC2015 32bit 64 | qt.593.win32_msvc2015_kit 65 | 0 66 | 0 67 | 0 68 | 69 | C:/Qt_Work/traditionalDevelopment 70 | 71 | 72 | true 73 | qmake 74 | 75 | QtProjectManager.QMakeBuildStep 76 | false 77 | 78 | false 79 | false 80 | false 81 | 82 | 83 | true 84 | Make 85 | 86 | Qt4ProjectManager.MakeStep 87 | 88 | false 89 | 90 | 91 | 92 | 2 93 | 构建 94 | 95 | ProjectExplorer.BuildSteps.Build 96 | 97 | 98 | 99 | true 100 | Make 101 | 102 | Qt4ProjectManager.MakeStep 103 | 104 | true 105 | clean 106 | 107 | 108 | 1 109 | 清理 110 | 111 | ProjectExplorer.BuildSteps.Clean 112 | 113 | 2 114 | false 115 | 116 | Release 117 | 118 | Qt4ProjectManager.Qt4BuildConfiguration 119 | 0 120 | true 121 | 122 | 1 123 | 124 | 125 | 0 126 | 部署 127 | 128 | ProjectExplorer.BuildSteps.Deploy 129 | 130 | 1 131 | 在本地部署 132 | 133 | ProjectExplorer.DefaultDeployConfiguration 134 | 135 | 1 136 | 137 | 138 | false 139 | false 140 | 1000 141 | 142 | true 143 | 144 | false 145 | false 146 | false 147 | false 148 | true 149 | 0.01 150 | 10 151 | true 152 | 1 153 | 25 154 | 155 | 1 156 | true 157 | false 158 | true 159 | valgrind 160 | 161 | 0 162 | 1 163 | 2 164 | 3 165 | 4 166 | 5 167 | 6 168 | 7 169 | 8 170 | 9 171 | 10 172 | 11 173 | 12 174 | 13 175 | 14 176 | 177 | 2 178 | 179 | Animation 180 | 181 | Qt4ProjectManager.Qt4RunConfiguration:C:/Qt_Work/traditionalDevelopment/Animation.pro 182 | true 183 | 184 | Animation.pro 185 | false 186 | 187 | C:/Qt_Work/traditionalDevelopment 188 | 3768 189 | false 190 | true 191 | false 192 | false 193 | true 194 | 195 | 1 196 | 197 | 198 | 199 | ProjectExplorer.Project.TargetCount 200 | 1 201 | 202 | 203 | ProjectExplorer.Project.Updater.FileVersion 204 | 18 205 | 206 | 207 | Version 208 | 18 209 | 210 | 211 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # traditionalDevelopment 2 | 传统Qt C++开发应用程序(插件化框架搭建、酷炫的动画窗口、图表控件、多屏自适应、 3 | 权限控制、VNC远程监控集成、WebEngine与Qt交互、按键声效、QDoc程序注释说明) 4 | -------------------------------------------------------------------------------- /chart/realtimecurveqchartwidget.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxzjh/traditionalDevelopment/25d35ed45c656ca8f5795490fa2bf2f65e618e93/chart/realtimecurveqchartwidget.cpp -------------------------------------------------------------------------------- /chart/realtimecurveqchartwidget.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxzjh/traditionalDevelopment/25d35ed45c656ca8f5795490fa2bf2f65e618e93/chart/realtimecurveqchartwidget.h -------------------------------------------------------------------------------- /chart/themewidget.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt Charts module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 or (at your option) any later version 20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by 21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 22 | ** included in the packaging of this file. Please review the following 23 | ** information to ensure the GNU General Public License requirements will 24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 25 | ** 26 | ** $QT_END_LICENSE$ 27 | ** 28 | ****************************************************************************/ 29 | 30 | #include "themewidget.h" 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | 55 | ThemeWidget::ThemeWidget(QWidget *parent) : 56 | QWidget(parent), 57 | m_listCount(4), 58 | m_valueMax(10), 59 | m_valueCount(7), 60 | m_dataTable(generateRandomData(m_listCount, m_valueMax, m_valueCount)), 61 | m_themeComboBox(createThemeBox()), 62 | m_antialiasCheckBox(new QCheckBox("Anti-aliasing")), 63 | m_animatedComboBox(createAnimationBox()), 64 | m_legendComboBox(createLegendBox()) 65 | { 66 | connectSignals(); 67 | // create layout 68 | QGridLayout *baseLayout = new QGridLayout(); 69 | QHBoxLayout *settingsLayout = new QHBoxLayout(); 70 | settingsLayout->addWidget(new QLabel("Theme:")); 71 | settingsLayout->addWidget(m_themeComboBox); 72 | settingsLayout->addWidget(new QLabel("Animation:")); 73 | settingsLayout->addWidget(m_animatedComboBox); 74 | settingsLayout->addWidget(new QLabel("Legend:")); 75 | settingsLayout->addWidget(m_legendComboBox); 76 | settingsLayout->addWidget(m_antialiasCheckBox); 77 | settingsLayout->addStretch(); 78 | baseLayout->addLayout(settingsLayout, 0, 0, 1, 3); 79 | 80 | //create charts 81 | 82 | QChartView *chartView; 83 | 84 | chartView = new QChartView(createAreaChart()); 85 | baseLayout->addWidget(chartView, 1, 0); 86 | m_charts << chartView; 87 | 88 | chartView = new QChartView(createBarChart(m_valueCount)); 89 | baseLayout->addWidget(chartView, 1, 1); 90 | m_charts << chartView; 91 | 92 | chartView = new QChartView(createLineChart()); 93 | baseLayout->addWidget(chartView, 1, 2); 94 | m_charts << chartView; 95 | 96 | chartView = new QChartView(createPieChart()); 97 | // Funny things happen if the pie slice labels do not fit the screen, so we ignore size policy 98 | chartView->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); 99 | baseLayout->addWidget(chartView, 2, 0); 100 | m_charts << chartView; 101 | 102 | chartView = new QChartView(createSplineChart()); 103 | baseLayout->addWidget(chartView, 2, 1); 104 | m_charts << chartView; 105 | 106 | chartView = new QChartView(createScatterChart()); 107 | baseLayout->addWidget(chartView, 2, 2); 108 | m_charts << chartView; 109 | 110 | setLayout(baseLayout); 111 | 112 | // Set defaults 113 | m_antialiasCheckBox->setChecked(true); 114 | updateUI(); 115 | } 116 | 117 | ThemeWidget::~ThemeWidget() 118 | { 119 | } 120 | 121 | void ThemeWidget::connectSignals() 122 | { 123 | connect(m_themeComboBox, 124 | static_cast(&QComboBox::currentIndexChanged), 125 | this, &ThemeWidget::updateUI); 126 | connect(m_antialiasCheckBox, &QCheckBox::toggled, this, &ThemeWidget::updateUI); 127 | connect(m_animatedComboBox, 128 | static_cast(&QComboBox::currentIndexChanged), 129 | this, &ThemeWidget::updateUI); 130 | connect(m_legendComboBox, 131 | static_cast(&QComboBox::currentIndexChanged), 132 | this, &ThemeWidget::updateUI); 133 | } 134 | 135 | DataTable ThemeWidget::generateRandomData(int listCount, int valueMax, int valueCount) const 136 | { 137 | DataTable dataTable; 138 | 139 | // set seed for random stuff 140 | qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime())); 141 | 142 | // generate random data 143 | for (int i(0); i < listCount; i++) { 144 | DataList dataList; 145 | qreal yValue(0); 146 | for (int j(0); j < valueCount; j++) { 147 | yValue = yValue + (qreal)(qrand() % valueMax) / (qreal) valueCount; 148 | QPointF value((j + (qreal) rand() / (qreal) RAND_MAX) * ((qreal) m_valueMax / (qreal) valueCount), 149 | yValue); 150 | QString label = "Slice " + QString::number(i) + ":" + QString::number(j); 151 | dataList << Data(value, label); 152 | } 153 | dataTable << dataList; 154 | } 155 | 156 | return dataTable; 157 | } 158 | 159 | QComboBox *ThemeWidget::createThemeBox() const 160 | { 161 | // settings layout 162 | QComboBox *themeComboBox = new QComboBox(); 163 | themeComboBox->addItem("Light", QChart::ChartThemeLight); 164 | themeComboBox->addItem("Blue Cerulean", QChart::ChartThemeBlueCerulean); 165 | themeComboBox->addItem("Dark", QChart::ChartThemeDark); 166 | themeComboBox->addItem("Brown Sand", QChart::ChartThemeBrownSand); 167 | themeComboBox->addItem("Blue NCS", QChart::ChartThemeBlueNcs); 168 | themeComboBox->addItem("High Contrast", QChart::ChartThemeHighContrast); 169 | themeComboBox->addItem("Blue Icy", QChart::ChartThemeBlueIcy); 170 | themeComboBox->addItem("Qt", QChart::ChartThemeQt); 171 | return themeComboBox; 172 | } 173 | 174 | QComboBox *ThemeWidget::createAnimationBox() const 175 | { 176 | // settings layout 177 | QComboBox *animationComboBox = new QComboBox(); 178 | animationComboBox->addItem("No Animations", QChart::NoAnimation); 179 | animationComboBox->addItem("GridAxis Animations", QChart::GridAxisAnimations); 180 | animationComboBox->addItem("Series Animations", QChart::SeriesAnimations); 181 | animationComboBox->addItem("All Animations", QChart::AllAnimations); 182 | return animationComboBox; 183 | } 184 | 185 | QComboBox *ThemeWidget::createLegendBox() const 186 | { 187 | QComboBox *legendComboBox = new QComboBox(); 188 | legendComboBox->addItem("No Legend ", 0); 189 | legendComboBox->addItem("Legend Top", Qt::AlignTop); 190 | legendComboBox->addItem("Legend Bottom", Qt::AlignBottom); 191 | legendComboBox->addItem("Legend Left", Qt::AlignLeft); 192 | legendComboBox->addItem("Legend Right", Qt::AlignRight); 193 | return legendComboBox; 194 | } 195 | 196 | QChart *ThemeWidget::createAreaChart() const 197 | { 198 | QChart *chart = new QChart(); 199 | chart->setTitle("Area chart"); 200 | 201 | // The lower series initialized to zero values 202 | QLineSeries *lowerSeries = 0; 203 | QString name("Series "); 204 | int nameIndex = 0; 205 | for (int i(0); i < m_dataTable.count(); i++) { 206 | QLineSeries *upperSeries = new QLineSeries(chart); 207 | for (int j(0); j < m_dataTable[i].count(); j++) { 208 | Data data = m_dataTable[i].at(j); 209 | if (lowerSeries) { 210 | const QVector& points = lowerSeries->pointsVector(); 211 | upperSeries->append(QPointF(j, points[i].y() + data.first.y())); 212 | } else { 213 | upperSeries->append(QPointF(j, data.first.y())); 214 | } 215 | } 216 | QAreaSeries *area = new QAreaSeries(upperSeries, lowerSeries); 217 | area->setName(name + QString::number(nameIndex)); 218 | nameIndex++; 219 | chart->addSeries(area); 220 | chart->createDefaultAxes(); 221 | lowerSeries = upperSeries; 222 | } 223 | 224 | return chart; 225 | } 226 | 227 | QChart *ThemeWidget::createBarChart(int valueCount) const 228 | { 229 | Q_UNUSED(valueCount); 230 | QChart *chart = new QChart(); 231 | chart->setTitle("Bar chart"); 232 | 233 | QStackedBarSeries *series = new QStackedBarSeries(chart); 234 | for (int i(0); i < m_dataTable.count(); i++) { 235 | QBarSet *set = new QBarSet("Bar set " + QString::number(i)); 236 | for (const Data &data : m_dataTable[i]) 237 | *set << data.first.y(); 238 | series->append(set); 239 | } 240 | chart->addSeries(series); 241 | chart->createDefaultAxes(); 242 | 243 | return chart; 244 | } 245 | 246 | QChart *ThemeWidget::createLineChart() const 247 | { 248 | QChart *chart = new QChart(); 249 | chart->setTitle("Line chart"); 250 | 251 | QString name("Series "); 252 | int nameIndex = 0; 253 | for (const DataList &list : m_dataTable) { 254 | QLineSeries *series = new QLineSeries(chart); 255 | for (const Data &data : list) 256 | series->append(data.first); 257 | series->setName(name + QString::number(nameIndex)); 258 | nameIndex++; 259 | chart->addSeries(series); 260 | } 261 | chart->createDefaultAxes(); 262 | 263 | return chart; 264 | } 265 | 266 | QChart *ThemeWidget::createPieChart() const 267 | { 268 | QChart *chart = new QChart(); 269 | chart->setTitle("Pie chart"); 270 | 271 | qreal pieSize = 1.0 / m_dataTable.count(); 272 | for (int i = 0; i < m_dataTable.count(); i++) { 273 | QPieSeries *series = new QPieSeries(chart); 274 | for (const Data &data : m_dataTable[i]) { 275 | QPieSlice *slice = series->append(data.second, data.first.y()); 276 | if (data == m_dataTable[i].first()) { 277 | slice->setLabelVisible(); 278 | slice->setExploded(); 279 | } 280 | } 281 | qreal hPos = (pieSize / 2) + (i / (qreal) m_dataTable.count()); 282 | series->setPieSize(pieSize); 283 | series->setHorizontalPosition(hPos); 284 | series->setVerticalPosition(0.5); 285 | chart->addSeries(series); 286 | } 287 | 288 | return chart; 289 | } 290 | 291 | QChart *ThemeWidget::createSplineChart() const 292 | { 293 | // spine chart 294 | QChart *chart = new QChart(); 295 | chart->setTitle("Spline chart"); 296 | QString name("Series "); 297 | int nameIndex = 0; 298 | for (const DataList &list : m_dataTable) { 299 | QSplineSeries *series = new QSplineSeries(chart); 300 | for (const Data &data : list) 301 | series->append(data.first); 302 | series->setName(name + QString::number(nameIndex)); 303 | nameIndex++; 304 | chart->addSeries(series); 305 | } 306 | chart->createDefaultAxes(); 307 | return chart; 308 | } 309 | 310 | QChart *ThemeWidget::createScatterChart() const 311 | { 312 | // scatter chart 313 | QChart *chart = new QChart(); 314 | chart->setTitle("Scatter chart"); 315 | QString name("Series "); 316 | int nameIndex = 0; 317 | for (const DataList &list : m_dataTable) { 318 | QScatterSeries *series = new QScatterSeries(chart); 319 | for (const Data &data : list) 320 | series->append(data.first); 321 | series->setName(name + QString::number(nameIndex)); 322 | nameIndex++; 323 | chart->addSeries(series); 324 | } 325 | chart->createDefaultAxes(); 326 | return chart; 327 | } 328 | 329 | void ThemeWidget::updateUI() 330 | { 331 | QChart::ChartTheme theme = static_cast( 332 | m_themeComboBox->itemData(m_themeComboBox->currentIndex()).toInt()); 333 | 334 | const auto charts = m_charts; 335 | if (m_charts.at(0)->chart()->theme() != theme) { 336 | for (QChartView *chartView : charts) 337 | chartView->chart()->setTheme(theme); 338 | 339 | QPalette pal = window()->palette(); 340 | if (theme == QChart::ChartThemeLight) { 341 | pal.setColor(QPalette::Window, QRgb(0xf0f0f0)); 342 | pal.setColor(QPalette::WindowText, QRgb(0x404044)); 343 | } else if (theme == QChart::ChartThemeDark) { 344 | pal.setColor(QPalette::Window, QRgb(0x121218)); 345 | pal.setColor(QPalette::WindowText, QRgb(0xd6d6d6)); 346 | } else if (theme == QChart::ChartThemeBlueCerulean) { 347 | pal.setColor(QPalette::Window, QRgb(0x40434a)); 348 | pal.setColor(QPalette::WindowText, QRgb(0xd6d6d6)); 349 | } else if (theme == QChart::ChartThemeBrownSand) { 350 | pal.setColor(QPalette::Window, QRgb(0x9e8965)); 351 | pal.setColor(QPalette::WindowText, QRgb(0x404044)); 352 | } else if (theme == QChart::ChartThemeBlueNcs) { 353 | pal.setColor(QPalette::Window, QRgb(0x018bba)); 354 | pal.setColor(QPalette::WindowText, QRgb(0x404044)); 355 | } else if (theme == QChart::ChartThemeHighContrast) { 356 | pal.setColor(QPalette::Window, QRgb(0xffab03)); 357 | pal.setColor(QPalette::WindowText, QRgb(0x181818)); 358 | } else if (theme == QChart::ChartThemeBlueIcy) { 359 | pal.setColor(QPalette::Window, QRgb(0xcee7f0)); 360 | pal.setColor(QPalette::WindowText, QRgb(0x404044)); 361 | } else { 362 | pal.setColor(QPalette::Window, QRgb(0xf0f0f0)); 363 | pal.setColor(QPalette::WindowText, QRgb(0x404044)); 364 | } 365 | window()->setPalette(pal); 366 | } 367 | 368 | bool checked = m_antialiasCheckBox->isChecked(); 369 | for (QChartView *chart : charts) 370 | chart->setRenderHint(QPainter::Antialiasing, checked); 371 | 372 | QChart::AnimationOptions options( 373 | m_animatedComboBox->itemData(m_animatedComboBox->currentIndex()).toInt()); 374 | if (m_charts.at(0)->chart()->animationOptions() != options) { 375 | for (QChartView *chartView : charts) 376 | chartView->chart()->setAnimationOptions(options); 377 | } 378 | 379 | Qt::Alignment alignment(m_legendComboBox->itemData(m_legendComboBox->currentIndex()).toInt()); 380 | 381 | if (!alignment) { 382 | for (QChartView *chartView : charts) 383 | chartView->chart()->legend()->hide(); 384 | } else { 385 | for (QChartView *chartView : charts) { 386 | chartView->chart()->legend()->setAlignment(alignment); 387 | chartView->chart()->legend()->show(); 388 | } 389 | } 390 | } 391 | 392 | -------------------------------------------------------------------------------- /chart/themewidget.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** 3 | ** Copyright (C) 2016 The Qt Company Ltd. 4 | ** Contact: https://www.qt.io/licensing/ 5 | ** 6 | ** This file is part of the Qt Charts module of the Qt Toolkit. 7 | ** 8 | ** $QT_BEGIN_LICENSE:GPL$ 9 | ** Commercial License Usage 10 | ** Licensees holding valid commercial Qt licenses may use this file in 11 | ** accordance with the commercial license agreement provided with the 12 | ** Software or, alternatively, in accordance with the terms contained in 13 | ** a written agreement between you and The Qt Company. For licensing terms 14 | ** and conditions see https://www.qt.io/terms-conditions. For further 15 | ** information use the contact form at https://www.qt.io/contact-us. 16 | ** 17 | ** GNU General Public License Usage 18 | ** Alternatively, this file may be used under the terms of the GNU 19 | ** General Public License version 3 or (at your option) any later version 20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by 21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 22 | ** included in the packaging of this file. Please review the following 23 | ** information to ensure the GNU General Public License requirements will 24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. 25 | ** 26 | ** $QT_END_LICENSE$ 27 | ** 28 | ****************************************************************************/ 29 | 30 | #ifndef THEMEWIDGET_H 31 | #define THEMEWIDGET_H 32 | 33 | #include 34 | #include 35 | 36 | QT_BEGIN_NAMESPACE 37 | class QComboBox; 38 | class QCheckBox; 39 | QT_END_NAMESPACE 40 | 41 | QT_CHARTS_BEGIN_NAMESPACE 42 | class QChartView; 43 | class QChart; 44 | QT_CHARTS_END_NAMESPACE 45 | 46 | typedef QPair Data; 47 | typedef QList DataList; 48 | typedef QList DataTable; 49 | 50 | QT_CHARTS_USE_NAMESPACE 51 | 52 | class ThemeWidget: public QWidget 53 | { 54 | Q_OBJECT 55 | public: 56 | explicit ThemeWidget(QWidget *parent = 0); 57 | ~ThemeWidget(); 58 | 59 | private Q_SLOTS: 60 | void updateUI(); 61 | 62 | private: 63 | DataTable generateRandomData(int listCount, int valueMax, int valueCount) const; 64 | QComboBox *createThemeBox() const; 65 | QComboBox *createAnimationBox() const; 66 | QComboBox *createLegendBox() const; 67 | void connectSignals(); 68 | QChart *createAreaChart() const; 69 | QChart *createBarChart(int valueCount) const; 70 | QChart *createPieChart() const; 71 | QChart *createLineChart() const; 72 | QChart *createSplineChart() const; 73 | QChart *createScatterChart() const; 74 | 75 | private: 76 | int m_listCount; 77 | int m_valueMax; 78 | int m_valueCount; 79 | QList m_charts; 80 | DataTable m_dataTable; 81 | 82 | QComboBox *m_themeComboBox; 83 | QCheckBox *m_antialiasCheckBox; 84 | QComboBox *m_animatedComboBox; 85 | QComboBox *m_legendComboBox; 86 | }; 87 | 88 | #endif /* THEMEWIDGET_H */ 89 | -------------------------------------------------------------------------------- /doc/@美术入门基础教程.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxzjh/traditionalDevelopment/25d35ed45c656ca8f5795490fa2bf2f65e618e93/doc/@美术入门基础教程.pdf -------------------------------------------------------------------------------- /doc/CTK插件框架介绍.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxzjh/traditionalDevelopment/25d35ed45c656ca8f5795490fa2bf2f65e618e93/doc/CTK插件框架介绍.docx -------------------------------------------------------------------------------- /doc/QmlBook-In-Chinese.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxzjh/traditionalDevelopment/25d35ed45c656ca8f5795490fa2bf2f65e618e93/doc/QmlBook-In-Chinese.pdf -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | #include "widget.h" 2 | #include "chart/themewidget.h" 3 | #include "chart/realtimecurveqchartwidget.h" 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | int main(int argc, char *argv[]) 10 | { 11 | QApplication a(argc, argv); 12 | #if 0 13 | QMainWindow window; 14 | ThemeWidget *widget = new ThemeWidget(); 15 | window.setCentralWidget(widget); 16 | window.resize(900, 600); 17 | window.show(); 18 | #endif 19 | 20 | #if 0 21 | Widget w; 22 | w.show(); 23 | #endif 24 | 25 | #if 1 26 | RealTimeCurveQChartWidget w; 27 | w.resize(700, 600); 28 | w.show(); 29 | #endif 30 | return a.exec(); 31 | } 32 | -------------------------------------------------------------------------------- /plugins/plugin.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxzjh/traditionalDevelopment/25d35ed45c656ca8f5795490fa2bf2f65e618e93/plugins/plugin.h -------------------------------------------------------------------------------- /plugins/plugin_manager.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxzjh/traditionalDevelopment/25d35ed45c656ca8f5795490fa2bf2f65e618e93/plugins/plugin_manager.cpp -------------------------------------------------------------------------------- /plugins/plugin_manager.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxzjh/traditionalDevelopment/25d35ed45c656ca8f5795490fa2bf2f65e618e93/plugins/plugin_manager.h -------------------------------------------------------------------------------- /plugins/pluginmanagerprivate.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxzjh/traditionalDevelopment/25d35ed45c656ca8f5795490fa2bf2f65e618e93/plugins/pluginmanagerprivate.cpp -------------------------------------------------------------------------------- /plugins/pluginmanagerprivate.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxzjh/traditionalDevelopment/25d35ed45c656ca8f5795490fa2bf2f65e618e93/plugins/pluginmanagerprivate.h -------------------------------------------------------------------------------- /widget.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxzjh/traditionalDevelopment/25d35ed45c656ca8f5795490fa2bf2f65e618e93/widget.cpp -------------------------------------------------------------------------------- /widget.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxzjh/traditionalDevelopment/25d35ed45c656ca8f5795490fa2bf2f65e618e93/widget.h -------------------------------------------------------------------------------- /曾家豪--FH项目预研报告.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linuxzjh/traditionalDevelopment/25d35ed45c656ca8f5795490fa2bf2f65e618e93/曾家豪--FH项目预研报告.pptx --------------------------------------------------------------------------------