pyqttoolkit 0.9.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyqttoolkit/__init__.py +20 -0
- pyqttoolkit/_version.py +21 -0
- pyqttoolkit/application/__init__.py +18 -0
- pyqttoolkit/application/application.py +86 -0
- pyqttoolkit/application/garbage_collector.py +65 -0
- pyqttoolkit/colors/__init__.py +84 -0
- pyqttoolkit/config/__init__.py +20 -0
- pyqttoolkit/config/base.py +22 -0
- pyqttoolkit/config/composite.py +31 -0
- pyqttoolkit/config/default.py +27 -0
- pyqttoolkit/config/environment.py +35 -0
- pyqttoolkit/config/multi_json_file.py +93 -0
- pyqttoolkit/config/with_signal.py +30 -0
- pyqttoolkit/config/with_value_changed.py +31 -0
- pyqttoolkit/data/__init__.py +21 -0
- pyqttoolkit/data/bits.py +23 -0
- pyqttoolkit/data/cache.py +64 -0
- pyqttoolkit/data/interval.py +26 -0
- pyqttoolkit/data/message.py +29 -0
- pyqttoolkit/data/names.py +24 -0
- pyqttoolkit/datetime/__init__.py +16 -0
- pyqttoolkit/datetime/datetime.py +51 -0
- pyqttoolkit/datetime/qdatetime.py +53 -0
- pyqttoolkit/dependencies/__init__.py +56 -0
- pyqttoolkit/errors/__init__.py +19 -0
- pyqttoolkit/exceptions/__init__.py +18 -0
- pyqttoolkit/filesystem/__init__.py +24 -0
- pyqttoolkit/logs/__init__.py +140 -0
- pyqttoolkit/metadata/__init__.py +23 -0
- pyqttoolkit/metadata/dataframe_metadata_manager.py +105 -0
- pyqttoolkit/metadata/dict_metadata_manager.py +63 -0
- pyqttoolkit/metadata/id_generator.py +20 -0
- pyqttoolkit/metadata/metadata_manager_base.py +54 -0
- pyqttoolkit/models/__init__.py +26 -0
- pyqttoolkit/models/code_text.py +43 -0
- pyqttoolkit/models/dataframetable.py +135 -0
- pyqttoolkit/models/dictpropertytree.py +155 -0
- pyqttoolkit/models/dicttable.py +140 -0
- pyqttoolkit/models/json_text.py +52 -0
- pyqttoolkit/models/list_model.py +52 -0
- pyqttoolkit/models/module.py +26 -0
- pyqttoolkit/models/roles.py +23 -0
- pyqttoolkit/models/series_data.py +68 -0
- pyqttoolkit/models/span.py +36 -0
- pyqttoolkit/models/validation.py +27 -0
- pyqttoolkit/modules/__init__.py +18 -0
- pyqttoolkit/modules/events/__init__.py +19 -0
- pyqttoolkit/modules/events/add_signal.py +31 -0
- pyqttoolkit/modules/events/module_opening.py +21 -0
- pyqttoolkit/modules/events/rejectable.py +29 -0
- pyqttoolkit/modules/launcher_config.py +55 -0
- pyqttoolkit/modules/module.py +111 -0
- pyqttoolkit/properties/__init__.py +18 -0
- pyqttoolkit/properties/auto.py +221 -0
- pyqttoolkit/properties/throttled.py +77 -0
- pyqttoolkit/scripting/__init__.py +19 -0
- pyqttoolkit/scripting/script_context.py +36 -0
- pyqttoolkit/scripting/script_runner.py +132 -0
- pyqttoolkit/scripting/script_template.py +42 -0
- pyqttoolkit/services/__init__.py +32 -0
- pyqttoolkit/services/autosave.py +41 -0
- pyqttoolkit/services/email.py +25 -0
- pyqttoolkit/services/event_registry.py +52 -0
- pyqttoolkit/services/file_dialog.py +71 -0
- pyqttoolkit/services/hotkey_manager.py +137 -0
- pyqttoolkit/services/link_manager.py +135 -0
- pyqttoolkit/services/message_board.py +90 -0
- pyqttoolkit/services/module_service.py +154 -0
- pyqttoolkit/services/object_converter.py +45 -0
- pyqttoolkit/services/project_updater.py +149 -0
- pyqttoolkit/services/task_runner.py +281 -0
- pyqttoolkit/services/theme_manager.py +46 -0
- pyqttoolkit/services/tool_window_service.py +46 -0
- pyqttoolkit/viewmanagers/__init__.py +17 -0
- pyqttoolkit/viewmanagers/tool.py +23 -0
- pyqttoolkit/views/__init__.py +50 -0
- pyqttoolkit/views/bulk_value_selector.py +112 -0
- pyqttoolkit/views/check_box.py +36 -0
- pyqttoolkit/views/code/__init__.py +18 -0
- pyqttoolkit/views/code/code_edit.py +268 -0
- pyqttoolkit/views/code/python_syntax.py +226 -0
- pyqttoolkit/views/combo_box.py +101 -0
- pyqttoolkit/views/count_selector.py +59 -0
- pyqttoolkit/views/datetime.py +111 -0
- pyqttoolkit/views/datetime_range_selector.py +231 -0
- pyqttoolkit/views/default_text_line_edit.py +50 -0
- pyqttoolkit/views/delegates.py +117 -0
- pyqttoolkit/views/dtype_edit.py +117 -0
- pyqttoolkit/views/editable_combo_box.py +45 -0
- pyqttoolkit/views/file_selector.py +51 -0
- pyqttoolkit/views/icon.py +67 -0
- pyqttoolkit/views/icon_button.py +129 -0
- pyqttoolkit/views/json_edit.py +21 -0
- pyqttoolkit/views/labelled.py +29 -0
- pyqttoolkit/views/layout/__init__.py +21 -0
- pyqttoolkit/views/layout/collabsible.py +59 -0
- pyqttoolkit/views/layout/group_box.py +48 -0
- pyqttoolkit/views/layout/group_panel.py +188 -0
- pyqttoolkit/views/layout/lines.py +30 -0
- pyqttoolkit/views/layout/link.py +38 -0
- pyqttoolkit/views/line_edit.py +61 -0
- pyqttoolkit/views/linkable.py +49 -0
- pyqttoolkit/views/list_view.py +43 -0
- pyqttoolkit/views/main_window.py +91 -0
- pyqttoolkit/views/metadata_selector.py +84 -0
- pyqttoolkit/views/modulewindow.py +81 -0
- pyqttoolkit/views/plot/__init__.py +26 -0
- pyqttoolkit/views/plot/legend_control.py +121 -0
- pyqttoolkit/views/plot/matplotlib/__init__.py +23 -0
- pyqttoolkit/views/plot/matplotlib/base.py +1056 -0
- pyqttoolkit/views/plot/matplotlib/colorbar.py +75 -0
- pyqttoolkit/views/plot/matplotlib/colormap.py +48 -0
- pyqttoolkit/views/plot/matplotlib/font.py +55 -0
- pyqttoolkit/views/plot/plot_options.py +211 -0
- pyqttoolkit/views/plot/plot_toolbar_options.py +133 -0
- pyqttoolkit/views/plot/size.py +41 -0
- pyqttoolkit/views/plot/tool_type.py +26 -0
- pyqttoolkit/views/plot/toolbar.py +100 -0
- pyqttoolkit/views/popout.py +41 -0
- pyqttoolkit/views/popup.py +41 -0
- pyqttoolkit/views/property_tree.py +26 -0
- pyqttoolkit/views/shrunk_push_button.py +34 -0
- pyqttoolkit/views/steppable_combo_box.py +67 -0
- pyqttoolkit/views/styleable.py +37 -0
- pyqttoolkit/views/table.py +146 -0
- pyqttoolkit/views/text_edit.py +31 -0
- pyqttoolkit/views/tool_window.py +35 -0
- pyqttoolkit-0.9.1.dist-info/METADATA +69 -0
- pyqttoolkit-0.9.1.dist-info/RECORD +133 -0
- pyqttoolkit-0.9.1.dist-info/WHEEL +5 -0
- pyqttoolkit-0.9.1.dist-info/licenses/LICENSE.txt +674 -0
- pyqttoolkit-0.9.1.dist-info/licenses/LICENSE_SHORT +16 -0
- pyqttoolkit-0.9.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# pyqttoolkit
|
|
2
|
+
# Copyright (C) 2018-2019, Simmovation Ltd.
|
|
3
|
+
#
|
|
4
|
+
# This program is free software; you can redistribute it and/or modify
|
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
|
6
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
7
|
+
# (at your option) any later version.
|
|
8
|
+
#
|
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
# GNU General Public License for more details.
|
|
13
|
+
#
|
|
14
|
+
# You should have received a copy of the GNU General Public License
|
|
15
|
+
# along with this program; if not, write to the Free Software Foundation,
|
|
16
|
+
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17
|
+
"""plotview
|
|
18
|
+
|
|
19
|
+
This module defines the plotview used in the application
|
|
20
|
+
"""
|
|
21
|
+
from .toolbar import PlotToolbarWidget
|
|
22
|
+
from .tool_type import ToolType
|
|
23
|
+
from .plot_toolbar_options import PlotToolbarOptions
|
|
24
|
+
from .size import ToggleableFixed, MaxWidth
|
|
25
|
+
from .plot_options import PlotOptionsView
|
|
26
|
+
from .legend_control import LegendControlView
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# pyqttoolkit
|
|
2
|
+
# Copyright (C) 2018-2019, Simmovation Ltd.
|
|
3
|
+
#
|
|
4
|
+
# This program is free software; you can redistribute it and/or modify
|
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
|
6
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
7
|
+
# (at your option) any later version.
|
|
8
|
+
#
|
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
# GNU General Public License for more details.
|
|
13
|
+
#
|
|
14
|
+
# You should have received a copy of the GNU General Public License
|
|
15
|
+
# along with this program; if not, write to the Free Software Foundation,
|
|
16
|
+
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17
|
+
from PyQt5.QtWidgets import QWidget, QGridLayout, QLabel
|
|
18
|
+
from PyQt5.QtCore import pyqtSignal
|
|
19
|
+
|
|
20
|
+
from pyqttoolkit.properties import AutoProperty, bind
|
|
21
|
+
from pyqttoolkit.views import BindableCheckBox, BindableLineEdit
|
|
22
|
+
from pyqttoolkit.colors import format_color, ColorFormat
|
|
23
|
+
|
|
24
|
+
class LegendControlView(QWidget):
|
|
25
|
+
def __init__(self, parent):
|
|
26
|
+
QWidget.__init__(self, parent)
|
|
27
|
+
self._series = None
|
|
28
|
+
self._handles = None
|
|
29
|
+
self._show_series = []
|
|
30
|
+
self._series_names = []
|
|
31
|
+
|
|
32
|
+
self._layout = QGridLayout(self)
|
|
33
|
+
|
|
34
|
+
self._show_legend = BindableCheckBox(None, self)
|
|
35
|
+
|
|
36
|
+
self._layout.addWidget(self._show_legend, 0, 0)
|
|
37
|
+
self._layout.addWidget(QLabel(self.tr('Show Legend')), 0, 1)
|
|
38
|
+
|
|
39
|
+
self.showLegend = False
|
|
40
|
+
bind(self, self._show_legend, 'showLegend', 'checked')
|
|
41
|
+
self.hasHiddenSeries = False
|
|
42
|
+
|
|
43
|
+
showLegendChanged = pyqtSignal(bool)
|
|
44
|
+
showSeriesChanged = pyqtSignal(int, bool)
|
|
45
|
+
seriesNameChanged = pyqtSignal(int, str)
|
|
46
|
+
hasHiddenSeriesChanged = pyqtSignal(bool)
|
|
47
|
+
seriesUpdated = pyqtSignal()
|
|
48
|
+
|
|
49
|
+
showLegend = AutoProperty(bool)
|
|
50
|
+
hasHiddenSeries = AutoProperty(bool)
|
|
51
|
+
|
|
52
|
+
def setSeries(self, series, handles, colors):
|
|
53
|
+
if self._series == series and self._handles == handles:
|
|
54
|
+
return
|
|
55
|
+
|
|
56
|
+
self._series = series
|
|
57
|
+
self._handles = handles
|
|
58
|
+
|
|
59
|
+
for widget in self._show_series + self._series_names:
|
|
60
|
+
self._layout.removeWidget(widget)
|
|
61
|
+
widget.setParent(None)
|
|
62
|
+
|
|
63
|
+
self._show_series = []
|
|
64
|
+
self._series_names = []
|
|
65
|
+
|
|
66
|
+
for i, default_name in enumerate(series):
|
|
67
|
+
show_series = BindableCheckBox(None, self)
|
|
68
|
+
show_series.setStyleSheet(self._check_box_style_sheet(colors[i]))
|
|
69
|
+
show_series.checked = True
|
|
70
|
+
show_series.checkedChanged.connect(self._on_show_series_changed(i))
|
|
71
|
+
series_name = BindableLineEdit(self)
|
|
72
|
+
series_name.setPlaceholderText(default_name)
|
|
73
|
+
series_name.valueChanged.connect(self._on_series_name_changed(i))
|
|
74
|
+
self._show_series.append(show_series)
|
|
75
|
+
self._series_names.append(series_name)
|
|
76
|
+
self._layout.addWidget(show_series, i + 1, 0)
|
|
77
|
+
self._layout.addWidget(series_name, i + 1, 1)
|
|
78
|
+
|
|
79
|
+
self.seriesUpdated.emit()
|
|
80
|
+
|
|
81
|
+
def _check_box_style_sheet(self, color):
|
|
82
|
+
color = color or (255, 255, 255)
|
|
83
|
+
return """BindableCheckBox::indicator:checked
|
|
84
|
+
{{
|
|
85
|
+
background-color: {color}
|
|
86
|
+
}}
|
|
87
|
+
BindableCheckBox::indicator:unchecked
|
|
88
|
+
{{
|
|
89
|
+
border: 3px solid {color}
|
|
90
|
+
}}
|
|
91
|
+
""".format(color=format_color(color, ColorFormat.hexa_string, 1.0))
|
|
92
|
+
|
|
93
|
+
@property
|
|
94
|
+
def seriesNames(self):
|
|
95
|
+
return [sn.value or sn.placeholderText() for sn in self._series_names]
|
|
96
|
+
|
|
97
|
+
@property
|
|
98
|
+
def showSeries(self):
|
|
99
|
+
return [ss.checked for ss in self._show_series]
|
|
100
|
+
|
|
101
|
+
@showSeries.setter
|
|
102
|
+
def showSeries(self, values):
|
|
103
|
+
if len(values) != len(self._show_series):
|
|
104
|
+
raise ValueError('Invalid number of values')
|
|
105
|
+
for ss, value in zip(self._show_series, values):
|
|
106
|
+
ss.checked = value
|
|
107
|
+
|
|
108
|
+
@property
|
|
109
|
+
def seriesHandles(self):
|
|
110
|
+
return self._handles
|
|
111
|
+
|
|
112
|
+
def _on_show_series_changed(self, index):
|
|
113
|
+
def _(show):
|
|
114
|
+
self.showSeriesChanged.emit(index, show)
|
|
115
|
+
self.hasHiddenSeries = not all(self.showSeries)
|
|
116
|
+
return _
|
|
117
|
+
|
|
118
|
+
def _on_series_name_changed(self, index):
|
|
119
|
+
def _():
|
|
120
|
+
self.seriesNameChanged.emit(index, self._series_names[index].value or self._series_names[index].placeholderText())
|
|
121
|
+
return _
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# pyqttoolkit
|
|
2
|
+
# Copyright (C) 2018-2019, Simmovation Ltd.
|
|
3
|
+
#
|
|
4
|
+
# This program is free software; you can redistribute it and/or modify
|
|
5
|
+
# it under the terms of the GNU General Public License as published by
|
|
6
|
+
# the Free Software Foundation; either version 3 of the License, or
|
|
7
|
+
# (at your option) any later version.
|
|
8
|
+
#
|
|
9
|
+
# This program is distributed in the hope that it will be useful,
|
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
# GNU General Public License for more details.
|
|
13
|
+
#
|
|
14
|
+
# You should have received a copy of the GNU General Public License
|
|
15
|
+
# along with this program; if not, write to the Free Software Foundation,
|
|
16
|
+
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
17
|
+
""":mod:`matplotlib`
|
|
18
|
+
Defines the matplotlib plot view
|
|
19
|
+
"""
|
|
20
|
+
from .base import MatPlotLibBase, _RectangleSelector, _SpanSelector
|
|
21
|
+
from .font import MatPlotLibFont
|
|
22
|
+
from .colormap import MatPlotLibColormap
|
|
23
|
+
from .colorbar import MatPlotColorbar
|