kaon的个人主页

http://www.qtcn.org/bbs/u/107506  [收藏] [复制]

kaon

  • 6

    关注

  • 20

    粉丝

  • 28

    访客

  • 等级:侠客
  • 总积分:267
  • 保密,2010-11-08

最后登录:2024-04-25

更多资料

日志

2014-05-30 10:41

Text {
id: label
x: 24; y: 24
// custom counter property for space presses
property int spacePresses: 0
text: "Space pressed: " + spacePresses + " times"
// (1) handler for text changes
onTextChanged: console.log("text changed to:", text)
// need focus to receive key events
focus: true
// (2) handler with some JS
Keys.onSpacePressed: {
increment()
}
// clear the text on escape
Keys.onEscapePressed: {
label.text = ''
}
// (3) a JS function
..

阅读全文»分类:默认分类|回复:1|浏览:1465
2013-03-21 14:37

随手一翻,翻到一篇简易教程,用于安全使用QFlags


http://qt-project.org/wiki/QFlags_tutorial

Simple tutorial for safe-usage QFlags



Overview


First of all we should write about macro Q_FLAGSThis macro registers one or several flags types to the meta-object system

Example:




class TestClass
{
public:
enum Option {
OptionA = 0x0, // 0x000000
OptionB = 0x1, // 0x000001
OptionC = 0x2, // 0x000010
OptionD = 0x4, // 0x000100
OptionE = 0x8, // 0x001000
OptionF = 0x16 // 0x010000
..

阅读全文»分类:默认分类|回复:0|浏览:2858

Powered by phpwind v8.7 Certificate Copyright Time now is:04-26 01:17
©2005-2016 QTCN开发网 版权所有 Gzip disabled