- 欢迎加入群上海Qt开发联盟(279906625) QT&C++编程爱好者(271251545)
- 欢迎访问百度Qt吧 qtdream.com
Qt 官方博客于2016年1月18日发表了一篇博客, 就是Qt官方表格开源组件
今天试了试,表格的颜值还不错。
有些小伙伴一定激动了,,咳咳。。别急。这篇是小白教程,专门是给像本人一样的小白手把手安装Qt Chart的。
好的废话不多说,现在开始。
qtchart 里的README文件(注意红色标记处)(本人翻译不行。多多见谅,也可以在评论里纠正( ⊙ o ⊙ ))
Qt Charts 5.7.0
Qt Charts module provides a set of easy to use chart components. It
uses the Qt Graphics View Framework, therefore charts can be easily
integrated to modern user interfaces.System Requirements
- Qt 5.4 or newer(Qt5.4或者更高的版本)
- For QML applications QtQuick 2 is required(对于QML程序,QtQuick2是必须的)
- Manipulating Qt Charts graphs with QML Designer requires Qt Creator 3.3 or newer(Qt Creator 3.3 或者更高的版本)
Building
Configure the project with qmake:
qmakeAfter running qmake, build the project with make:
(Linux) make
(Windows with MinGw) mingw32-make
(Windows with Visual Studio) nmake
(OS X) makeThe above generates the default makefiles for your configuration,
which is typically the release build if you are using precompiled
binary Qt distribution. To build both debug and release, or one
specifically, use one of the following qmake lines instead.For debug builds:
qmake CONFIG+=debug
make or
qmake CONFIG+=debug_and_release
make debugFor release builds:
qmake CONFIG+=release
make or
qmake CONFIG+=debug_and_release
make releaseFor both builds (Windows/OS X only):
qmake CONFIG+=”debug_and_release build_all”
makeAfter building, install the module to your Qt directory:
make installIf you want to uninstall the module:
make uninstallBuilding as a statically linked library
The same as above applies, you will just have to add static to the
CONFIG:
qmake CONFIG+=staticDocumentation
The documentation can be generated with:
make docsThe documentation is generated into the doc folder under the build
folder. Both Qt Assistant (qtcharts.qch) and in HTML format (qtcharts
subfolder) documentation is generated.Please refer to the generated documentation for more information:
doc/qtcharts/index.htmlKnown issues
- Zooming too far or too close may eventually freeze the zooming and scrolling.
首先我们需要一份Qt Chart 5.7.0源码(源码于 上海Qt开发联盟 或 QT&C++编程爱好者 群共享中可见)
下载解压后,我们轻松的看到这样一个画面:
然后呢,我们双击qtchart.pro文件,进入Qt Creator
很简单,点击运行按钮,选择release,然后进行编译:
编译结束,我们能看到:
点击开始菜单→ Qt 5.5.1(你的Qt版本)→ 5.5→ MinGW 4.9.2 (32-bit)(你的MinGW版本)→ Qt 5.5 for Desktop (MinGW 4.9.2 32 bit)
输入 cd /d 你的qtcharts编译好的文件路径
回车
mingw32-make install
回车
然后就是下面一大串的信息。。。
(此步骤选看)
待复制文件完毕后,打开qtcharts源文件下的example文件夹里的.pro文件,点击编译。
然后你就可以看到如第二幅图qtcharts的样子了。