C++ GUI Programming with Qt3(系列四 试翻)

来源:互联网 发布:ajax跨域 java 编辑:程序博客网 时间:2024/05/17 17:59

 Line 20 sets the spin box value to 35. When this happens, the QSpinBox emits the valueChanged(int) signal with an int argument of 35. This argument is passed to the QSlider’s setValue(int) slot,which sets the slider value to 35.The slider then emits the valueChanged(int) signal, because its own value changed, triggering the spin box’s setValue(int) slot. But at this point, setValue(int) doesn’t emit any signal, since the spin box value is already 35. This prevents infinite recursion. Figure 1.6 summarizes the situation.

第20行把spin box 的值设为35,接着QSpinBox 对象就发出了一个valueChanged(int)的消息,该消息带的值为35。这个参数将传递到QSlider的setValue(int)这个消息槽中(slot),他把slider对象的值设置为35。然后Slider对象也发出一个valueChanged(int)消息


Line 22 shows the QHBox and its two child widgets. Qt’s approach to building user interfaces is simple to understand and very flexible. The most common pattern that Qt programmers use is toinstantiate the required widgetsand then set their propertiesas necessary. Programmers add the widgets to layouts, which automatically take care of sizing and positioning.User interface behavior is managed by connecting widgets together using Qt’ssignals and slots mechanism.

 

第22行显示QHBox和他的两个子窗体控件。Qt的趋向于建立易于理解而且灵活的用户界面。Qt程序员的最通常的工作模式就是实例化一些控件,然后设置他的必要的属性。把控件加入到layouts(用于自动管理控件的大小和位置)上。用Qt的消息和消息槽机制来管理界面行为。
Using the Reference Documentation
Using the Reference Documentation
 Qt's reference documentation is an essential tool for any Qt developer,since it covers every class and function in Qt.(Qt 3.2 include over 400 public classes and over 6000 functions.) This book makes use of many Qt classes and functions,but it doesn't mention them all, nor does it provide all the details of those it does mention. To get the most benefit from Qt, you should familiarize yourself with the Qt reference documentation.

The documentation is available in HTML format in Qt’s doc/html directory and can be read using any web browser. You can also use Qt Assistant,the Qt help browser, whose powerful search and indexing features make it quicker and easier to use than a web browser. To launch Qt Assistant, click Qt 3.2.x|Qt Assistant in the Start menu on Windows, type assistant on the command line on Unix, or double-click assistant in the Mac OS X Finder.

 

使用参考文档
 Qt 的参考文档是每个Qt程序员的基本工具。因为她覆盖了Qt中所有的类和所有的方法(Qt 3.2 中有400多个类和6000多个方法)。本书使用了很多Qt的类和方法,但是并没有提及他们中的所有。就是提到的类和方法中也没有能够提供所有细节。所以要想在Qt中获得最大的利益,你就的去熟悉Qt的参考文档。

 

在Qt的doc/html目录下你可以找到Qt参考文档的Html版,你可以使用任何浏览器阅读。你也可以使用Qt Assistant,Qt自己的帮助浏览器。他又强大的搜索和索引功能,你可以通过点击windows的开始菜单 Qt/3.2.X/Qt assistant(译:可以直接点击assistant.exe程序来启动) 来打开Qt Assisant。 在unix系统在命令行中敲入assistant。在Mac OSX 双击assistant。

原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 婴儿拉大便次数多怎么办 公鸽子不会踩蛋怎么办 生殖器套东西取不下来怎么办 婴儿成蛋蛋的皮好长怎么办 丈夫总要害自己该怎么办 脚背踢肿了怎么办很疼 踢沙袋脚背伤了怎么办 脚y子烂了怎么办 掐喉咙那会痒会咳嗽怎么办 掐到婴儿脖子了怎么办 孩子胳膊不小心烫破皮了怎么办 孩子嘴角磕破了怎么办 电话不小心拒接了怎么办 手机微信不小心碰到语言英文怎么办 手机微信不小心碰到英文说话怎么办 不小心碰到宝宝卤门怎么办 不小心碰到婴儿头顶囟门怎么办 重要部位被踢了怎么办 吃了带刺的葡萄怎么办 小孩子老是去厕所大便怎么办 家人偷了我的钱怎么办 小孩打闹踢到要害怎么办 腿上汗毛孔没开都是点点怎么办 脸蛋澡巾擦破了怎么办 婴儿后背用擦澡巾擦红了怎么办 搓澡皮肤搓破了怎么办 搓背搓的脖子红痒怎么办 上班迟到1个小时怎么办 想家想的都哭怎么办 想学手艺被骗学费怎么办 小腿肚后面筋和肌肉压痛怎么办 尿道囗和屁股眼中间长疮怎么办? 2个多月的宝宝蛋蛋上有个包怎么办 幼儿园睡觉自己摸下身玩怎么办 猫猫打喷嚏有透明液体怎么办 夏季穿运动鞋出了脚气怎么办 脚底长了刺瘊子怎么办 凉鞋前面踢破了怎么办 尖头鞋前面折了怎么办 月子里宝宝蛋蛋破皮怎么办 军人在训练时想上侧所怎么办