QDesignerWidgetBoxInterface Class ReferenceThe QDesignerWidgetBoxInterface class allows you to control the contents of Qt Designer's widget box. More... #include <QDesignerWidgetBoxInterface> Inherits: QWidget. Public Functions
Additional Inherited Members
Detailed DescriptionThe QDesignerWidgetBoxInterface class allows you to control the contents of Qt Designer's widget box. QDesignerWidgetBoxInterface contains a collection of functions that is typically used to manipulate the contents of Qt Designer's widget box. Qt Designer uses an XML file to populate its widget box. The name of that file is one of the widget box's properties, and you can retrieve it using the fileName() function. QDesignerWidgetBoxInterface also provides the save() function that saves the contents of the widget box in the file specified by the widget box's file name property. If you have made changes to the widget box, for example by dropping a widget into the widget box, without calling the save() function, the original content can be restored by a simple invocation of the load() function: QDesignerWidgetBoxInterface *widgetBox = 0: widgetBox = formEditor->widgetBox(); widgetBox->load(); The QDesignerWidgetBoxInterface class is not intended to be instantiated directly. You can retrieve an interface to Qt Designer's widget box using the QDesignerFormEditorInterface::widgetBox() function. A pointer to Qt Designer's current QDesignerFormEditorInterface object (formEditor in the example above) is provided by the QDesignerCustomWidgetInterface::initialize() function's parameter. When implementing a custom widget plugin, you must subclass the QDesignerCustomWidgetInterface to expose your plugin to Qt Designer. If you want to save your changes, and at the same time preserve the original contents, you can use the save() function combined with the setFileName() function to save your changes into another file. Remember to store the name of the original file first: QString originalFile = widgetBox->fileName(); widgetBox->setFileName("myWidgetBox.xml"); widgetBox->save(); Then you can restore the original contents of the widget box by resetting the file name to the original file and calling load(): widgetBox->setFileName(originalFile); widgetBox->load(); In a similar way, you can later use your customized XML file: if (widgetBox->filename() != "myWidgetBox.xml") { widgetBox->setFileName("myWidgetBox.xml"); widgetBox->load(); } See also QDesignerFormEditorInterface. Member Function Documentation
|
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.8 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com