Helper Widgets¶
Color Button¶
ColorButton
¶
Bases: QPushButton
Custom button to allow the user to select a color. The default color is a random bright color.
Left-clicking opens a color dialog box to choose a color. Right-clicking resets the color to the default.
Parameters¶
color : QColor or str, optional Default color for the button to use, by default None index : int, optional A value used in determining a default color, by default -1
Source code in trace/widgets/color_button.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
color
property
writable
¶
Return the current color.
index_color(index)
staticmethod
¶
Returns the color in the color palette at index.
Source code in trace/widgets/color_button.py
85 86 87 88 89 90 91 92 |
|
mousePressEvent(e)
¶
Set the color to the default on right-click.
Source code in trace/widgets/color_button.py
65 66 67 68 69 70 71 |
|
random_color()
staticmethod
¶
Pick a random color for the default color of each PV. This function ensures that the color is bright, since it will be on a black background.
Source code in trace/widgets/color_button.py
73 74 75 76 77 78 79 80 81 82 83 |
|
Frozen Table View¶
FrozenTableView
¶
Bases: QTableView
QTableView with the leftmost column frozen so it always shows while the rest of the table is horizontally scrollable.
Python version of Qt FreezeTableWidget example: https://doc.qt.io/qt-6/qtwidgets-itemviews-frozencolumn-example.html
Source code in trace/widgets/frozen_table_view.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|