Skip to content

Style pixel value editor

Dialog for setting the pixel value for styling IMs.

PixelValueEditorDialog

PixelValueEditorDialog(parent=None)

Bases: QDialog, WidgetUi

Dialog for setting the pixel value for styling activities.

Source code in src/cplus_plugin/gui/pixel_value_editor_dialog.py
def __init__(self, parent=None):
    super().__init__(parent)
    self.setupUi(self)

    QgsGui.enableAutoGeometryRestore(self)

    icon_pixmap = QtGui.QPixmap(ICON_PATH)
    self.icon_la.setPixmap(icon_pixmap)

    help_icon = FileUtils.get_icon("mActionHelpContents.svg")
    self.btn_help.setIcon(help_icon)
    self.btn_help.clicked.connect(self.open_help)

    self._item_model = QtGui.QStandardItemModel(self)
    self._item_model.setColumnCount(1)
    self.tv_activities.setModel(self._item_model)

    self.tv_activities.setDragEnabled(True)
    self.tv_activities.setAcceptDrops(True)
    self.tv_activities.setShowGrid(False)
    self.tv_activities.setDragDropOverwriteMode(False)
    self.tv_activities.setDragDropMode(QtWidgets.QAbstractItemView.InternalMove)
    self.tv_activities.horizontalHeader().setSectionResizeMode(
        QtWidgets.QHeaderView.Stretch
    )

    self._load_items()

item_mapping property

item_mapping

Returns a mapping of the activity position in the table and its corresponding unique identifier.

We are using an OrderedDict to ensure consistency across different Python versions in the different platforms that QGIS runs on.

Returns:

Type Description
OrderedDict

The mapping of the activities' positions in the table and its corresponding unique identifier.

open_help

open_help(activated)

Opens the user documentation for the plugin in a browser.

Source code in src/cplus_plugin/gui/pixel_value_editor_dialog.py
def open_help(self, activated: bool):
    """Opens the user documentation for the plugin in a browser."""
    open_documentation(USER_DOCUMENTATION_SITE)

Last update: October 2, 2024
Back to top