cast to Qt.AlignmentFlag when setAlignment includeds an OR
This commit is contained in:
11
base.py
11
base.py
@@ -2068,7 +2068,8 @@ class BaseWindow(QMainWindow):
|
||||
<p style='color:black; font-weight:bold;
|
||||
font-size:20px; margin-right:22px;'>
|
||||
This message will self-destruct in {1} seconds<br></p>
|
||||
""".format(appname, round(delay)), Qt.AlignCenter | Qt.AlignTop)
|
||||
""".format(appname, round(delay)),
|
||||
Qt.AlignmentFlag(Qt.AlignCenter|Qt.AlignTop))
|
||||
width = 860 + (len(appname)-10)*15
|
||||
height = 220
|
||||
self.splash_screen.resize(width, height)
|
||||
@@ -2122,7 +2123,8 @@ class BaseWindow(QMainWindow):
|
||||
{1:>2} second{2} remaining<br></p>
|
||||
""".format(self.splash_appname, seconds_remaining, sec_str)
|
||||
|
||||
self.splash_screen.showMessage(mess, Qt.AlignCenter|Qt.AlignTop)
|
||||
self.splash_screen.showMessage(
|
||||
mess, Qt.AlignmentFlag(Qt.AlignCenter|Qt.AlignTop))
|
||||
self.processEvents()
|
||||
#print(val, seconds_remaining)
|
||||
|
||||
@@ -2135,7 +2137,7 @@ class BaseWindow(QMainWindow):
|
||||
def initialize_finished(self, myapp):
|
||||
self.splash_timer.stop()
|
||||
self.splash_progressbar.setValue(100)
|
||||
time.sleep(1.5)
|
||||
time.sleep(0.4)
|
||||
#app.processEvents()
|
||||
self.splash_screen.showMessage(
|
||||
"""
|
||||
@@ -2148,7 +2150,8 @@ class BaseWindow(QMainWindow):
|
||||
Ready....
|
||||
|
||||
<br></p>
|
||||
""".format(self.splash_appname), Qt.AlignCenter | Qt.AlignTop)
|
||||
""".format(self.splash_appname),
|
||||
Qt.AlignmentFlag(Qt.AlignCenter | Qt.AlignTop))
|
||||
self.splash_screen.finish(myapp)
|
||||
|
||||
|
||||
|
||||
218
guiframe.py
218
guiframe.py
@@ -118,7 +118,8 @@ class GUIFrame(QWidget):
|
||||
self.measurement_wgt = QWidget()
|
||||
#self.measurement_layout = QHBoxLayout(self.measurement_wgt)
|
||||
self.measurement_layout = QGridLayout(self.measurement_wgt)
|
||||
self.measurement_layout.setAlignment(Qt.AlignLeft | Qt.AlignTop)
|
||||
self.measurement_layout.setAlignment(
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignTop))
|
||||
self.measurement_layout.setSpacing(50)
|
||||
self.measurement_tab_wgt = QTabWidget(self.measurement_wgt)
|
||||
self.measurement_tab_wgt.setMinimumWidth(480)
|
||||
@@ -601,8 +602,8 @@ class GUIFrame(QWidget):
|
||||
self.output_parameters_group_box.setMaximumWidth(300)
|
||||
#self.output_parameters_group_box.setMaximumHeight(400)
|
||||
self.output_parameters_group_box.setFont(self.font_gui)
|
||||
self.output_parameters_group_box.setAlignment(Qt.AlignTop |
|
||||
Qt.AlignHCenter)
|
||||
self.output_parameters_group_box.setAlignment(
|
||||
Qt.AlignmentFlag(Qt.AlignTop | Qt.AlignHCenter))
|
||||
|
||||
qf = QFrame()
|
||||
qf.setFixedHeight(35)
|
||||
@@ -629,7 +630,7 @@ class GUIFrame(QWidget):
|
||||
group_box.setMinimumWidth(200)
|
||||
group_box.setMaximumHeight(400)
|
||||
group_box.setFont(self.font_gui)
|
||||
group_box.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
|
||||
group_box.setAlignment(Qt.AlignmentFlag(Qt.AlignTop | Qt.AlignHCenter))
|
||||
group_box.setLayout(hbox)
|
||||
return group_box
|
||||
|
||||
@@ -820,7 +821,7 @@ class GUIFrame(QWidget):
|
||||
grid.addWidget(self.start_wgt)
|
||||
grid.addWidget(self.abort_wgt)
|
||||
grid.addWidget(self.save_all_wgt)
|
||||
grid.setAlignment(Qt.AlignLeft | Qt.AlignTop)
|
||||
grid.setAlignment(Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignTop))
|
||||
|
||||
return grid
|
||||
|
||||
@@ -1312,7 +1313,7 @@ class GUIFrame(QWidget):
|
||||
arrow_button_widget = QWidget() #self.plot_widget[i])
|
||||
layout = QHBoxLayout()
|
||||
layout.setContentsMargins(0, 0, 0, 0)
|
||||
layout.setAlignment(Qt.AlignLeft|Qt.AlignTop)
|
||||
layout.setAlignment(Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignTop))
|
||||
button_left = QToolButton(arrow_button_widget)
|
||||
button_left.setArrowType(Qt.LeftArrow)
|
||||
button_left.clicked.connect(self.on_toggle_left)
|
||||
@@ -1840,10 +1841,10 @@ class GUIFrame(QWidget):
|
||||
icolspan = 3
|
||||
if label:
|
||||
lo.addWidget(label, _irow, icol, _irowspan, 1,
|
||||
Qt.AlignLeft | Qt.AlignVCenter)
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
icol += 1
|
||||
lo.addWidget(line, _irow, icol, _irowspan, icolspan,
|
||||
Qt.AlignLeft | Qt.AlignVCenter)
|
||||
Qt.AlignmentFlag(Qt.AlignLef | Qt.AlignVCenter))
|
||||
#print(title, tab)
|
||||
#print(key, line, icolumn, wgt_type, text, flush=True)
|
||||
_irow += 1
|
||||
@@ -1884,24 +1885,19 @@ class GUIFrame(QWidget):
|
||||
final_wgt = QWidget()
|
||||
final_lo = QGridLayout()
|
||||
final_wgt.setContentsMargins(0, 0, 0, 0)
|
||||
final_lo.addWidget(meas_label, 0, 0, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
final_lo.addWidget(meas_line, 0, 2, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
final_lo.addWidget(meas_label, 0, 0, 1, 2,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
final_lo.addWidget(meas_line, 0, 2, 1, 2,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
qHLine = QHLine()
|
||||
qHLine.setFixedHeight(10)
|
||||
final_lo.addWidget(qHLine, 1, 0, 1, 4)
|
||||
final_lo.addWidget(qtab_widget, 2, 0, 1, 4, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#final_lo.setSpacing(0)
|
||||
final_lo.addWidget(qtab_widget, 2, 0, 1, 4,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
|
||||
final_wgt.setLayout(final_lo)
|
||||
|
||||
|
||||
'''
|
||||
wgt_grid.addWidget(meas_label, irow, 0, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(meas_line, irow, 2, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
qHLine = QHLine()
|
||||
qHLine.setFixedHeight(10)
|
||||
wgt_grid.addWidget(qHLine, irow+1, 0, 1, 4)
|
||||
wgt_grid.addWidget(qtab_widget, irow+2, 0, 1, 4, Qt.AlignHCenter | Qt.AlignVCenter)
|
||||
'''
|
||||
|
||||
return final_wgt #qtab_widget #
|
||||
|
||||
|
||||
@@ -2044,7 +2040,7 @@ class GUIFrame(QWidget):
|
||||
ql = QLabel(radiobutton_title[0])
|
||||
ql.setFont(self.font_pts10)
|
||||
ql.setFixedHeight(self.widget_height)
|
||||
ql.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
ql.setAlignment(Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
grid.addWidget(ql, 0, 1)
|
||||
|
||||
if manual:
|
||||
@@ -2066,7 +2062,8 @@ class GUIFrame(QWidget):
|
||||
monitor_pv = CAQLabel(self, pv_name=pv, monitor_callback=mon_cb,
|
||||
show_units=True)
|
||||
|
||||
monitor_pv.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
monitor_pv.setAlignment(
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
monitor_pv.setFont(self.font_pts10)
|
||||
monitor_pv.setFixedHeight(self.widget_height)
|
||||
monitor_pv.setFixedWidth(122)
|
||||
@@ -2075,10 +2072,7 @@ class GUIFrame(QWidget):
|
||||
if read:
|
||||
read_pv = CAQLabel(self, pv_name=pv, pv_within_daq_group=True,
|
||||
color_mode="static", show_units=True)
|
||||
read_pv.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#read_pv.setObjectName("Readback")
|
||||
#read_pv.setProperty("static", True)
|
||||
#read_pv.setStyleSheet('background-color: rgb(255, 255,223)')
|
||||
read_pv.setAlignment(Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
read_pv.setFont(self.font_pts10)
|
||||
init_value = self.cafe.getCache(pv)
|
||||
|
||||
@@ -2125,14 +2119,15 @@ class GUIFrame(QWidget):
|
||||
manual_wgt = QLineEdit(str(manual_value))
|
||||
manual_wgt.setObjectName("WriteCenter")
|
||||
manual_wgt.textChanged.connect(update_manual_value)
|
||||
manual_wgt.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
manual_wgt.setAlignment(
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
manual_wgt.setFixedHeight(self.widget_height)
|
||||
manual_wgt.setFixedWidth(74)
|
||||
grid.addWidget(manual_wgt, 2, 2)
|
||||
ql = QLabel(self.cafe.getUnits(pv))
|
||||
ql.setFont(self.font_pts10)
|
||||
ql.setFixedHeight(self.widget_height)
|
||||
ql.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
ql.setAlignment(Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
grid.addWidget(ql, 2, 3)
|
||||
|
||||
grid.setContentsMargins(5, 10, 5, 0)
|
||||
@@ -2144,7 +2139,7 @@ class GUIFrame(QWidget):
|
||||
group_box.setMaximumWidth(280)
|
||||
group_box.setMaximumHeight(320)
|
||||
group_box.setFont(self.font_pts10)
|
||||
group_box.setAlignment(Qt.AlignTop | Qt.AlignHCenter)
|
||||
group_box.setAlignment(Qt.AlignmentFlag(Qt.AlignTop|Qt.AlignHCenter))
|
||||
group_box.setLayout(grid)
|
||||
|
||||
if monitor:
|
||||
@@ -2200,7 +2195,7 @@ class GUIFrame(QWidget):
|
||||
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = max(fm.width(str(value_for_width)), fm.width(suggested))
|
||||
line.setFixedWidth(param_width + 56)
|
||||
line.setFixedWidth(int(param_width + 56))
|
||||
line.setObjectName("Write")
|
||||
|
||||
|
||||
@@ -2218,7 +2213,7 @@ class GUIFrame(QWidget):
|
||||
label.setAlignment(Qt.AlignBottom)
|
||||
else:
|
||||
box = QHBoxLayout()
|
||||
label.setAlignment(Qt.AlignLeft | Qt.AlignVCenter)
|
||||
label.setAlignment(Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
box.setAlignment(Qt.AlignCenter)
|
||||
|
||||
box.addWidget(label)
|
||||
@@ -2238,7 +2233,7 @@ class GUIFrame(QWidget):
|
||||
|
||||
if 'loggingLevel' not in key:
|
||||
wgt_grid.addLayout(box, a, b, c, d,
|
||||
Qt.AlignLeft | Qt.AlignVCenter)
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
|
||||
return box if 'loggingLevel' in key else line
|
||||
|
||||
@@ -2378,7 +2373,7 @@ class GUIFrame(QWidget):
|
||||
line.setStyleSheet("QLabel{text-align: right}")
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = max(fm.width(str(value)), fm.width(suggested))
|
||||
line.setMaximumWidth(param_width + 40)
|
||||
line.setMaximumWidth(int(param_width + 40))
|
||||
|
||||
|
||||
if self.grid_loc:
|
||||
@@ -2419,7 +2414,7 @@ class GUIFrame(QWidget):
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = max(fm.width(str(value)), fm.width(suggested))
|
||||
extra_width = 22 if len(str(value)) < 16 else 26
|
||||
line.setFixedWidth(param_width + extra_width)
|
||||
line.setFixedWidth(int(param_width + extra_width))
|
||||
|
||||
qframe_buffer = QFrame()
|
||||
qframe_buffer.setFixedWidth(3)
|
||||
@@ -2436,25 +2431,18 @@ class GUIFrame(QWidget):
|
||||
c = 1
|
||||
d = 1
|
||||
|
||||
wgt_grid.addWidget(label, a, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(qframe_buffer, a, b+1, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(line, a, b+2, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#wgt_grid.addWidget(label, irow, self.input_wgt_grid_column, 1, 1,
|
||||
# Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#wgt_grid.addWidget(qframe_buffer, irow, self.input_wgt_grid_column+1,
|
||||
# 1, 1, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#wgt_grid.addWidget(line, irow, self.input_wgt_grid_column+2, 1, 1,
|
||||
# Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
wgt_grid.addWidget(label, a, b, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(qframe_buffer, a, b+1, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(line, a, b+2, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
return line
|
||||
|
||||
def input_wgt_qlineedit(self, key, value, label, irow, wgt_grid):
|
||||
def line_cb(new_value):
|
||||
self.parent.input_parameters[key] = new_value
|
||||
|
||||
|
||||
self.parent.input_parameters[key] = new_value
|
||||
line = QLineEdit()
|
||||
|
||||
line.setObjectName("Write")
|
||||
line.setFixedHeight(24)
|
||||
line.textEdited.connect(line_cb)
|
||||
@@ -2462,9 +2450,8 @@ class GUIFrame(QWidget):
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = fm.width(str(value))
|
||||
extra_width = 22 if len(str(value)) < 16 else 26
|
||||
line.setFixedWidth(param_width + extra_width)
|
||||
|
||||
|
||||
line.setFixedWidth(int(param_width + extra_width))
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
@@ -2476,11 +2463,10 @@ class GUIFrame(QWidget):
|
||||
c = 1
|
||||
d = 2
|
||||
|
||||
wgt_grid.addWidget(label, a, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(line, a, b+2, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
#wgt_grid.addWidget(label, irow, self.input_wgt_grid_column, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#wgt_grid.addWidget(line, irow, self.input_wgt_grid_column+2, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(label, a, b, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(line, a, b+2, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft|Qt.AlignVCenter))
|
||||
|
||||
return line
|
||||
|
||||
@@ -2518,7 +2504,7 @@ class GUIFrame(QWidget):
|
||||
line.setSingleStep(step)
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = max(fm.width(str(decimal)), fm.width(suggested))
|
||||
line.setMaximumWidth(param_width + 40)
|
||||
line.setMaximumWidth(int(param_width + 40))
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
@@ -2531,11 +2517,10 @@ class GUIFrame(QWidget):
|
||||
c = 1
|
||||
d = 2
|
||||
|
||||
wgt_grid.addWidget(label, a, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(line, a, b+2, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#wgt_grid.addWidget(label, irow, self.input_wgt_grid_column, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#wgt_grid.addWidget(line, irow, self.input_wgt_grid_column+2, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
wgt_grid.addWidget(label, a, b, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(line, a, b+2, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
return line
|
||||
|
||||
|
||||
@@ -2563,9 +2548,8 @@ class GUIFrame(QWidget):
|
||||
line.setSingleStep(step)
|
||||
fm = QFontMetricsF(line.font())
|
||||
param_width = max(fm.width(str(max_val)), fm.width(suggested))
|
||||
line.setMaximumWidth(param_width + 40)
|
||||
|
||||
|
||||
line.setMaximumWidth(int(param_width + 40))
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
@@ -2577,11 +2561,10 @@ class GUIFrame(QWidget):
|
||||
c = 1
|
||||
d = 2
|
||||
|
||||
wgt_grid.addWidget(label, a, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(line, a, b+2, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
#wgt_grid.addWidget(label, irow, self.input_wgt_grid_column, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
#wgt_grid.addWidget(line, irow, self.input_wgt_grid_column+2, 1, 2, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(label, a, b, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(line, a, b+2, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
|
||||
return line
|
||||
|
||||
@@ -2592,7 +2575,6 @@ class GUIFrame(QWidget):
|
||||
qframe_bottom = QFrame()
|
||||
qframe_bottom.setFixedHeight(3)
|
||||
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
b = self.grid_loc[1]
|
||||
@@ -2604,15 +2586,14 @@ class GUIFrame(QWidget):
|
||||
c = 1
|
||||
d = 4
|
||||
|
||||
wgt_grid.addWidget(qframe_top, a, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(stacked_wgt, a+1, b, c+3, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(qframe_bottom, a+2, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(qframe_top, a, b, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(stacked_wgt, a+1, b, c+3, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(qframe_bottom, a+2, b, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
|
||||
#wgt_grid.addWidget(qframe_top, irow, self.input_wgt_grid_column, 1, 4)
|
||||
#wgt_grid.addWidget(stacked_wgt, irow+1,
|
||||
# self.input_wgt_grid_column, 5, 4)
|
||||
#wgt_grid.addWidget(qframe_bottom, irow+2,
|
||||
# self.input_wgt_grid_column, 1, 4)
|
||||
|
||||
|
||||
return stacked_wgt
|
||||
|
||||
@@ -2636,16 +2617,14 @@ class GUIFrame(QWidget):
|
||||
d = 4
|
||||
|
||||
|
||||
wgt_grid.addWidget(qframe_top, a, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(stacked_wgt, a+1, b, c+3, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
wgt_grid.addWidget(qframe_bottom, a+2, b, c, d, Qt.AlignLeft | Qt.AlignVCenter)
|
||||
|
||||
#wgt_grid.addWidget(qframe_top, irow, self.input_wgt_grid_column, 1, 4)
|
||||
#wgt_grid.addWidget(stacked_wgt, irow+1,
|
||||
# self.input_wgt_grid_column, 1, 4)
|
||||
#wgt_grid.addWidget(qframe_bottom, irow+2,
|
||||
# self.input_wgt_grid_column, 1, 4)
|
||||
wgt_grid.addWidget(qframe_top, a, b, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(stacked_wgt, a+1, b, c+3, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
wgt_grid.addWidget(qframe_bottom, a+2, b, c, d,
|
||||
Qt.AlignmentFlag(Qt.AlignLeft | Qt.AlignVCenter))
|
||||
|
||||
|
||||
return stacked_wgt
|
||||
|
||||
def input_wgt_qhline(self, irow, wgt_grid):
|
||||
@@ -2663,14 +2642,14 @@ class GUIFrame(QWidget):
|
||||
c = 1
|
||||
d = 4
|
||||
wgt_grid.addWidget(qHLine, a, b, c, d)
|
||||
#wgt_grid.addWidget(qHLine, irow, self.input_wgt_grid_column, 1, 4)
|
||||
|
||||
|
||||
def input_wgt_qvline(self, irow, wgt_grid):
|
||||
qVLine = QVLine()
|
||||
|
||||
qVLine.setFixedWidth(20)
|
||||
|
||||
qVLine.setFixedHeight(17 * wgt_grid.rowCount())
|
||||
qVLine.setFixedHeight(int(17 * wgt_grid.rowCount()))
|
||||
|
||||
if self.grid_loc:
|
||||
a = self.grid_loc[0]
|
||||
@@ -2684,8 +2663,7 @@ class GUIFrame(QWidget):
|
||||
d = 4
|
||||
|
||||
wgt_grid.addWidget(qVLine, a, b, c, d)
|
||||
|
||||
#wgt_grid.addWidget(qVLine, irow, self.input_wgt_grid_column, 1, 4)
|
||||
|
||||
|
||||
def input_wgt_frame(self, irow, wgt_grid):
|
||||
qFrame = QFrame()
|
||||
@@ -2703,8 +2681,6 @@ class GUIFrame(QWidget):
|
||||
d = 4
|
||||
wgt_grid.addWidget(qHLine, a, b, c, d)
|
||||
|
||||
#wgt_grid.addWidget(qFrame, irow, self.input_wgt_grid_column, 1, 4)
|
||||
|
||||
|
||||
def input_wgt(self, buddy, label, key, value, irow=0, wgt_grid=None,):
|
||||
|
||||
@@ -2842,7 +2818,8 @@ class GUIFrame(QWidget):
|
||||
if "useGrid" in self.settings.data:
|
||||
if self.settings.data["useGrid"]:
|
||||
if 'grid' in self.settings.data["Parameters"][key]["data"]:
|
||||
self.grid_loc = self.settings.data["Parameters"][key]["data"]["grid"]
|
||||
self.grid_loc = self.settings.data[
|
||||
"Parameters"][key]["data"]["grid"]
|
||||
|
||||
|
||||
if draw_widget(buddy):
|
||||
@@ -2858,7 +2835,8 @@ class GUIFrame(QWidget):
|
||||
|
||||
lo = QGridLayout()
|
||||
lo.setContentsMargins(9, 19, 9, 9)
|
||||
lo.addWidget(self.operator_parameters_group, 0, 0, 4, 1, alignment=Qt.AlignTop)
|
||||
lo.addWidget(self.operator_parameters_group, 0, 0, 4, 1,
|
||||
alignment=Qt.AlignTop)
|
||||
#if random.randint(1, 10) > 9:
|
||||
# lo.addWidget(self.create_analysis_wgt(), 0, 1)
|
||||
#else:
|
||||
@@ -2870,19 +2848,19 @@ class GUIFrame(QWidget):
|
||||
|
||||
if self.has_procedure:
|
||||
if 'V' in self.orientation_procedure.upper():
|
||||
lo.addWidget(self.analysis_procedure_group(), row_count, 1, 1, 1)
|
||||
lo.addWidget(
|
||||
self.analysis_procedure_group(), row_count, 1, 1, 1)
|
||||
else:
|
||||
lo.addWidget(self.analysis_procedure_group(), lo.rowCount(), 0, 1, 1)
|
||||
lo.addWidget(
|
||||
self.analysis_procedure_group(), lo.rowCount(), 0, 1, 1)
|
||||
|
||||
#Centers input parameters group box
|
||||
lo.setAlignment(Qt.AlignHCenter | Qt.AlignTop)
|
||||
lo.setAlignment(Qt.AlignmentFlag(Qt.AlignHCenter | Qt.AlignTop))
|
||||
lo.setHorizontalSpacing(20)
|
||||
lo.setVerticalSpacing(10)
|
||||
self.operator_wgt.setLayout(lo)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#expert
|
||||
self.expert_parameters_group = self.expert_parameters_groupbox()
|
||||
|
||||
@@ -2893,7 +2871,8 @@ class GUIFrame(QWidget):
|
||||
if "useGrid" in self.settings.data:
|
||||
if self.settings.data["useGrid"]:
|
||||
if 'grid' in self.settings.data["Expert"][key]["data"]:
|
||||
self.grid_loc = self.settings.data["Expert"][key]["data"]["grid"]
|
||||
self.grid_loc = self.settings.data[
|
||||
"Expert"][key]["data"]["grid"]
|
||||
|
||||
buddy = self.settings.data[
|
||||
"Expert"][key]["data"]["widget"].upper()
|
||||
@@ -2905,7 +2884,8 @@ class GUIFrame(QWidget):
|
||||
#Add expert parameters to input_parameters
|
||||
self.input_parameters.update(self.expert_parameters)
|
||||
|
||||
#Need to emit radio button here as input_parameters is overwritten by sel.expoert_parameters
|
||||
#Need to emit radio button here as input_parameters is
|
||||
#overwritten by sel.expoert_parameters
|
||||
#which give a list [Gasusian and FWMH]
|
||||
if self.radiobutton:
|
||||
self.radiobutton[0].toggled.emit(True)
|
||||
@@ -2941,11 +2921,6 @@ class GUIFrame(QWidget):
|
||||
self.expert_parameters_group.layout().addWidget(
|
||||
self.checkbox_keepImages())
|
||||
|
||||
|
||||
##self.expert_parameters_group.layout().addWidget(QHLine())
|
||||
#hbox2.addWidget(self.checkbox_debug(hline="None"))
|
||||
#hbox2.addWidget(self.checkbox_simulation(hline="None"))
|
||||
|
||||
_matches = ["debug", "debugLevel", "simulation"]
|
||||
match = False
|
||||
|
||||
@@ -2959,19 +2934,17 @@ class GUIFrame(QWidget):
|
||||
|
||||
if "debug" in self.parent.input_parameters.keys():
|
||||
hbox2.addWidget(self.checkbox_debug(hline="None"))
|
||||
#self.expert_parameters_group.layout().addWidget(
|
||||
# self.checkbox_debug(hline="TOP"))
|
||||
|
||||
|
||||
if "simulation" in self.parent.input_parameters.keys():
|
||||
hbox2.addWidget(self.checkbox_simulation(hline="None"))
|
||||
#self.expert_parameters_group.layout().addWidget(
|
||||
# self.checkbox_simulation(hline="BOTTOM"))
|
||||
|
||||
self.expert_parameters_group.layout().addLayout(hbox2)
|
||||
|
||||
|
||||
self.expert_parameters_group.layout().addLayout(
|
||||
self.input_wgt_logging(self.expert_wgt_grid.rowCount(), self.expert_wgt_grid))
|
||||
self.input_wgt_logging(self.expert_wgt_grid.rowCount(),
|
||||
self.expert_wgt_grid))
|
||||
|
||||
self.expert_parameters_group.layout().addWidget(QHLine())
|
||||
|
||||
@@ -2979,8 +2952,9 @@ class GUIFrame(QWidget):
|
||||
|
||||
lo = QGridLayout()
|
||||
lo.setContentsMargins(9, 19, 9, 9)
|
||||
lo.addWidget(self.expert_parameters_group, 0, 0, 1, 1, alignment=Qt.AlignTop)
|
||||
lo.setAlignment(Qt.AlignHCenter | Qt.AlignTop)
|
||||
lo.addWidget(self.expert_parameters_group, 0, 0, 1, 1,
|
||||
alignment=Qt.AlignTop)
|
||||
lo.setAlignment(Qt.AlignmentFlag(Qt.AlignHCenter | Qt.AlignTop))
|
||||
lo.setHorizontalSpacing(20)
|
||||
self.expert_wgt.setLayout(lo)
|
||||
|
||||
@@ -3023,12 +2997,6 @@ class GUIFrame(QWidget):
|
||||
|
||||
layout.addWidget(radio, 1, _width*i+1, 1, _width, Qt.AlignCenter)
|
||||
|
||||
#_qf = QFrame()
|
||||
#_qf.setFixedWidth(10)
|
||||
#layout.addWidget(_qf, 1, layout.columnCount())
|
||||
|
||||
#self.radiobutton[start_idx].setChecked(True)
|
||||
#self.radiobutton[start_idx].toggled.emit(True)
|
||||
|
||||
layout.addWidget(QHLine(), 2, 0, 1, layout.columnCount())
|
||||
|
||||
@@ -3079,7 +3047,8 @@ class GUIFrame(QWidget):
|
||||
pv_dict[_title] = self.branches[i]['magnets']
|
||||
|
||||
self.table_layout = QGridLayout()
|
||||
self.table_layout.setAlignment(Qt.AlignCenter | Qt.AlignTop)
|
||||
self.table_layout.setAlignment(
|
||||
Qt.AlignmentFlag(Qt.AlignCenter | Qt.AlignTop))
|
||||
self.table_tab_wgt = QTabWidget()
|
||||
self.table_tab_wgt.setFixedWidth(600)
|
||||
self.table_tab_wgt.tabBar().setShape(QTabBar.TriangularNorth)
|
||||
@@ -3103,7 +3072,6 @@ class GUIFrame(QWidget):
|
||||
self.table_tab_wgt.currentChanged.connect(on_table_tab_changed)
|
||||
self.table_layout.addWidget(self.table_tab_wgt, 0, 0)
|
||||
|
||||
#self.line_sender_dict['tableTabIdx'] = self.table_tab_wgt
|
||||
self.table_layout.setContentsMargins(0, 27, 0, 0)
|
||||
|
||||
self.table_tab_wgt.currentChanged.emit(0)
|
||||
|
||||
Reference in New Issue
Block a user