qml(Qt Quick)做界面
qml(Qt Quick)做界面
来源 https://www.zhihu.com/question/24880681/answer/29324824
不知道能否用qml(Qt Quick)做界面,用C++(Qt)实现业务逻辑?如果可以,大概的思路是怎么样?
-----------------------------
题主你好,你说的这种思路是目前Digia主推的一种思路。(今年去参加Qt开发者大会的时候,几乎一半的讲座都会推荐这种用法。)
所以,如何结合QML和C++,官网上会有很多的例子和教程,希望你仔细看看。(另外,鉴于4.8时代的Qt Quick的问题(bug)还不少,所以建议使用最新版的Qt5.3+来做这样的试验。)
这是我随手找到的:Introduction_to_Qt_Quick_for_Cpp_developers
Writing QML Extensions with C++
一个更详尽的例子:
Qt Quick 之 QML 与 C++ 混合编程详解
还有这个制作五子棋小游戏的教程,非常有意思。:http://quitcoding.com/download/Qt_Quick_Game_Programming_1_0.pdf
用的Qt Quick版本较老,但思路可以借鉴。
不谢。
-----------------------------
关于QML和C++的集成,参考文档:http://doc.qt.io/qt-5/qtqml-cppintegration-topic.html
QtQuickControls以及QtQuickControls2的最新进展,
QtCS2015 QtQuickControls2
Background
QtQuick.Controls 1 has tons and tons of objects per control
Overview
QtQuick.Controls 2 has interaction logic in C++, greatly decreases object overhead and number of contexts
QtQuick.Controls 2 has visual items still in a (thin) QML layer
Styling, theming and customization
Native/platform styles currently out of scope
Would be in a separate (derived) imports?
Currently QtQuick.Controls 2 has a simple themable QML layer
Ongoing work adapting the palette concept from widgets (QTBUG-45839)
Parts of controls can be replaced with custom delegates
Status
Popup items vs. popup windows
Text selection handles via IM
No scaling (logical units?) thought of yet
Discussion
Accessibility in the QML layer? Needed as it's private from QtQuick
Some embedded users don't want accessibility. Seems "Short-sighted".
Continue with controls 1 until native/desktop gets brought into the controls 2 idea
As in done and maintained, but R&D on controls 2
大家可以参考:
=============== End
最新文章
- Using Recursive Common table expressions to represent Tree structures
- [翻译]opengl扩展教程1
- 通过 Informix 系统表监控和优化数据库
- L1 - 闭包和原型链
- C#使用FtpWebRequest上传文件
- 创业草堂之一:创业的Idea是怎样产生的?
- Kerberos认证流程详解
- sql server 2005 外围应用配置器
- JAVA学习篇--JSTL基金会
- Eclipse Maven构建Spring MVC项目
- (二)—Linux远程连接与常用命令
- Hadoop问题:Incorrect configuration: namenode address dfs.namenode.rpc-address is not configured
- CDQ 分治算法模板
- JNDI是什么
- 云主机中毒 cpu爆满解决日志
- Marriage Match IV HDU - 3416(最短路 + 最大流)
- delphi 导出到excel的7种方法
- linux 编译链接问题
- Android-Binder机制
- Promise 初步