QDesignerFormWindowInterface

The QDesignerFormWindowInterface class allows you to query and manipulate form windows appearing in Qt Designer’s workspace. More

Inheritance diagram of PySide6.QtDesigner.QDesignerFormWindowInterface

Synopsis

Functions

Virtual functions

Static functions

Detailed Description

QDesignerFormWindowInterface provides information about the associated form window as well as allowing its properties to be altered. The interface is not intended to be instantiated directly, but to provide access to Qt Designer’s current form windows controlled by Qt Designer’s form window manager .

If you are looking for the form window containing a specific widget, you can use the static function:

QDesignerFormWindowInterface *formWindow;
formWindow = QDesignerFormWindowInterface::findFormWindow(myWidget);

But in addition, you can access any of the current form windows through Qt Designer’s form window manager: Use the formWindowManager() function to retrieve an interface to the manager. Once you have this interface, you have access to all of Qt Designer’s current form windows through the function. For example:

QList<QDesignerFormWindowInterface *> forms;
QDesignerFormWindowInterface *formWindow;

QDesignerFormWindowManagerInterface *manager = formEditor->formWindowManager();

for (int i = 0; i < manager->formWindowCount(); i++) {
    formWindow = manager->formWindow(i);
    forms.append(formWindow);
}

The pointer to Qt Designer’s current QDesignerFormEditorInterface object (formEditor in the example above) is provided by the function’s parameter. When implementing a custom widget plugin, you must subclass the QDesignerCustomWidgetInterface class to expose your plugin to Qt Designer.

Once you have the form window, you can query its properties. For example, a plain custom widget plugin is managed by Qt Designer only at its top level, i.e. none of its child widgets can be resized in Qt Designer’s workspace. But QDesignerFormWindowInterface provides you with functions that enables you to control whether a widget should be managed by Qt Designer, or not:

if (formWindow->isManaged(myWidget))
    formWindow->manageWidget(myWidget->childWidget);

The complete list of functions concerning widget management is: , and . There is also several associated signals: , , and .

In addition to controlling the management of widgets, you can control the current selection in the form window using the , and functions, and the signal.

You can also retrieve information about where the form is stored using , its include files using , and its layout and pixmap functions using , and . You can find out whether the form window has been modified (but not saved) or not, using the function. You can retrieve its , its , its , associated and , its , its , its and its .

The interface provides you with functions and slots allowing you to alter most of this information as well. The exception is the directory storing the form window. Finally, there is several signals associated with changes to the information mentioned above and to the form window in general.

class PySide6.QtDesigner.QDesignerFormWindowInterface
PySide6.QtDesigner.QDesignerFormWindowInterface.FeatureFlag

This enum describes the features that are available and can be controlled by the form window interface. These values are used when querying the form window to determine which features it supports:

Constant

Description

QDesignerFormWindowInterface.EditFeature

Form editing

QDesignerFormWindowInterface.GridFeature

Grid display and snap-to-grid facilities for editing

QDesignerFormWindowInterface.TabOrderFeature

Tab order management

QDesignerFormWindowInterface.DefaultFeature

Support for default features (form editing and grid)

See also

hasFeature()features()

PySide6.QtDesigner.QDesignerFormWindowInterface.ResourceFileSaveMode

This enum describes how resource files are saved.

Constant

Description

QDesignerFormWindowInterface.SaveAllResourceFiles

Save all resource files.

QDesignerFormWindowInterface.SaveOnlyUsedResourceFiles

Save resource files used by form.

QDesignerFormWindowInterface.DontSaveResourceFiles

Do not save resource files.

PySide6.QtDesigner.QDesignerFormWindowInterface.aboutToUnmanageWidget(widget)
Parameters

widgetPySide6.QtWidgets.QWidget

PySide6.QtDesigner.QDesignerFormWindowInterface.absoluteDir()
Return type

PySide6.QtCore.QDir

PySide6.QtDesigner.QDesignerFormWindowInterface.activateResourceFilePaths(paths[, errorCount=None[, errorMessages=None]])
Parameters
  • paths – list of strings

  • errorCount – int

  • errorMessages – str

Activates the resource (.qrc) file paths paths, returning the count of errors in errorCount and error message in errorMessages. Qt Designer loads the resources using the QResource class, making them available for form editing.

In IDE integrations, a list of the project’s resource (.qrc) file can be activated, making them available to Qt Designer.

See also

activeResourceFilePaths() QResource

PySide6.QtDesigner.QDesignerFormWindowInterface.activated(widget)
Parameters

widgetPySide6.QtWidgets.QWidget

PySide6.QtDesigner.QDesignerFormWindowInterface.activeResourceFilePaths()
Return type

list of strings

Returns the active resource (.qrc) file paths currently loaded in Qt Designer.

PySide6.QtDesigner.QDesignerFormWindowInterface.addResourceFile(path)
Parameters

path – str

PySide6.QtDesigner.QDesignerFormWindowInterface.author()
Return type

str

PySide6.QtDesigner.QDesignerFormWindowInterface.beginCommand(description)
Parameters

description – str

PySide6.QtDesigner.QDesignerFormWindowInterface.changed()
PySide6.QtDesigner.QDesignerFormWindowInterface.checkContents()
Return type

list of strings

PySide6.QtDesigner.QDesignerFormWindowInterface.clearSelection([changePropertyDisplay=true])
Parameters

changePropertyDisplay – bool

PySide6.QtDesigner.QDesignerFormWindowInterface.commandHistory()
Return type

PySide6.QtGui.QUndoStack

PySide6.QtDesigner.QDesignerFormWindowInterface.comment()
Return type

str

PySide6.QtDesigner.QDesignerFormWindowInterface.contents()
Return type

str

PySide6.QtDesigner.QDesignerFormWindowInterface.core()
Return type

PySide6.QtDesigner.QDesignerFormEditorInterface

Returns a pointer to Qt Designer’s current QDesignerFormEditorInterface object.

PySide6.QtDesigner.QDesignerFormWindowInterface.currentTool()
Return type

int

PySide6.QtDesigner.QDesignerFormWindowInterface.editWidgets()
PySide6.QtDesigner.QDesignerFormWindowInterface.emitSelectionChanged()
PySide6.QtDesigner.QDesignerFormWindowInterface.endCommand()
PySide6.QtDesigner.QDesignerFormWindowInterface.ensureUniqueObjectName(object)
Parameters

objectPySide6.QtCore.QObject

PySide6.QtDesigner.QDesignerFormWindowInterface.exportMacro()
Return type

str

PySide6.QtDesigner.QDesignerFormWindowInterface.featureChanged(f)
Parameters

fFeature

PySide6.QtDesigner.QDesignerFormWindowInterface.features()
Return type

Feature

PySide6.QtDesigner.QDesignerFormWindowInterface.fileName()
Return type

str

PySide6.QtDesigner.QDesignerFormWindowInterface.fileNameChanged(fileName)
Parameters

fileName – str

static PySide6.QtDesigner.QDesignerFormWindowInterface.findFormWindow(obj)
Parameters

objPySide6.QtCore.QObject

Return type

PySide6.QtDesigner.QDesignerFormWindowInterface

static PySide6.QtDesigner.QDesignerFormWindowInterface.findFormWindow(w)
Parameters

wPySide6.QtWidgets.QWidget

Return type

PySide6.QtDesigner.QDesignerFormWindowInterface

PySide6.QtDesigner.QDesignerFormWindowInterface.formContainer()
Return type

PySide6.QtWidgets.QWidget

PySide6.QtDesigner.QDesignerFormWindowInterface.geometryChanged()
PySide6.QtDesigner.QDesignerFormWindowInterface.grid()
Return type

PySide6.QtCore.QPoint

PySide6.QtDesigner.QDesignerFormWindowInterface.hasFeature(f)
Parameters

fFeature

Return type

bool

PySide6.QtDesigner.QDesignerFormWindowInterface.includeHints()
Return type

list of strings

PySide6.QtDesigner.QDesignerFormWindowInterface.isDirty()
Return type

bool

PySide6.QtDesigner.QDesignerFormWindowInterface.isManaged(widget)
Parameters

widgetPySide6.QtWidgets.QWidget

Return type

bool

PySide6.QtDesigner.QDesignerFormWindowInterface.layoutDefault(margin, spacing)
Parameters
  • margin – int

  • spacing – int

PySide6.QtDesigner.QDesignerFormWindowInterface.layoutFunction(margin, spacing)
Parameters
  • margin – str

  • spacing – str

PySide6.QtDesigner.QDesignerFormWindowInterface.mainContainer()
Return type

PySide6.QtWidgets.QWidget

PySide6.QtDesigner.QDesignerFormWindowInterface.mainContainerChanged(mainContainer)
Parameters

mainContainerPySide6.QtWidgets.QWidget

PySide6.QtDesigner.QDesignerFormWindowInterface.manageWidget(widget)
Parameters

widgetPySide6.QtWidgets.QWidget

PySide6.QtDesigner.QDesignerFormWindowInterface.objectRemoved(o)
Parameters

oPySide6.QtCore.QObject

PySide6.QtDesigner.QDesignerFormWindowInterface.pixmapFunction()
Return type

str

PySide6.QtDesigner.QDesignerFormWindowInterface.registerTool(tool)
Parameters

toolPySide6.QtDesigner.QDesignerFormWindowToolInterface

PySide6.QtDesigner.QDesignerFormWindowInterface.removeResourceFile(path)
Parameters

path – str

PySide6.QtDesigner.QDesignerFormWindowInterface.resourceFileSaveMode()
Return type

ResourceFileSaveMode

PySide6.QtDesigner.QDesignerFormWindowInterface.resourceFiles()
Return type

list of strings

PySide6.QtDesigner.QDesignerFormWindowInterface.resourceFilesChanged()
PySide6.QtDesigner.QDesignerFormWindowInterface.selectWidget(w[, select=true])
Parameters
PySide6.QtDesigner.QDesignerFormWindowInterface.selectionChanged()
PySide6.QtDesigner.QDesignerFormWindowInterface.setAuthor(author)
Parameters

author – str

PySide6.QtDesigner.QDesignerFormWindowInterface.setComment(comment)
Parameters

comment – str

PySide6.QtDesigner.QDesignerFormWindowInterface.setContents(dev[, errorMessage=None])
Parameters
Return type

bool

PySide6.QtDesigner.QDesignerFormWindowInterface.setContents(contents)
Parameters

contents – str

Return type

bool

PySide6.QtDesigner.QDesignerFormWindowInterface.setCurrentTool(index)
Parameters

index – int

PySide6.QtDesigner.QDesignerFormWindowInterface.setDirty(dirty)
Parameters

dirty – bool

PySide6.QtDesigner.QDesignerFormWindowInterface.setExportMacro(exportMacro)
Parameters

exportMacro – str

PySide6.QtDesigner.QDesignerFormWindowInterface.setFeatures(f)
Parameters

fFeature

PySide6.QtDesigner.QDesignerFormWindowInterface.setFileName(fileName)
Parameters

fileName – str

PySide6.QtDesigner.QDesignerFormWindowInterface.setGrid(grid)
Parameters

gridPySide6.QtCore.QPoint

PySide6.QtDesigner.QDesignerFormWindowInterface.setIncludeHints(includeHints)
Parameters

includeHints – list of strings

PySide6.QtDesigner.QDesignerFormWindowInterface.setLayoutDefault(margin, spacing)
Parameters
  • margin – int

  • spacing – int

PySide6.QtDesigner.QDesignerFormWindowInterface.setLayoutFunction(margin, spacing)
Parameters
  • margin – str

  • spacing – str

PySide6.QtDesigner.QDesignerFormWindowInterface.setMainContainer(mainContainer)
Parameters

mainContainerPySide6.QtWidgets.QWidget

PySide6.QtDesigner.QDesignerFormWindowInterface.setPixmapFunction(pixmapFunction)
Parameters

pixmapFunction – str

PySide6.QtDesigner.QDesignerFormWindowInterface.setResourceFileSaveMode(behaviour)
Parameters

behaviourResourceFileSaveMode

PySide6.QtDesigner.QDesignerFormWindowInterface.simplifySelection(widgets)
Parameters

widgetsQList

PySide6.QtDesigner.QDesignerFormWindowInterface.tool(index)
Parameters

index – int

Return type

PySide6.QtDesigner.QDesignerFormWindowToolInterface

PySide6.QtDesigner.QDesignerFormWindowInterface.toolChanged(toolIndex)
Parameters

toolIndex – int

PySide6.QtDesigner.QDesignerFormWindowInterface.toolCount()
Return type

int

PySide6.QtDesigner.QDesignerFormWindowInterface.unmanageWidget(widget)
Parameters

widgetPySide6.QtWidgets.QWidget

PySide6.QtDesigner.QDesignerFormWindowInterface.widgetManaged(widget)
Parameters

widgetPySide6.QtWidgets.QWidget

PySide6.QtDesigner.QDesignerFormWindowInterface.widgetRemoved(w)
Parameters

wPySide6.QtWidgets.QWidget

PySide6.QtDesigner.QDesignerFormWindowInterface.widgetUnmanaged(widget)
Parameters

widgetPySide6.QtWidgets.QWidget