亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? designer-manual-4.html

?? QT 下載資料僅供參考
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
<p>Qt 3.0 introduces a brand new database module, the Qt SQL module. <em>Qt Designer</em> is fully integrated with the SQL module and can show live data from the databases that you connect to.</p><p>When you've opened or created a project you can set up its database connections using the <em>Edit Database Connections</em> dialog (invoked by the <b>Project|Database Connections</b> menu option). The connections you make are stored in a <tt>.db</tt> file. When you reload a project you can reconnect by going to the <em>Edit Database Connections</em> dialog, clicking a connection in the list and clicking the <b>Connect</b> button.</p><p>In most non-trivial database applications you will want to access the database from more than one form. This is why the <tt>.db</tt> file is part of a project, not just part of a single form.</p><h4><a name="2-4"></a>.pro files</h4><p><em>Qt Designer</em> needs to store information on projects, for example, the list of forms, the image collection and information about available databases and how to access them. The majority of Qt users already use a project file format to create multiplatform makefiles: <tt>tmake</tt> (and with Qt 3.0 <tt>qmake</tt>) project <tt>.pro</tt> files. These files already contain the list of forms, <tt>.ui</tt> files, used in the project for <tt>uic</tt>.</p><p>We've extended the sections in the <tt>.pro</tt> file to include the extra information that <em>Qt Designer</em> needs to manage projects. For example, when you add a form to your project in <em>Qt Designer</em>, it is automatically added to the FORMS section of the project file, and thus <tt>qmake</tt> will generate the required build rules without any further work. Similarly, the images are added to the IMAGES section and thus gets automatically compiled into your executable.</p><p>We don't force you to use <tt>qmake</tt>; if you prefer another build system, for example automake/autoconf or jam, you can still continue to use it. Look upon the <tt>.pro</tt> file as a file that describes the GUI part of your application. All you need to do -- as previously -- is add the <tt>.ui</tt> files and the images collection to your own Makefiles.</p><h3><a name="3"></a>Extending the functionality of a form</h3><p>First let us look at a small figure that shows the relationship between <tt>.ui</tt> files, generated code and application code:</p><p align="center"><img align="middle" src="designer1.jpg"></p><p><em>Qt Designer</em> reads and writes <tt>.ui</tt> files, e.g. <tt>form.ui</tt>. The user interface compiler, <tt>uic</tt>, creates both a header file, e.g. <tt>form.h</tt>, and an implementation file, e.g. <tt>form.cpp</tt>, from the <tt>.ui</tt> file. The application code in <tt>main.cpp</tt> <tt>#include</tt>s <tt>form.h</tt>. Typically <tt>main.cpp</tt> is used to instantiate the QApplication object and start off the event loop.</p><p>While this approach is simple, it isn't sufficient for more complex dialogs. Complex dialogs tend to have quite a lot of logic attached to the form's widgets, more logic than can usually be expressed with predefined signals and slots. One way of handling this extra logic is to write a controller class in the application code that adds functionality to the form. This is possible because <tt>uic</tt> generated classes expose a form's controls and their signals to the public space. The big disadvantage of this method is that it's not exactly Qt-style. If you were not using <em>Qt Designer</em>, you would almost always add the logic to the form itself, where it belongs.</p><p>This is why the capability of adding custom slots and member variables to a form was added to <em>Qt Designer</em> early on. The big additional benefit with this approach is that you can use <em>Qt Designer</em> to connect signals to those custom slots, in the same elegant graphical way that is used to connect signals to predefined slots. The <tt>uic</tt> then adds an empty stub for each custom slot to the generated <tt>form.cpp</tt> implementation file.</p><p>The big question now is how to add custom implementation code to those custom slots. Adding code to the generated <tt>form.cpp</tt> is not an option, as this file gets recreated by the <tt>uic</tt> whenever the form changes -- and we don't want a combination of generated and handwritten code. There are two possible solutions, which we'll cover next.</p><h4><a name="3-1"></a>The subclassing approach</h4><p>A very clean way to implement custom slots for generated forms is via C++ inheritance as shown in the next figure:</p><p align="center"><img align="middle" src="designer2.jpg"></p><p>Here the user wrote an additional class <b>FormImpl</b>, which is split into the header file <tt>formimpl.h</tt> and the implementation file <tt>formimpl.cpp</tt>. The header file includes the <tt>uic</tt> generated <tt>form.h</tt> and reimplements all the custom slots. This is possible because <tt>uic</tt> generated custom slots are virtual. In addition to implementing custom slots, this approach gives the user a way to do extra initialization work in the constructor of the subclass, and extra cleanups in the destructor.</p><p>Because of these benefits and its flexibility, this approach became the primary way of using <em>Qt Designer</em> in Qt 2.x.</p><p><b>Note:</b> To keep the namespace clean, most users did not follow the Form and FormImpl naming scheme shown in the figure, but instead named their <em>Qt Designer</em> forms FormBase and their subclasses Form. This made a lot of sense, because they always subclassed and were using those subclasses in application code.</p><h4><a name="3-2"></a>The ui.h extension approach</h4><p>Despite its flexibility and cleanness, the subclassing approach has some disadvantages:</p><ul><li><p>Subclassing is not natural and easy for everybody. Newcomers to object-oriented techniques may feel uneasy about being <em>forced</em> to subclass for such a simple and natural thing like the implementation of a custom slot.</p><li><p>Inheriting generated classes is an additional possible source of programming mistakes, especially if the number of reimplemented functions is high and the signatures change often during the design process. To make the development process smoother, <tt>uic</tt> generates empty stubs for custom slots rather than pure virtual functions. While this approach keeps the code compiling and running, programmers can find themselves in a situation where they miss a runtime warning message and lose time before they find a small spelling error in their subclass.</p><li><p>In larger projects with hundreds of forms, the additional subclasses can make a noticeable difference in terms of compilation speed and code size.</p></ul><p>There may be more disadvantages, but these were reason enough for us to investigate alternative solutions. For Qt 3.0, we came up with a new concept, the <em>ui.h extension</em>.</p><p>This is how it works:</p><p align="center"><img align="middle" src="designer3.jpg"></p><p>In addition to the <tt>.ui</tt> file, <tt>form.ui</tt>, <em>Qt Designer</em> reads and writes another associated file <tt>form.ui.h</tt>. This <tt>.ui.h</tt> file is an <em>ordinary C++ source file</em> that contains <em>implementations</em> of custom slots. The file gets included from the generated form implementation file <tt>form.cpp</tt> and thus can be totally ignored by other user code. The reason we use a <tt>.h</tt> extension for the <tt>.ui.h</tt> file even though it contains C++ code is because it is always <em>included</em>, and because it is easier to integrate into the build process with a <tt>.h</tt> extension.</p><p>The <tt>form.ui.h</tt> file has a special position among all other files. It is a <em>shared</em> source file that gets written and read by both the user and <em>Qt Designer</em>. As such it is an ordinary revision controlled source file and not generated by <tt>uic</tt>. <em>Qt Designer</em>'s responsibility is to keep the file in sync with the custom slot definitions of the associated form:</p><ol type=1><li><p>Whenever the users adds a new slots to the form, <em>Qt Designer</em> adds a stub to the <tt>.ui.h</tt> file.</p><li><p>Whenever the user changes a custom slot's signature, <em>Qt Designer</em> updates the corresponding implementation.</p><li><p>Whenever the user removes a custom slot, <em>Qt Designer</em> removes it from the <tt>.ui.h</tt> file.</p></ol><p>This way integrity is guaranteed, there is no more need for subclassing and no more danger of forgotten or misspelled slots in subclasses.</p><p>You can edit <tt>.ui.h</tt> files either directly in <em>Qt Designer</em> with the built-in C++ editor plugin, or with whatever editor you prefer. You should only put slot implementations in the <tt>.ui.h</tt> file and you should <em>always</em> add, delete or rename slots <em>within</em> <em>Qt Designer</em>. You can edit the implementations of the slots either within <em>Qt Designer</em> or using your own editor; if you use your own editor <em>Qt Designer</em> will keep your changes.</p><h5><a name="3-2-1"></a>Construction and destruction</h5><p>The <tt>ui.h</tt> extension approach has one disadvantage compared to subclassing. The <tt>ui.h</tt> file only contains custom slot implementations, but the objects are still entirely constructed and destructed inside the generated <tt>form.cpp</tt> code. This leaves the user without the possibility of doing further form initializations or cleanups that you normally would do within the constructor and destructor functions of a C++ class.</p><p>To work around this limitation, we created the init/destroy convention. If you add a slot <tt>Form::init()</tt> to your form, this slot will be called automatically at the end of the generated form constructor. Similarly, if you add a slot <tt>Form::destroy()</tt> to your form, the slot will automatically be invoked by the destructor before any form controls get deleted. (These slots should return void.) If you prefer to use your own editor you must still create these functions in <em>Qt Designer</em>; once created you can then write your implementation code either using <em>Qt Designer</em>'s C++ editor plugin or using your own editor.</p><h3><a name="4"></a>Loading forms dynamically</h3><p>We extracted the part of <em>Qt Designer</em> that is responsible for loading and previewing a form into a library of its own, <tt>libqui</tt>. A new class <b>QWidgetFactory</b> makes it possible to load <tt>.ui</tt> files at runtime and instantiate forms from them.</p><p>This dynamic approach keeps the GUI design and the code separate and is useful in environments where the GUI may have to change more often than the underlying application logic. Ultimately, you can provide users of your application the ability to modify the graphical user interface without the need for a complete C++ development environment.</p><p>Since the .ui file is not compiled it cannot include any C++ code, (e.g. custom slot implementations). We provide a way of adding those implementations via a controlling QObject subclass that you pass as receiver to the widget factory.</p><p>This concept and its usage is explained in detail in the <a href="designer-manual-5.html">Subclassing and Dynamic Dialogs</a> chapter.</p><!-- eof --><p align="right">[<a href="designer-manual-3.html">Prev: Creating Main Windows with Actions, Toolbars and Menus</a>] [<a href="designer-manual.html">Home</a>] [<a href="designer-manual-5.html">Next: Subclassing and Dynamic Dialogs</a>]</p><p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright &copy; 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人免费在线观看不卡| 国产成人av电影在线观看| 亚洲精品高清视频在线观看| 亚洲人成在线观看一区二区| 综合欧美亚洲日本| 亚洲成人免费在线| 国产精品综合久久| 色哦色哦哦色天天综合| 7777精品伊人久久久大香线蕉最新版| 欧洲精品一区二区| 精品日韩欧美一区二区| 国产精品欧美久久久久一区二区| 成人免费一区二区三区视频| 亚洲国产综合在线| 国产精品1024久久| 欧美亚洲自拍偷拍| 久久亚洲二区三区| 亚洲一线二线三线久久久| 国产精品91一区二区| 欧美亚洲禁片免费| 中文字幕制服丝袜一区二区三区| 亚洲伊人伊色伊影伊综合网| 国产91丝袜在线观看| 91麻豆精品国产91久久久资源速度| 国产片一区二区三区| 日韩av一二三| 在线视频欧美精品| 亚洲欧洲精品一区二区精品久久久| 亚洲第一激情av| 色综合久久久网| 欧美国产精品久久| 成人一级视频在线观看| 精品毛片乱码1区2区3区 | 亚洲丶国产丶欧美一区二区三区| 国产激情视频一区二区三区欧美 | 国产在线精品免费| 91麻豆精品国产自产在线| 午夜精品久久久久久久99樱桃| hitomi一区二区三区精品| 国产精品丝袜久久久久久app| 国精产品一区一区三区mba桃花| 欧美一区二区精品在线| 日本aⅴ免费视频一区二区三区| 69成人精品免费视频| 水蜜桃久久夜色精品一区的特点| 欧美日韩激情在线| 欧美aⅴ一区二区三区视频| 欧美一区二区三区视频在线观看| 日韩激情av在线| 欧美videossexotv100| 国产成人8x视频一区二区| 亚洲欧美视频在线观看视频| 91精品视频网| 菠萝蜜视频在线观看一区| 亚洲影院理伦片| 久久综合丝袜日本网| 色呦呦国产精品| 蜜臀av性久久久久蜜臀aⅴ | 在线精品视频免费播放| 免费欧美在线视频| 亚洲欧洲精品一区二区三区不卡| 欧美二区三区91| 成人av资源在线观看| 免费观看在线综合色| 1000精品久久久久久久久| 精品日韩欧美一区二区| 欧美在线不卡一区| 丰满放荡岳乱妇91ww| 久久国产福利国产秒拍| 亚洲精品视频一区二区| 国产日韩欧美不卡在线| 日韩欧美亚洲国产另类| 欧美日韩亚洲不卡| 色香色香欲天天天影视综合网| 国产在线观看免费一区| 日韩国产一二三区| 视频在线观看91| 亚洲一区二区不卡免费| 中文字幕一区二区三区不卡在线| 久久久久99精品国产片| 91麻豆精品国产91久久久久久久久 | 国产网站一区二区| 久久亚洲精品小早川怜子| 精品久久久久久无| 精品少妇一区二区三区视频免付费 | 久久精品视频一区| 久久久久88色偷偷免费| 国产精品入口麻豆原神| 国产精品高潮久久久久无| 国产精品美女一区二区在线观看| 久久久久久久久岛国免费| 中文字幕+乱码+中文字幕一区| 久久精品日产第一区二区三区高清版 | 一区二区三区四区激情| 亚洲线精品一区二区三区| 日韩激情一二三区| 国产麻豆精品久久一二三| 国产福利91精品一区| 在线视频一区二区免费| 日韩欧美国产三级电影视频| 久久久久亚洲综合| 一区二区三区欧美在线观看| 丝袜亚洲另类欧美综合| 国产主播一区二区三区| av男人天堂一区| 欧美一级一区二区| 亚洲国产综合人成综合网站| 亚洲sss视频在线视频| 国产精品77777| 欧美日韩视频在线一区二区| xfplay精品久久| 亚洲成va人在线观看| 成人蜜臀av电影| 精品欧美一区二区在线观看| 国产精品传媒视频| 国内精品久久久久影院薰衣草| 色久优优欧美色久优优| 国产三级精品视频| 九色|91porny| 精品久久五月天| 麻豆成人免费电影| 717成人午夜免费福利电影| 香港成人在线视频| 欧美性生活大片视频| 亚洲卡通动漫在线| 99久久综合狠狠综合久久| 欧美国产精品一区二区| 久草在线在线精品观看| 日韩片之四级片| 久久精品久久精品| 久久久午夜精品| 国产传媒日韩欧美成人| 国产精品久久综合| 91美女片黄在线| 亚洲电影欧美电影有声小说| 欧美日韩国产高清一区二区三区 | 国产午夜精品久久| 高清shemale亚洲人妖| 国产精品天干天干在观线| 91在线视频免费观看| 一区二区三区四区不卡视频| 欧美性三三影院| 久久精品国产99国产| 国产欧美日韩在线观看| 欧洲精品中文字幕| 麻豆91在线观看| 中文av字幕一区| 欧美精品久久久久久久多人混战| 麻豆久久久久久久| 国产精品的网站| 69成人精品免费视频| 丁香婷婷深情五月亚洲| 亚洲国产人成综合网站| 国产视频亚洲色图| 欧美日韩国产首页在线观看| 风间由美一区二区三区在线观看 | 国产亚洲精品bt天堂精选| 99精品欧美一区二区三区小说| 日本女优在线视频一区二区| 中文字幕一区二区三区视频| 日韩欧美一卡二卡| 欧美性猛交xxxxxx富婆| 成人99免费视频| 成人黄色a**站在线观看| 国产一区二区三区黄视频| 亚州成人在线电影| 亚洲男人天堂av| 中文字幕日韩精品一区| 国产精品午夜在线| 中文字幕高清不卡| 欧美激情自拍偷拍| 国产精品久久久久久久久图文区| 久久亚洲精精品中文字幕早川悠里 | 日韩一区二区影院| 欧美精品777| 欧美一区二区私人影院日本| 欧美三区在线观看| 欧美色窝79yyyycom| 欧美精品乱码久久久久久| 欧美日韩亚洲国产综合| 欧美一区二区三区思思人| 日韩一区二区三区在线观看 | 午夜av一区二区| 免费在线观看视频一区| 久久国产麻豆精品| 高清日韩电视剧大全免费| 成人夜色视频网站在线观看| www.在线成人| 欧美性生活影院| 精品国产乱码久久久久久免费| 久久亚洲二区三区| 亚洲一区二区三区三| 成人丝袜高跟foot| 色中色一区二区| 久久伊人中文字幕| 一区二区免费在线| 国产精品1024久久| 欧美高清视频www夜色资源网| 久久精品无码一区二区三区| 伊人婷婷欧美激情|