PaIRS-UniNa 0.1.13__cp310-cp310-win_amd64.whl → 0.2.8__cp310-cp310-win_amd64.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.
- PaIRS_UniNa/Calibration_Tab.py +331 -0
- PaIRS_UniNa/Changes.txt +134 -2
- PaIRS_UniNa/Custom_Top.py +299 -299
- PaIRS_UniNa/Explorer.py +3136 -0
- PaIRS_UniNa/FolderLoop.py +562 -0
- PaIRS_UniNa/Input_Tab.py +831 -0
- PaIRS_UniNa/Input_Tab_CalVi.py +786 -0
- PaIRS_UniNa/Input_Tab_tools.py +3025 -0
- PaIRS_UniNa/Log_Tab.py +57 -14
- PaIRS_UniNa/Output_Tab.py +922 -0
- PaIRS_UniNa/PaIRS_PIV.py +111 -18
- PaIRS_UniNa/PaIRS_pypacks.py +698 -140
- PaIRS_UniNa/Process_Tab.py +1221 -1402
- PaIRS_UniNa/Process_Tab_CalVi.py +137 -262
- PaIRS_UniNa/Process_Tab_Disp.py +163 -0
- PaIRS_UniNa/Process_Tab_Min.py +120 -0
- PaIRS_UniNa/Saving_tools.py +296 -0
- PaIRS_UniNa/TabTools.py +863 -543
- PaIRS_UniNa/Vis_Tab.py +1898 -1315
- PaIRS_UniNa/Vis_Tab_CalVi.py +484 -356
- PaIRS_UniNa/Whatsnew.py +59 -10
- PaIRS_UniNa/_PaIRS_PIV.pyd +0 -0
- PaIRS_UniNa/__init__.py +4 -3
- PaIRS_UniNa/addwidgets_ps.py +326 -56
- PaIRS_UniNa/calib.py +19 -12
- PaIRS_UniNa/calibView.py +48 -25
- PaIRS_UniNa/gPaIRS.py +3902 -3461
- PaIRS_UniNa/gPalette.py +189 -170
- PaIRS_UniNa/icons/align_all.png +0 -0
- PaIRS_UniNa/icons/announcement.png +0 -0
- PaIRS_UniNa/icons/automatic_levels_off.png +0 -0
- PaIRS_UniNa/icons/automatic_levels_on.png +0 -0
- PaIRS_UniNa/icons/automatic_off.png +0 -0
- PaIRS_UniNa/icons/automatic_on.png +0 -0
- PaIRS_UniNa/icons/automatic_size_off.png +0 -0
- PaIRS_UniNa/icons/automatic_size_on.png +0 -0
- PaIRS_UniNa/icons/bin_off.png +0 -0
- PaIRS_UniNa/icons/bin_on.png +0 -0
- PaIRS_UniNa/icons/brush_cursor.png +0 -0
- PaIRS_UniNa/icons/bugfix.png +0 -0
- PaIRS_UniNa/icons/cal_proc.png +0 -0
- PaIRS_UniNa/icons/cal_proc_off.png +0 -0
- PaIRS_UniNa/icons/cal_step.png +0 -0
- PaIRS_UniNa/icons/cal_step_off.png +0 -0
- PaIRS_UniNa/icons/calibration_logo.png +0 -0
- PaIRS_UniNa/icons/change_folder.png +0 -0
- PaIRS_UniNa/icons/change_folder_off.png +0 -0
- PaIRS_UniNa/icons/close_all.png +0 -0
- PaIRS_UniNa/icons/close_workspace.png +0 -0
- PaIRS_UniNa/icons/colormap.png +0 -0
- PaIRS_UniNa/icons/colormaps/Accent.png +0 -0
- PaIRS_UniNa/icons/colormaps/BrBG.png +0 -0
- PaIRS_UniNa/icons/colormaps/Dark2.png +0 -0
- PaIRS_UniNa/icons/colormaps/PRGn.png +0 -0
- PaIRS_UniNa/icons/colormaps/Paired.png +0 -0
- PaIRS_UniNa/icons/colormaps/Pastel1.png +0 -0
- PaIRS_UniNa/icons/colormaps/Pastel2.png +0 -0
- PaIRS_UniNa/icons/colormaps/PiYG.png +0 -0
- PaIRS_UniNa/icons/colormaps/PuOr.png +0 -0
- PaIRS_UniNa/icons/colormaps/RdBu.png +0 -0
- PaIRS_UniNa/icons/colormaps/RdGy.png +0 -0
- PaIRS_UniNa/icons/colormaps/RdYlBu.png +0 -0
- PaIRS_UniNa/icons/colormaps/RdYlGn.png +0 -0
- PaIRS_UniNa/icons/colormaps/Set1.png +0 -0
- PaIRS_UniNa/icons/colormaps/Set2.png +0 -0
- PaIRS_UniNa/icons/colormaps/Set3.png +0 -0
- PaIRS_UniNa/icons/colormaps/Spectral.png +0 -0
- PaIRS_UniNa/icons/colormaps/Wistia.png +0 -0
- PaIRS_UniNa/icons/colormaps/afmhot.png +0 -0
- PaIRS_UniNa/icons/colormaps/autumn.png +0 -0
- PaIRS_UniNa/icons/colormaps/binary.png +0 -0
- PaIRS_UniNa/icons/colormaps/blackVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/blueVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/bone.png +0 -0
- PaIRS_UniNa/icons/colormaps/brg.png +0 -0
- PaIRS_UniNa/icons/colormaps/bwr.png +0 -0
- PaIRS_UniNa/icons/colormaps/cividis.png +0 -0
- PaIRS_UniNa/icons/colormaps/cool.png +0 -0
- PaIRS_UniNa/icons/colormaps/coolwarm.png +0 -0
- PaIRS_UniNa/icons/colormaps/copper.png +0 -0
- PaIRS_UniNa/icons/colormaps/cubehelix.png +0 -0
- PaIRS_UniNa/icons/colormaps/cyanVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/flag.png +0 -0
- PaIRS_UniNa/icons/colormaps/gist_heat.png +0 -0
- PaIRS_UniNa/icons/colormaps/gray.png +0 -0
- PaIRS_UniNa/icons/colormaps/greenVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/hot.png +0 -0
- PaIRS_UniNa/icons/colormaps/hsv.png +0 -0
- PaIRS_UniNa/icons/colormaps/inferno.png +0 -0
- PaIRS_UniNa/icons/colormaps/jet.png +0 -0
- PaIRS_UniNa/icons/colormaps/magentaVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/magma.png +0 -0
- PaIRS_UniNa/icons/colormaps/ocean.png +0 -0
- PaIRS_UniNa/icons/colormaps/pink.png +0 -0
- PaIRS_UniNa/icons/colormaps/plasma.png +0 -0
- PaIRS_UniNa/icons/colormaps/prism.png +0 -0
- PaIRS_UniNa/icons/colormaps/rainbow.png +0 -0
- PaIRS_UniNa/icons/colormaps/redVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/seismic.png +0 -0
- PaIRS_UniNa/icons/colormaps/spring.png +0 -0
- PaIRS_UniNa/icons/colormaps/summer.png +0 -0
- PaIRS_UniNa/icons/colormaps/tab10.png +0 -0
- PaIRS_UniNa/icons/colormaps/tab20.png +0 -0
- PaIRS_UniNa/icons/colormaps/tab20b.png +0 -0
- PaIRS_UniNa/icons/colormaps/tab20c.png +0 -0
- PaIRS_UniNa/icons/colormaps/terrain.png +0 -0
- PaIRS_UniNa/icons/colormaps/twilight.png +0 -0
- PaIRS_UniNa/icons/colormaps/viridis.png +0 -0
- PaIRS_UniNa/icons/colormaps/whiteVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/winter.png +0 -0
- PaIRS_UniNa/icons/colormaps/yellowVector.png +0 -0
- PaIRS_UniNa/icons/common_region.png +0 -0
- PaIRS_UniNa/icons/common_region_off.png +0 -0
- PaIRS_UniNa/icons/completed.png +0 -0
- PaIRS_UniNa/icons/contourf_off.png +0 -0
- PaIRS_UniNa/icons/contourf_on.png +0 -0
- PaIRS_UniNa/icons/copy.png +0 -0
- PaIRS_UniNa/icons/copy_process.png +0 -0
- PaIRS_UniNa/icons/copy_process_off.png +0 -0
- PaIRS_UniNa/icons/cut.png +0 -0
- PaIRS_UniNa/icons/cut_warnings.png +0 -0
- PaIRS_UniNa/icons/darkmode.png +0 -0
- PaIRS_UniNa/icons/disp_step.png +0 -0
- PaIRS_UniNa/icons/disp_step_off.png +0 -0
- PaIRS_UniNa/icons/edit_list.png +0 -0
- PaIRS_UniNa/icons/example_list.png +0 -0
- PaIRS_UniNa/icons/flaticon_PaIRS_beta.png +0 -0
- PaIRS_UniNa/icons/flaticon_PaIRS_download_warning.png +0 -0
- PaIRS_UniNa/icons/flip_y_off.png +0 -0
- PaIRS_UniNa/icons/flip_y_on.png +0 -0
- PaIRS_UniNa/icons/folder_loop_cleanup.png +0 -0
- PaIRS_UniNa/icons/folder_loop_cleanup_off.png +0 -0
- PaIRS_UniNa/icons/gear.gif +0 -0
- PaIRS_UniNa/icons/gear.png +0 -0
- PaIRS_UniNa/icons/import_set.png +0 -0
- PaIRS_UniNa/icons/information.png +0 -0
- PaIRS_UniNa/icons/input_logo.png +0 -0
- PaIRS_UniNa/icons/issue.png +0 -0
- PaIRS_UniNa/icons/laser_NTR.png +0 -0
- PaIRS_UniNa/icons/laser_TR_double.png +0 -0
- PaIRS_UniNa/icons/laser_TR_single.png +0 -0
- PaIRS_UniNa/icons/link.png +0 -0
- PaIRS_UniNa/icons/linked.png +0 -0
- PaIRS_UniNa/icons/log_logo.png +0 -0
- PaIRS_UniNa/icons/logo_opaco.png +0 -0
- PaIRS_UniNa/icons/measure.png +0 -0
- PaIRS_UniNa/icons/measure_off.png +0 -0
- PaIRS_UniNa/icons/min_proc.png +0 -0
- PaIRS_UniNa/icons/min_proc_off.png +0 -0
- PaIRS_UniNa/icons/min_step.png +0 -0
- PaIRS_UniNa/icons/min_step_off.png +0 -0
- PaIRS_UniNa/icons/new_workspace.png +0 -0
- PaIRS_UniNa/icons/open_image.png +0 -0
- PaIRS_UniNa/icons/open_new_window.png +0 -0
- PaIRS_UniNa/icons/open_result.png +0 -0
- PaIRS_UniNa/icons/open_workspace.png +0 -0
- PaIRS_UniNa/icons/output_logo.png +0 -0
- PaIRS_UniNa/icons/paste_above.png +0 -0
- PaIRS_UniNa/icons/paste_below.png +0 -0
- PaIRS_UniNa/icons/paused.png +0 -0
- PaIRS_UniNa/icons/piv_proc.png +0 -0
- PaIRS_UniNa/icons/piv_proc_off.png +0 -0
- PaIRS_UniNa/icons/piv_step.png +0 -0
- PaIRS_UniNa/icons/piv_step_off.png +0 -0
- PaIRS_UniNa/icons/process_logo.png +0 -0
- PaIRS_UniNa/icons/process_loop.png +0 -0
- PaIRS_UniNa/icons/project.png +0 -0
- PaIRS_UniNa/icons/pylog.png +0 -0
- PaIRS_UniNa/icons/python_warning.png +0 -0
- PaIRS_UniNa/icons/queue.png +0 -0
- PaIRS_UniNa/icons/read.png +0 -0
- PaIRS_UniNa/icons/read_list.png +0 -0
- PaIRS_UniNa/icons/reset.png +0 -0
- PaIRS_UniNa/icons/reset_levels.png +0 -0
- PaIRS_UniNa/icons/restore_undo.png +0 -0
- PaIRS_UniNa/icons/running.gif +0 -0
- PaIRS_UniNa/icons/running.png +0 -0
- PaIRS_UniNa/icons/running_warn.png +0 -0
- PaIRS_UniNa/icons/save_and_stop.png +0 -0
- PaIRS_UniNa/icons/save_cfg.png +0 -0
- PaIRS_UniNa/icons/saveas_workspace.png +0 -0
- PaIRS_UniNa/icons/scale_all.png +0 -0
- PaIRS_UniNa/icons/scale_down.png +0 -0
- PaIRS_UniNa/icons/scale_up.png +0 -0
- PaIRS_UniNa/icons/scan_list.png +0 -0
- PaIRS_UniNa/icons/scan_path.png +0 -0
- PaIRS_UniNa/icons/scan_path_loop.png +0 -0
- PaIRS_UniNa/icons/scan_path_loop_off.png +0 -0
- PaIRS_UniNa/icons/search.png +0 -0
- PaIRS_UniNa/icons/showIW_off.png +0 -0
- PaIRS_UniNa/icons/showIW_on.png +0 -0
- PaIRS_UniNa/icons/show_all.png +0 -0
- PaIRS_UniNa/icons/sort.png +0 -0
- PaIRS_UniNa/icons/sort_reversed.png +0 -0
- PaIRS_UniNa/icons/spiv_proc.png +0 -0
- PaIRS_UniNa/icons/spiv_proc_off.png +0 -0
- PaIRS_UniNa/icons/star.png +0 -0
- PaIRS_UniNa/icons/step_inheritance.png +0 -0
- PaIRS_UniNa/icons/subMIN_off.png +0 -0
- PaIRS_UniNa/icons/subMIN_on.png +0 -0
- PaIRS_UniNa/icons/unedited.png +0 -0
- PaIRS_UniNa/icons/uninitialized.png +0 -0
- PaIRS_UniNa/icons/unlink.png +0 -0
- PaIRS_UniNa/icons/unwrap_items.png +0 -0
- PaIRS_UniNa/icons/vectorColor.png +0 -0
- PaIRS_UniNa/icons/view.png +0 -0
- PaIRS_UniNa/icons/view_off.png +0 -0
- PaIRS_UniNa/icons/vis_logo.png +0 -0
- PaIRS_UniNa/icons/warning_circle.png +0 -0
- PaIRS_UniNa/icons/window.png +0 -0
- PaIRS_UniNa/icons/workspace.png +0 -0
- PaIRS_UniNa/icons/wrap_items.png +0 -0
- PaIRS_UniNa/icons/write_list.png +0 -0
- PaIRS_UniNa/listLib.py +303 -0
- PaIRS_UniNa/mtfPIV.py +8 -8
- PaIRS_UniNa/parForMulti.py +7 -5
- PaIRS_UniNa/parForWorkers.py +370 -31
- PaIRS_UniNa/pivParFor.py +233 -229
- PaIRS_UniNa/plt_util.py +141 -141
- PaIRS_UniNa/preProcParFor.py +153 -148
- PaIRS_UniNa/procTools.py +631 -178
- PaIRS_UniNa/readcfg.py +31 -1
- PaIRS_UniNa/rqrdpckgs.txt +9 -0
- PaIRS_UniNa/stereoPivParFor.py +227 -0
- PaIRS_UniNa/tAVarie.py +215 -215
- PaIRS_UniNa/tabSplitter.py +612 -0
- PaIRS_UniNa/ui_Calibration_Tab.py +545 -0
- PaIRS_UniNa/ui_Custom_Top.py +5 -5
- PaIRS_UniNa/ui_Input_Tab.py +1101 -0
- PaIRS_UniNa/{ui_Import_Tab_CalVi.py → ui_Input_Tab_CalVi.py} +1282 -1275
- PaIRS_UniNa/ui_Log_Tab.py +262 -257
- PaIRS_UniNa/{ui_Export_Tab.py → ui_Output_Tab.py} +2361 -1778
- PaIRS_UniNa/ui_Process_Tab.py +3809 -3758
- PaIRS_UniNa/ui_Process_Tab_CalVi.py +1547 -1546
- PaIRS_UniNa/ui_Process_Tab_Disp.py +1141 -0
- PaIRS_UniNa/ui_Process_Tab_Min.py +437 -0
- PaIRS_UniNa/ui_Vis_Tab.py +1626 -1208
- PaIRS_UniNa/ui_Vis_Tab_CalVi.py +1249 -1249
- PaIRS_UniNa/ui_Whatsnew.py +131 -131
- PaIRS_UniNa/ui_gPairs.py +876 -950
- PaIRS_UniNa/ui_infoPaIRS.py +550 -425
- PaIRS_UniNa/whatsnew.txt +6 -4
- {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/METADATA +69 -51
- pairs_unina-0.2.8.dist-info/RECORD +329 -0
- {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/WHEEL +1 -1
- PaIRS_UniNa/CalVi.py +0 -18
- PaIRS_UniNa/Export_Tab.py +0 -574
- PaIRS_UniNa/Import_Tab.py +0 -657
- PaIRS_UniNa/Import_Tab_CalVi.py +0 -861
- PaIRS_UniNa/Import_Tab_tools.py +0 -598
- PaIRS_UniNa/Tree_Tab.py +0 -543
- PaIRS_UniNa/gCalVi.py +0 -2024
- PaIRS_UniNa/icons/add.png +0 -0
- PaIRS_UniNa/icons/cancelled.png +0 -0
- PaIRS_UniNa/icons/chain.png +0 -0
- PaIRS_UniNa/icons/chain_broken.png +0 -0
- PaIRS_UniNa/icons/default_sizes.png +0 -0
- PaIRS_UniNa/icons/dock_tabs.png +0 -0
- PaIRS_UniNa/icons/done.png +0 -0
- PaIRS_UniNa/icons/down_arrow.png +0 -0
- PaIRS_UniNa/icons/export_logo.png +0 -0
- PaIRS_UniNa/icons/fast_delete.png +0 -0
- PaIRS_UniNa/icons/flip_y.png +0 -0
- PaIRS_UniNa/icons/ganci.png +0 -0
- PaIRS_UniNa/icons/import_blue.png +0 -0
- PaIRS_UniNa/icons/import_logo.png +0 -0
- PaIRS_UniNa/icons/missing.png +0 -0
- PaIRS_UniNa/icons/process_icon.png +0 -0
- PaIRS_UniNa/icons/processing.png +0 -0
- PaIRS_UniNa/icons/restart.png +0 -0
- PaIRS_UniNa/icons/right_arrow.png +0 -0
- PaIRS_UniNa/icons/run_piv.png +0 -0
- PaIRS_UniNa/icons/terminal.png +0 -0
- PaIRS_UniNa/icons/undock_tabs.png +0 -0
- PaIRS_UniNa/icons/vect_field.png +0 -0
- PaIRS_UniNa/icons/w0.png +0 -0
- PaIRS_UniNa/icons/w1.png +0 -0
- PaIRS_UniNa/icons/w2.png +0 -0
- PaIRS_UniNa/icons/w3.png +0 -0
- PaIRS_UniNa/icons/w4.png +0 -0
- PaIRS_UniNa/icons/w5.png +0 -0
- PaIRS_UniNa/run_CalVi.py +0 -14
- PaIRS_UniNa/run_gcalvi.py +0 -5
- PaIRS_UniNa/ui_Import_Tab.py +0 -1077
- PaIRS_UniNa/ui_Tree_Tab.py +0 -684
- PaIRS_UniNa/ui_gCalVi.py +0 -640
- PaIRS_UniNa/ui_infoCalVi.py +0 -428
- PaIRS_UniNa-0.1.13.dist-info/LICENSE +0 -19
- PaIRS_UniNa-0.1.13.dist-info/RECORD +0 -174
- /PaIRS_UniNa/icons/{clean_queue.png → clean.png} +0 -0
- /PaIRS_UniNa/icons/{waiting_c.png → sandglass.png} +0 -0
- {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/top_level.txt +0 -0
PaIRS_UniNa/addwidgets_ps.py
CHANGED
|
@@ -8,6 +8,7 @@ InitCheck=True #False=Collap closed, True=opened
|
|
|
8
8
|
#fonts
|
|
9
9
|
font_italic=True
|
|
10
10
|
font_weight=QFont.DemiBold
|
|
11
|
+
backgroundcolor_none=" background-color: none;"
|
|
11
12
|
backgroundcolor_changing=" background-color: rgb(255,230,230);"
|
|
12
13
|
color_changing="color: rgb(33,33,255); "+backgroundcolor_changing
|
|
13
14
|
color_changing_black="color: rgb(0,0,0); "+backgroundcolor_changing
|
|
@@ -17,7 +18,7 @@ def setSS(b,style):
|
|
|
17
18
|
ss=f"{b.metaObject().className()}{'{'+style+'}'}\\nQToolTip{'{'+b.initialStyle+'}'}"
|
|
18
19
|
return ss
|
|
19
20
|
|
|
20
|
-
class MyTabLabel(
|
|
21
|
+
class MyTabLabel(QLabel):
|
|
21
22
|
def __init__(self,parent):
|
|
22
23
|
super().__init__(parent)
|
|
23
24
|
#self.setCursor(QCursor(QtCore.Qt.PointingHandCursor))
|
|
@@ -27,6 +28,12 @@ class MyTabLabel(QtWidgets.QLabel):
|
|
|
27
28
|
for f in self.addfuncclick:
|
|
28
29
|
self.addfuncclick[f]()
|
|
29
30
|
return super().mousePressEvent(event)
|
|
31
|
+
|
|
32
|
+
def setCustomCursor(self):
|
|
33
|
+
if self.addfuncclick:
|
|
34
|
+
self.setCursor(QCursor(Qt.CursorShape.PointingHandCursor))
|
|
35
|
+
else:
|
|
36
|
+
self.setCursor(QCursor(Qt.CursorShape.ArrowCursor))
|
|
30
37
|
|
|
31
38
|
#MyQLineEdit=QtWidgets.QLineEdit
|
|
32
39
|
class MyQLineEdit(QtWidgets.QLineEdit):
|
|
@@ -57,7 +64,7 @@ class MyQLineEdit(QtWidgets.QLineEdit):
|
|
|
57
64
|
if hasStyleFlag:
|
|
58
65
|
if b.styleFlag: continue
|
|
59
66
|
b.flagS=True
|
|
60
|
-
b.initialStyle=b.styleSheet()
|
|
67
|
+
b.initialStyle=b.styleSheet()+" "+backgroundcolor_none
|
|
61
68
|
b.setEnabled(False)
|
|
62
69
|
b.disabledStyle=b.styleSheet()
|
|
63
70
|
b.setEnabled(True)
|
|
@@ -91,24 +98,32 @@ class MyQLineEdit(QtWidgets.QLineEdit):
|
|
|
91
98
|
super().mouseReleaseEvent(event) #to preserve classical behaviour before adding the below
|
|
92
99
|
self.setCompleterList()
|
|
93
100
|
|
|
101
|
+
def enterEvent(self, event):
|
|
102
|
+
super().enterEvent(event)
|
|
103
|
+
if not self.font()==self.font_changing and not self.hasFocus():
|
|
104
|
+
self.setFont(self.font_changing)
|
|
105
|
+
|
|
106
|
+
def leaveEvent(self, event):
|
|
107
|
+
super().leaveEvent(event)
|
|
108
|
+
if self.font()==self.font_changing and not self.hasFocus():
|
|
109
|
+
self.setFont(self.initialFont)
|
|
110
|
+
|
|
94
111
|
def focusInEvent(self, event):
|
|
95
112
|
super().focusInEvent(event)
|
|
96
113
|
for f in self.addfuncin:
|
|
97
114
|
self.addfuncin[f]()
|
|
98
115
|
self.focusInFun()
|
|
99
|
-
|
|
116
|
+
|
|
100
117
|
def setFocus(self):
|
|
101
118
|
super().setFocus()
|
|
102
119
|
self.focusInFun()
|
|
103
120
|
|
|
104
121
|
def focusInFun(self):
|
|
105
|
-
self.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
if (not b==self) and b.flagS:
|
|
111
|
-
b.setStyleSheet(b.initialStyle+" "+color_changing_black)
|
|
122
|
+
self.setStyleSheet(setSS(self,self.initialStyle+" "+color_changing))
|
|
123
|
+
self.setFont(self.font_changing)
|
|
124
|
+
for b in self.bros:
|
|
125
|
+
if (not b==self) and b.flagS:
|
|
126
|
+
b.setStyleSheet(b.initialStyle+" "+color_changing_black)
|
|
112
127
|
|
|
113
128
|
def focusOutEvent(self, event):
|
|
114
129
|
super().focusOutEvent(event) #to preserve classical behaviour before adding the below
|
|
@@ -121,12 +136,14 @@ class MyQLineEdit(QtWidgets.QLineEdit):
|
|
|
121
136
|
self.focusOutFun()
|
|
122
137
|
|
|
123
138
|
def focusOutFun(self):
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if b
|
|
139
|
+
for b in self.bros:
|
|
140
|
+
if b.flagS:
|
|
141
|
+
if hasattr(b,'default_stylesheet'):
|
|
142
|
+
b.setStyleSheet(b.default_stylesheet)
|
|
143
|
+
else:
|
|
127
144
|
b.setStyleSheet(setSS(b,b.initialStyle))
|
|
128
|
-
|
|
129
|
-
|
|
145
|
+
if b.flagF:
|
|
146
|
+
b.setFont(b.initialFont)
|
|
130
147
|
#self.addlab.clear()
|
|
131
148
|
|
|
132
149
|
def showCompleter(self):
|
|
@@ -140,13 +157,13 @@ class MyQLineEditNumber(MyQLineEdit):
|
|
|
140
157
|
|
|
141
158
|
def keyPressEvent(self, event):
|
|
142
159
|
#infoPrint.white(event.key())
|
|
143
|
-
if event.key() in (
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
160
|
+
if event.key() in (Qt.Key.Key_Space, #space
|
|
161
|
+
Qt.Key.Key_Comma, #comma
|
|
162
|
+
Qt.Key.Key_Delete, Qt.Key.Key_Backspace, #del, backspace
|
|
163
|
+
Qt.Key.Key_Left,Qt.Key.Key_Right, #left, right
|
|
164
|
+
Qt.Key.Key_Return, Qt.Key.Key_Enter #return
|
|
148
165
|
) \
|
|
149
|
-
or (event.key()>=
|
|
166
|
+
or (event.key()>=Qt.Key.Key_0 and event.key()<=Qt.Key.Key_9):
|
|
150
167
|
super().keyPressEvent(event)
|
|
151
168
|
if event.key()==16777220:
|
|
152
169
|
for f in self.addfuncreturn:
|
|
@@ -179,7 +196,7 @@ class MyQSpin(QtWidgets.QSpinBox):
|
|
|
179
196
|
self.bros=[self]+self.addwid
|
|
180
197
|
for b in self.bros:
|
|
181
198
|
if b.styleFlag: continue
|
|
182
|
-
b.initialStyle=b.styleSheet()
|
|
199
|
+
b.initialStyle=b.styleSheet()+" "+backgroundcolor_none
|
|
183
200
|
b.initialFont=b.font()
|
|
184
201
|
b.font_changing=font_changing
|
|
185
202
|
b.styleFlag=True
|
|
@@ -219,7 +236,7 @@ class MyQSpin(QtWidgets.QSpinBox):
|
|
|
219
236
|
|
|
220
237
|
def keyPressEvent(self, event):
|
|
221
238
|
super().keyPressEvent(event)
|
|
222
|
-
if event.key() in (
|
|
239
|
+
if event.key() in (Qt.Key.Key_Return,Qt.Key.Key_Enter) and self.hasFocus():
|
|
223
240
|
for f in self.addfuncreturn:
|
|
224
241
|
self.addfuncreturn[f]()
|
|
225
242
|
|
|
@@ -227,12 +244,15 @@ class MyQSpin(QtWidgets.QSpinBox):
|
|
|
227
244
|
event.ignore()
|
|
228
245
|
|
|
229
246
|
def textFromValue(self, value):
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
247
|
+
return formatNumber(self,value)
|
|
248
|
+
|
|
249
|
+
def formatNumber(self:QWidget,value):
|
|
250
|
+
if Flag_GROUPSEPARATOR:
|
|
251
|
+
text=self.locale().toString(float(value), 'd')
|
|
252
|
+
else:
|
|
253
|
+
text=f"{value:f}"
|
|
254
|
+
return (text).rstrip('0').rstrip(curr_locale.decimalPoint())
|
|
255
|
+
#return ('%f' % value).rstrip('0').rstrip('.')
|
|
236
256
|
|
|
237
257
|
class MyQSpinXW(MyQSpin):
|
|
238
258
|
def __init__(self,parent):
|
|
@@ -270,7 +290,7 @@ class MyQDoubleSpin(QtWidgets.QDoubleSpinBox):
|
|
|
270
290
|
self.bros=[self]+self.addwid
|
|
271
291
|
for b in self.bros:
|
|
272
292
|
if self.styleFlag: continue
|
|
273
|
-
b.initialStyle=b.styleSheet()
|
|
293
|
+
b.initialStyle=b.styleSheet()+" "+backgroundcolor_none
|
|
274
294
|
b.initialFont=b.font()
|
|
275
295
|
b.font_changing=font_changing
|
|
276
296
|
b.styleFlag=True
|
|
@@ -303,7 +323,7 @@ class MyQDoubleSpin(QtWidgets.QDoubleSpinBox):
|
|
|
303
323
|
|
|
304
324
|
def keyPressEvent(self, event):
|
|
305
325
|
super().keyPressEvent(event)
|
|
306
|
-
if event.key() in (
|
|
326
|
+
if event.key() in (Qt.Key.Key_Return,Qt.Key.Key_Enter) and self.hasFocus():
|
|
307
327
|
for f in self.addfuncreturn:
|
|
308
328
|
self.addfuncreturn[f]()
|
|
309
329
|
|
|
@@ -325,7 +345,11 @@ class CollapsibleBox(QtWidgets.QWidget):
|
|
|
325
345
|
self.FlagPush=False
|
|
326
346
|
self.dpix=5
|
|
327
347
|
self.toolMinimumWidth=400
|
|
328
|
-
|
|
348
|
+
self.toolHeight=20
|
|
349
|
+
self.content_area:QGroupBox=None
|
|
350
|
+
self.toggle_button:QPushButton=None
|
|
351
|
+
self.push_button:MyToolButton=None
|
|
352
|
+
|
|
329
353
|
def setup(self,*args):
|
|
330
354
|
if not self.initFlag:
|
|
331
355
|
if len(args):
|
|
@@ -335,11 +359,21 @@ class CollapsibleBox(QtWidgets.QWidget):
|
|
|
335
359
|
self.ind=-1
|
|
336
360
|
self.stretch=0
|
|
337
361
|
self.initFlag=True
|
|
338
|
-
self.toggle_button=self.findChild(QtWidgets.QToolButton)
|
|
339
|
-
self.content_area=self.findChild(QtWidgets.QGroupBox)
|
|
340
|
-
self.push_button=self.findChild(MyToolButton)
|
|
341
362
|
|
|
363
|
+
if self.content_area is None:
|
|
364
|
+
self.content_area=self.findChild(QtWidgets.QGroupBox)
|
|
342
365
|
self.content_area.setStyleSheet("QGroupBox{border: 1px solid gray; border-radius: 6px;}")
|
|
366
|
+
|
|
367
|
+
if self.toggle_button is None:
|
|
368
|
+
self.toggle_button=self.findChild(QtWidgets.QToolButton)
|
|
369
|
+
self.toggle_button.setChecked(InitCheck)
|
|
370
|
+
self.toggle_button.clicked.connect(self.on_click)
|
|
371
|
+
self.toggle_button.setCursor(QtCore.Qt.CursorShape.PointingHandCursor)
|
|
372
|
+
self.toggle_button.setMinimumWidth(self.toolMinimumWidth)
|
|
373
|
+
|
|
374
|
+
if self.push_button is None:
|
|
375
|
+
self.push_button=self.findChild(MyToolButton)
|
|
376
|
+
|
|
343
377
|
self.OpenStyle=\
|
|
344
378
|
"QToolButton { border: none; }\n"+\
|
|
345
379
|
"QToolButton::hover{color: rgba(0,0,255,200);}"+\
|
|
@@ -349,21 +383,19 @@ class CollapsibleBox(QtWidgets.QWidget):
|
|
|
349
383
|
"QToolButton { border: 1px solid lightgray; border-radius: 6px }\n"+\
|
|
350
384
|
"QToolButton::hover{ border: 1px solid rgba(0,0,255,200); border-radius: 6px; color: rgba(0,0,255,200);}"+\
|
|
351
385
|
"QToolButton::focus{ border: 1px solid rgba(0,0,255,200); border-radius: 6px; color: rgba(0,0,255,200);}" #background-color: rgba(0, 0,128,32); }"
|
|
352
|
-
self.toggle_button.setCursor(QtCore.Qt.CursorShape.PointingHandCursor)
|
|
353
|
-
self.toggle_button.setMinimumWidth(self.toolMinimumWidth)
|
|
354
386
|
|
|
355
387
|
self.heightToogle=self.toggle_button.minimumHeight()
|
|
356
388
|
self.heightOpened=self.minimumHeight()
|
|
357
|
-
self.heightArea=self.heightOpened-
|
|
358
|
-
self.toggle_button.clicked.connect(self.on_click)
|
|
359
|
-
self.toggle_button.setChecked(InitCheck)
|
|
389
|
+
self.heightArea=self.heightOpened-self.toolHeight
|
|
360
390
|
|
|
361
391
|
self.on_click()
|
|
362
|
-
|
|
363
392
|
|
|
364
393
|
#@QtCore.pyqtSlot()
|
|
365
394
|
def on_click(self):
|
|
366
395
|
checked = self.toggle_button.isChecked()
|
|
396
|
+
pri.Coding.yellow(f'>>>>> {self.objectName()} {"opening" if checked else "closing"}')
|
|
397
|
+
if self.objectName()=='CollapBox_ImSet' and checked:
|
|
398
|
+
pass
|
|
367
399
|
if self.FlagPush:
|
|
368
400
|
self.push_button.show()
|
|
369
401
|
else:
|
|
@@ -405,6 +437,11 @@ class CollapsibleBox(QtWidgets.QWidget):
|
|
|
405
437
|
|
|
406
438
|
if self.ind>0:
|
|
407
439
|
self.parent().layout().setStretch(self.ind,0)
|
|
440
|
+
|
|
441
|
+
# Forza l'aggiornamento dei layout
|
|
442
|
+
self.updateGeometry()
|
|
443
|
+
self.parentWidget().updateGeometry()
|
|
444
|
+
self.parentWidget().adjustSize()
|
|
408
445
|
|
|
409
446
|
def openBox(self):
|
|
410
447
|
self.toggle_button.setChecked(True)
|
|
@@ -413,6 +450,7 @@ class CollapsibleBox(QtWidgets.QWidget):
|
|
|
413
450
|
def closeBox(self):
|
|
414
451
|
self.toggle_button.setChecked(False)
|
|
415
452
|
self.on_click()
|
|
453
|
+
|
|
416
454
|
class myQTreeWidget(QTreeWidget):
|
|
417
455
|
def __init__(self,parent):
|
|
418
456
|
super().__init__(parent)
|
|
@@ -440,15 +478,15 @@ class myQTreeWidget(QTreeWidget):
|
|
|
440
478
|
self.addfuncout[f]()
|
|
441
479
|
|
|
442
480
|
def keyPressEvent(self, event):
|
|
443
|
-
if event.key() ==
|
|
481
|
+
if event.key() == Qt.Key.Key_Shift:
|
|
444
482
|
super().keyPressEvent(event)
|
|
445
483
|
for f in self.addfuncshift_pressed:
|
|
446
484
|
self.addfuncshift_pressed[f]()
|
|
447
|
-
elif event.key() ==
|
|
485
|
+
elif event.key() == Qt.Key.Key_Delete or event.key() == Qt.Key.Key_Backspace:
|
|
448
486
|
super().keyPressEvent(event)
|
|
449
487
|
for f in self.addfuncdel_pressed:
|
|
450
488
|
self.addfuncdel_pressed[f]()
|
|
451
|
-
elif event.key() ==
|
|
489
|
+
elif event.key() == Qt.Key.Key_Up or event.key() == Qt.Key.Key_Down:
|
|
452
490
|
if self.FlagArrowKeysNormal:
|
|
453
491
|
return super().keyPressEvent(event)
|
|
454
492
|
else:
|
|
@@ -500,7 +538,7 @@ class myQSplitter(QSplitter):
|
|
|
500
538
|
|
|
501
539
|
class RichTextPushButton(QPushButton):
|
|
502
540
|
margin=0
|
|
503
|
-
spacing=
|
|
541
|
+
spacing=0
|
|
504
542
|
|
|
505
543
|
def __init__(self, parent=None, text=None):
|
|
506
544
|
if parent is not None:
|
|
@@ -514,19 +552,17 @@ class RichTextPushButton(QPushButton):
|
|
|
514
552
|
self.setLayout(self.__lyt)
|
|
515
553
|
|
|
516
554
|
self.__icon= QLabel(self)
|
|
517
|
-
self.__icon.setAttribute(Qt.WA_TranslucentBackground)
|
|
518
|
-
self.__icon.setAttribute(Qt.WA_TransparentForMouseEvents)
|
|
519
555
|
self.__icon.setSizePolicy(
|
|
520
556
|
QSizePolicy.Preferred,
|
|
521
557
|
QSizePolicy.Expanding,
|
|
522
558
|
)
|
|
523
|
-
self.__icon.setTextFormat(Qt.RichText)
|
|
524
559
|
self.__icon.setAlignment(QtCore.Qt.AlignCenter | QtCore.Qt.AlignVCenter)
|
|
525
|
-
|
|
526
560
|
|
|
527
561
|
self.__lbl = QLabel(self)
|
|
528
562
|
if text is not None:
|
|
529
563
|
self.__lbl.setText(text)
|
|
564
|
+
else:
|
|
565
|
+
self.__lbl.hide()
|
|
530
566
|
self.__lbl.setAttribute(Qt.WA_TranslucentBackground)
|
|
531
567
|
self.__lbl.setAttribute(Qt.WA_TransparentForMouseEvents)
|
|
532
568
|
self.__lbl.setSizePolicy(
|
|
@@ -536,17 +572,21 @@ class RichTextPushButton(QPushButton):
|
|
|
536
572
|
self.__lbl.setTextFormat(Qt.RichText)
|
|
537
573
|
self.__lbl.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
|
|
538
574
|
|
|
539
|
-
self.__lyt.addItem(QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Expanding))
|
|
540
575
|
self.__lyt.addWidget(self.__icon)
|
|
541
576
|
self.__lyt.addWidget(self.__lbl)
|
|
542
|
-
self.__lyt.
|
|
577
|
+
self.__lyt.setStretch(0,1)
|
|
578
|
+
self.__lyt.setStretch(1,2)
|
|
543
579
|
|
|
580
|
+
self.lyt=self.__lyt
|
|
544
581
|
self.lbl=self.__lbl
|
|
545
582
|
self.icn=None
|
|
546
583
|
return
|
|
547
584
|
|
|
548
585
|
def setText(self, text):
|
|
549
|
-
|
|
586
|
+
if text:
|
|
587
|
+
self.__lbl.show()
|
|
588
|
+
self.__lbl.setText(text)
|
|
589
|
+
else: self.__lbl.hide()
|
|
550
590
|
self.updateGeometry()
|
|
551
591
|
return
|
|
552
592
|
|
|
@@ -557,6 +597,11 @@ class RichTextPushButton(QPushButton):
|
|
|
557
597
|
self.icn=icon
|
|
558
598
|
self.updateGeometry()
|
|
559
599
|
return
|
|
600
|
+
|
|
601
|
+
def setIconSize(self, size:QSize):
|
|
602
|
+
if self.icn: self.__icon.setPixmap(self.icn.pixmap(size))
|
|
603
|
+
self.updateGeometry()
|
|
604
|
+
return
|
|
560
605
|
|
|
561
606
|
def sizeHint(self):
|
|
562
607
|
s = QPushButton.sizeHint(self)
|
|
@@ -567,7 +612,6 @@ class RichTextPushButton(QPushButton):
|
|
|
567
612
|
s.setHeight(w_lbl.height())
|
|
568
613
|
return s
|
|
569
614
|
|
|
570
|
-
|
|
571
615
|
class myQTableWidget(QtWidgets.QTableWidget):
|
|
572
616
|
def __init__(self,parent):
|
|
573
617
|
super().__init__(parent)
|
|
@@ -582,7 +626,7 @@ class myQTableWidget(QtWidgets.QTableWidget):
|
|
|
582
626
|
def keyPressEvent(self, event):
|
|
583
627
|
#infoPrint.white(event.key())
|
|
584
628
|
super().keyPressEvent(event)
|
|
585
|
-
if event.key()
|
|
629
|
+
if event.key() in (Qt.Key.Key_Return,Qt.Key.Key_Enter): #return
|
|
586
630
|
for f in self.addfuncreturn:
|
|
587
631
|
self.addfuncreturn[f]()
|
|
588
632
|
|
|
@@ -606,7 +650,7 @@ class myQTableWidget(QtWidgets.QTableWidget):
|
|
|
606
650
|
self.resizeInfoLabel()
|
|
607
651
|
|
|
608
652
|
def resizeInfoLabel(self):
|
|
609
|
-
if self.InfoLabel:
|
|
653
|
+
if self.InfoLabel and (True if not self.addwid else not self.addwid[0].hasFocus()):
|
|
610
654
|
item=self.currentItem()
|
|
611
655
|
if item:
|
|
612
656
|
self.InfoLabel.show()
|
|
@@ -633,6 +677,167 @@ def isfloat(num):
|
|
|
633
677
|
except ValueError:
|
|
634
678
|
return False
|
|
635
679
|
|
|
680
|
+
class ClickableLabel(QLabel):
|
|
681
|
+
pixmap_size=25
|
|
682
|
+
def __init__(self, *args):
|
|
683
|
+
super().__init__(*args)
|
|
684
|
+
|
|
685
|
+
self.default_stylesheet = self.styleSheet()
|
|
686
|
+
self.highlight_stylesheet = "background-color: #dcdcdc; border-radius: 3px;"
|
|
687
|
+
|
|
688
|
+
self.timer = QTimer(self)
|
|
689
|
+
self.timer.timeout.connect(self.resetHighlight)
|
|
690
|
+
self.timer.setSingleShot(True)
|
|
691
|
+
|
|
692
|
+
self.moviePixmap=None
|
|
693
|
+
|
|
694
|
+
def mousePressEvent(self, event):
|
|
695
|
+
if event.button() == Qt.LeftButton and self.toolTip():
|
|
696
|
+
self.highlight()
|
|
697
|
+
self.showMessageBox()
|
|
698
|
+
self.resetHighlight()
|
|
699
|
+
|
|
700
|
+
def showMessageBox(self):
|
|
701
|
+
if self.moviePixmap: pixmap=self.moviePixmap
|
|
702
|
+
else: pixmap=self.pixmap()
|
|
703
|
+
warningDialog(self.window(),Message=self.toolTip(),pixmap=pixmap,title='Info')
|
|
704
|
+
|
|
705
|
+
def highlight(self):
|
|
706
|
+
self.setStyleSheet(self.highlight_stylesheet)
|
|
707
|
+
self.repaint()
|
|
708
|
+
|
|
709
|
+
def resetHighlight(self):
|
|
710
|
+
self.setStyleSheet(self.default_stylesheet)
|
|
711
|
+
|
|
712
|
+
def setToolTip(self,arg__1):
|
|
713
|
+
QLabel.setToolTip(self,arg__1)
|
|
714
|
+
QLabel.setStatusTip(self,arg__1)
|
|
715
|
+
if arg__1:
|
|
716
|
+
self.setCursor(QCursor(Qt.CursorShape.PointingHandCursor))
|
|
717
|
+
else:
|
|
718
|
+
self.setCursor(QCursor(Qt.CursorShape.ArrowCursor))
|
|
719
|
+
|
|
720
|
+
class ClickableEditLabel(ClickableLabel):
|
|
721
|
+
def setup(self):
|
|
722
|
+
line_edit=QLineEdit(self)
|
|
723
|
+
line_edit.setPalette(self.palette())
|
|
724
|
+
line_edit_bg_color_str = line_edit.palette().color(QPalette.ColorRole.Base).name()
|
|
725
|
+
self.default_stylesheet=self.styleSheet()+f"ClickableEditLabel{{background-color: {line_edit_bg_color_str}}};"
|
|
726
|
+
self.setStyleSheet(self.default_stylesheet)
|
|
727
|
+
line_edit.setParent(None)
|
|
728
|
+
|
|
729
|
+
class CustomLineEdit(QLineEdit):
|
|
730
|
+
cancelEditing = Signal()
|
|
731
|
+
|
|
732
|
+
def __init__(self, text, parent=None):
|
|
733
|
+
super().__init__(text, parent)
|
|
734
|
+
self.originalText = text
|
|
735
|
+
|
|
736
|
+
def focusOutEvent(self, event):
|
|
737
|
+
self.cancelEditing.emit()
|
|
738
|
+
super().focusOutEvent(event)
|
|
739
|
+
|
|
740
|
+
def keyPressEvent(self, event):
|
|
741
|
+
if event.key() == Qt.Key.Key_Escape:
|
|
742
|
+
self.cancelEditing.emit()
|
|
743
|
+
else:
|
|
744
|
+
super().keyPressEvent(event)
|
|
745
|
+
|
|
746
|
+
def keyReleaseEvent(self, event):
|
|
747
|
+
if event.key() == Qt.Key.Key_Escape:
|
|
748
|
+
self.cancelEditing.emit()
|
|
749
|
+
else:
|
|
750
|
+
super().keyReleaseEvent(event)
|
|
751
|
+
|
|
752
|
+
class ResizingLabel(QLabel):
|
|
753
|
+
def __init__(self,*args,**kwargs):
|
|
754
|
+
super().__init__(*args,**kwargs)
|
|
755
|
+
self.complete_text=self.text()
|
|
756
|
+
|
|
757
|
+
def setText(self,text):
|
|
758
|
+
self.complete_text=text
|
|
759
|
+
self.resizeText(text)
|
|
760
|
+
return
|
|
761
|
+
|
|
762
|
+
def resizeEvent(self, event: QResizeEvent) -> None:
|
|
763
|
+
super().resizeEvent(event)
|
|
764
|
+
self.resizeText(self.text())
|
|
765
|
+
return
|
|
766
|
+
|
|
767
|
+
def resizeText(self,text):
|
|
768
|
+
text=self.complete_text
|
|
769
|
+
metrics = QFontMetrics(self.font())
|
|
770
|
+
if self.alignment() & Qt.AlignmentFlag.AlignRight:
|
|
771
|
+
FlagRight=True
|
|
772
|
+
textElideMode=Qt.TextElideMode.ElideLeft
|
|
773
|
+
else:
|
|
774
|
+
FlagRight=False
|
|
775
|
+
textElideMode=Qt.TextElideMode.ElideRight
|
|
776
|
+
if "<span" in text:
|
|
777
|
+
match = re.search(r"<span(.*?)</span>", text)
|
|
778
|
+
html_part = "<span"+match.group(1)+"</span>"
|
|
779
|
+
index = match.start(1)-5
|
|
780
|
+
text_without_bullet=text.replace(html_part,'')
|
|
781
|
+
truncated_text=metrics.elidedText(text_without_bullet, textElideMode, self.width()-5)
|
|
782
|
+
if FlagRight:
|
|
783
|
+
index=len(truncated_text)-3*(int('...' in truncated_text))-len(text_without_bullet[index:])
|
|
784
|
+
if index>0:
|
|
785
|
+
truncated_text=truncated_text[:index]+html_part+truncated_text[index:]
|
|
786
|
+
elif index>len(truncated_text)-3:
|
|
787
|
+
truncated_text=truncated_text[:index]+html_part+truncated_text[index:]
|
|
788
|
+
else:
|
|
789
|
+
truncated_text = metrics.elidedText(text, textElideMode, self.width())
|
|
790
|
+
super().setText(truncated_text)
|
|
791
|
+
|
|
792
|
+
class EditableLabel(QWidget):
|
|
793
|
+
def __init__(self, parent=None):
|
|
794
|
+
super().__init__(parent)
|
|
795
|
+
|
|
796
|
+
self.main_layout = QVBoxLayout(self)
|
|
797
|
+
self.main_layout.setContentsMargins(0,0,0,0)
|
|
798
|
+
self.main_layout.setSpacing(0)
|
|
799
|
+
|
|
800
|
+
self.label = ResizingLabel(self)
|
|
801
|
+
self.label.setAlignment(Qt.AlignmentFlag.AlignLeft)
|
|
802
|
+
self.label.mouseDoubleClickEvent = self.enable_editing
|
|
803
|
+
|
|
804
|
+
self.edit = CustomLineEdit(self)
|
|
805
|
+
self.edit.setAlignment(Qt.AlignmentFlag.AlignLeft)
|
|
806
|
+
self.edit.hide()
|
|
807
|
+
self.edit.editingFinished.connect(self.disable_editing)
|
|
808
|
+
self.edit.cancelEditing.connect(self.disable_editing)
|
|
809
|
+
self.updateLabel=lambda: None
|
|
810
|
+
self.bullet=''
|
|
811
|
+
|
|
812
|
+
self.installEventFilter(self) # Installare il filtro eventi
|
|
813
|
+
|
|
814
|
+
self.main_layout.addWidget(self.label)
|
|
815
|
+
self.main_layout.addWidget(self.edit)
|
|
816
|
+
|
|
817
|
+
def setText(self,text):
|
|
818
|
+
self.label.setText(text)
|
|
819
|
+
self.edit.setText(text)
|
|
820
|
+
|
|
821
|
+
def setFont(self,font:QFont):
|
|
822
|
+
self.label.setFont(font)
|
|
823
|
+
self.edit.setFont(font)
|
|
824
|
+
|
|
825
|
+
def enable_editing(self, event):
|
|
826
|
+
self.label.hide()
|
|
827
|
+
self.edit.setGeometry(self.label.geometry()) # Assicurati che l'editor prenda la posizione della label
|
|
828
|
+
self.edit.setText(self.label.text().replace(self.bullet,'')) # Assicurati che il testo corrente venga impostato nell'editor
|
|
829
|
+
self.edit.selectAll()
|
|
830
|
+
self.edit.show()
|
|
831
|
+
self.window().setFocus()
|
|
832
|
+
self.edit.setFocus()
|
|
833
|
+
|
|
834
|
+
def disable_editing(self):
|
|
835
|
+
self.edit.hide()
|
|
836
|
+
self.label.setText(self.edit.text())
|
|
837
|
+
self.label.show()
|
|
838
|
+
self.updateLabel()
|
|
839
|
+
|
|
840
|
+
|
|
636
841
|
#********************************************* Matplotlib
|
|
637
842
|
import io
|
|
638
843
|
import matplotlib as mpl
|
|
@@ -662,6 +867,17 @@ class MplCanvas(FigureCanvasQTAgg):
|
|
|
662
867
|
#clrgb=[int(i*255) for i in color_tuple]
|
|
663
868
|
self.fig.set_facecolor(color_tuple)
|
|
664
869
|
|
|
870
|
+
self.copyIcon=QIcon(icons_path+"copy.png")
|
|
871
|
+
self.openNewWindowIcon=QIcon(icons_path+"open_new_window.png")
|
|
872
|
+
self.scaleDownIcon=QIcon(icons_path+"scale_down.png")
|
|
873
|
+
self.scaleUpIcon=QIcon(icons_path+"scale_up.png")
|
|
874
|
+
self.scaleAllIcon=QIcon(icons_path+"scale_all.png")
|
|
875
|
+
self.showAllIcon=QIcon(icons_path+"show_all.png")
|
|
876
|
+
self.alignAllIcon=QIcon(icons_path+"align_all.png")
|
|
877
|
+
self.closeAllIcon=QIcon(icons_path+"close_all.png")
|
|
878
|
+
self.loadImageIcon=QIcon(icons_path+"open_image.png")
|
|
879
|
+
self.loadResultIcon=QIcon(icons_path+"open_result.png")
|
|
880
|
+
|
|
665
881
|
super(MplCanvas, self).__init__(self.fig)
|
|
666
882
|
|
|
667
883
|
def mouseReleaseEvent(self, event):
|
|
@@ -721,7 +937,7 @@ class MplCanvas(FigureCanvasQTAgg):
|
|
|
721
937
|
fig2.scaleFactor=min([fig2.scaleFactor,1.5])
|
|
722
938
|
fig2.scaleFactor=max([fig2.scaleFactor,0.5])
|
|
723
939
|
fig2.setFixedSize(s0*fig2.scaleFactor)
|
|
724
|
-
lbl.setPixmap(pixmap.scaled(pixmap.size()*fig2.scaleFactor))
|
|
940
|
+
lbl.setPixmap(pixmap.scaled(pixmap.size()*fig2.scaleFactor,mode=Qt.TransformationMode.SmoothTransformation))
|
|
725
941
|
return
|
|
726
942
|
fig2.resizeFig2=resizeFig2
|
|
727
943
|
|
|
@@ -781,7 +997,17 @@ class MplCanvas(FigureCanvasQTAgg):
|
|
|
781
997
|
showAll = contextMenu.addAction("Show all ("+QS_showAll.key().toString(QKeySequence.NativeText)+")")
|
|
782
998
|
alignAll = contextMenu.addAction("Align all ("+QS_alignAll.key().toString(QKeySequence.NativeText)+")")
|
|
783
999
|
closeAll = contextMenu.addAction("Close all ("+QS_closeAll.key().toString(QKeySequence.NativeText)+")")
|
|
1000
|
+
|
|
1001
|
+
copy2clipboard.setIcon(self.copyIcon)
|
|
1002
|
+
scaleDown.setIcon(self.scaleDownIcon)
|
|
1003
|
+
scaleUp.setIcon(self.scaleUpIcon)
|
|
1004
|
+
scaleAll.setIcon(self.scaleAllIcon)
|
|
1005
|
+
showAll.setIcon(self.showAllIcon)
|
|
1006
|
+
alignAll.setIcon(self.alignAllIcon)
|
|
1007
|
+
closeAll.setIcon(self.closeAllIcon)
|
|
1008
|
+
|
|
784
1009
|
action = contextMenu.exec(fig2.mapToGlobal(event.pos()))
|
|
1010
|
+
|
|
785
1011
|
if action == copy2clipboard:
|
|
786
1012
|
fCopy2clipboard()
|
|
787
1013
|
elif action == scaleDown:
|
|
@@ -861,3 +1087,47 @@ class MplCanvas(FigureCanvasQTAgg):
|
|
|
861
1087
|
self.showAll()
|
|
862
1088
|
|
|
863
1089
|
|
|
1090
|
+
def setAppGuiPalette(self:QWidget,palette:QPalette=None):
|
|
1091
|
+
applic:QApplication
|
|
1092
|
+
if hasattr(self,'app'):
|
|
1093
|
+
applic=self.app
|
|
1094
|
+
else:
|
|
1095
|
+
return
|
|
1096
|
+
if palette==None:
|
|
1097
|
+
palette=applic.style().standardPalette()
|
|
1098
|
+
else:
|
|
1099
|
+
applic.setPalette(palette)
|
|
1100
|
+
|
|
1101
|
+
try:
|
|
1102
|
+
if self.focusWidget():
|
|
1103
|
+
self.focusWidget().clearFocus()
|
|
1104
|
+
widgets=[self]
|
|
1105
|
+
if hasattr(self,'FloatingTabs'): widgets+=self.FloatingTabs
|
|
1106
|
+
if hasattr(self,'FloatingWindows'): widgets+=self.FloatingWindows
|
|
1107
|
+
if hasattr(self,'aboutDialog'): widgets.append(self.aboutDialog)
|
|
1108
|
+
if hasattr(self,'logChanges'): widgets.append(self.logChanges)
|
|
1109
|
+
widgets+=self.findChildren(QDialog)
|
|
1110
|
+
for f in widgets:
|
|
1111
|
+
if f and isinstance(f, QWidget):
|
|
1112
|
+
f.setPalette(palette)
|
|
1113
|
+
for c in f.findChildren(QObject):
|
|
1114
|
+
if hasattr(c,'setPalette') and not isinstance(c, (MplCanvas, mplFigure, QStatusBar)):
|
|
1115
|
+
c.setPalette(palette)
|
|
1116
|
+
if hasattr(c,'initialStyle') and hasattr(c, 'setStyleSheet'):
|
|
1117
|
+
c.setStyleSheet(c.initialStyle)
|
|
1118
|
+
for c in f.findChildren(QObject):
|
|
1119
|
+
c:MyQLineEdit
|
|
1120
|
+
if isinstance(c, MyQLineEdit) and hasattr(c, 'setup'):
|
|
1121
|
+
c.initFlag=False
|
|
1122
|
+
c.styleFlag=False
|
|
1123
|
+
c.setup()
|
|
1124
|
+
for c in f.findChildren(QObject):
|
|
1125
|
+
if hasattr(c,'setup2'):
|
|
1126
|
+
c.initFlag2=False
|
|
1127
|
+
c.setup2()
|
|
1128
|
+
if hasattr(self,'ResizePopup'):
|
|
1129
|
+
if self.ResizePopup is not None:
|
|
1130
|
+
self.ResizePopup=type(self.ResizePopup)(self.buttonSizeCallbacks) #non riesco a farlo come gli altri
|
|
1131
|
+
if hasattr(self,'w_Vis'): self.w_Vis.addPlotToolBar()
|
|
1132
|
+
except:
|
|
1133
|
+
pri.Error.red("***** Error while setting the application palette! *****")
|