Dynamic Dialogs study notes (translation)

xiaoxiao2021-03-06  64

The Dynamic dialog is a dialog created by Qt Designer .ui files. It is not converted to C code by UIC, replacing it, .ui files use QwidgetFacroty class calls at runtime, as shown in: QDialog * SortDialog = (QDialog *) QwidgetFactory :: Create ("sortdialog.ui"); we can Use Qobject :: Child () to access the sub-component qcombobox * primarycolnmncombo = (qcombox *) SortDialog-> Child ("PrimaultColumnCombo", "qcomboBox"); if the dialog box does not have the name and type given to the sub-component Then, the child () function returns an empty pointer.

The QWidgetFactory class is in a separate library. To use QwidgetFactory in the QT application, we must add such a line in the .pro file: libs = -lqui This syntax works in all platforms, although it has a clear UNIX flavor.

The Dynamic dialog box makes it possible to change the form layout without recompiling applications. An example of a complete application using the Dynamic dialog, please see the "Subclassing and Dynamic Dialogs" of the Qt Designer manual.

转载请注明原文地址:https://www.9cbs.com/read-88407.html

New Post(0)