Skip to content

Allow to set qt properties on PanelDescription

Miquel Navarro requested to merge issue1322-paneldescription-qt-properties into develop

This MR allows to set some qt properties (not all of them are supported with this change) on PanelDescription. This is done with the new parameter widget_qt_properties, a dictionary "key":value where the key is a qt attribute.

The attribute is assigned dynamically, so there are 2 limitations:

  • The name on the key must be camelcase. For example for setting the tooltip the key should be "toolTip" and NOT "tooltip" or "ToolTip"
  • The value must be the type required by the attribute, as it won't convert it later. So, for example, setting the icon will be "Icon":Qt.QIcon("actions:gtk-stop.svg") and not "Icon":"actions:gtk-stop.svg".

Currently it only works with properties with 1 parameter. Attributes whose set method requires 2 or more parameters are not supported, like setMaximumSize() that requires both horizontal and vertical sizes. In the future, we can implement the option to support multiple parameter attributes by accepting arrays and sending the values as parameters.

Fixes #1322

Edited by Miquel Navarro

Merge request reports