C++ GUI Programming with Qt 3 [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

C++ GUI Programming with Qt 3 [Electronic resources] - نسخه متنی

Jasmin blanchette; Mark summerfield

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید










Dynamic Dialogs


Dynamic dialogs are dialogs that are created from a Qt Designer .ui file at runtime. Dynamic dialogs are not converted into C++ code by uic. Instead, the .ui file is loaded at run-time using the QWidgetFactory class, in the following way:


QDialog *sortDialog = (QDialog *)
QWidgetFactory::create("sortdialog.ui");

We can access the form's child widgets using QObject::child():


QComboBox *primaryColumnCombo = (QComboBox *)
sortDialog->child("primaryColumnCombo", "QComboBox");

The child() function returns a null pointer if the dialog has no child that matches the given name and type.

The QWidgetFactory class is located in a separate library. To use QWidgetFactory from a Qt application, we must add this line to the application's .pro file:


LIBS += -lqui

This syntax works on all platforms, even though it has a definite Unix flavor.

Dynamic dialogs make it possible to change the layout of the form without recompiling the application. For a complete example of an application that uses a dynamic dialog, see the "Subclassing and Dynamic Dialogs" chapter in the Qt Designer manual.


/ 140