straditize.widgets.axes_translations module

Module for translating the x- and y-axes from pixel into data coordinates

Disclaimer

Copyright (C) 2018-2019 Philipp S. Sommer

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.

Classes

AxesTranslations(straditizer_widgets, item)

The control for translating x- and y-axes

class straditize.widgets.axes_translations.AxesTranslations(straditizer_widgets, item)[source]

Bases: straditize.widgets.StraditizerControlBase

The control for translating x- and y-axes

This object creates two buttons for translating x- and y-axes from pixel to data coordinates

Parameters
  • straditizer_widgets (StraditizerWidgets) – The main widget for the straditizer GUI

  • item (QTreeWidgetItem) – The parent item in the StraditizerWidgets.tree. If given, the setup_children() is called with this item

Methods

marks_for_x([at_col_start])

Create (or enable) the marks for the x-axis translation

marks_for_y()

Create (or enable) the marks for the y-axis translation

setup_children(item)

Setup the children for this control

should_be_enabled(w)

Check if a widget should be enabled

Attributes

tree

marks_for_x(at_col_start=True)[source]

Create (or enable) the marks for the x-axis translation

marks_for_y()[source]

Create (or enable) the marks for the y-axis translation

setup_children(item)[source]

Setup the children for this control

This method is called to setup the children in the StraditizerWidgets.tree. By default, it just creates a child QTreeWidgetItem and sets this control as it’s widget

Parameters

item (QTreeWidgetItem) – The top level item in the StraditizerWidgets.tree

should_be_enabled(w)[source]

Check if a widget should be enabled

This function checks if a given widget w from the widgets2disable attribute should be enabled or not

Parameters

w (QWidget) – The widget to check

Returns

True, if the widget should be enabled

Return type

bool

property tree