move to combobox + list instead of tree

This commit is contained in:
Dominik Demuth 2023-02-24 17:39:45 +01:00
parent bd4b88102a
commit b31dec4c7b
6 changed files with 13 additions and 18 deletions

View File

@ -257,13 +257,13 @@ class Ui_BaseWindow(object):
self.actionGuide_lines.setObjectName("actionGuide_lines") self.actionGuide_lines.setObjectName("actionGuide_lines")
self.actionMaximize = QtWidgets.QAction(BaseWindow) self.actionMaximize = QtWidgets.QAction(BaseWindow)
self.actionMaximize.setCheckable(True) self.actionMaximize.setCheckable(True)
self.actionMaximize.setVisible(False) self.actionMaximize.setVisible(True)
self.actionMaximize.setObjectName("actionMaximize") self.actionMaximize.setObjectName("actionMaximize")
self.actionTile = QtWidgets.QAction(BaseWindow) self.actionTile = QtWidgets.QAction(BaseWindow)
self.actionTile.setObjectName("actionTile") self.actionTile.setObjectName("actionTile")
self.actionMinimize = QtWidgets.QAction(BaseWindow) self.actionMinimize = QtWidgets.QAction(BaseWindow)
self.actionMinimize.setCheckable(True) self.actionMinimize.setCheckable(True)
self.actionMinimize.setVisible(False) self.actionMinimize.setVisible(True)
self.actionMinimize.setObjectName("actionMinimize") self.actionMinimize.setObjectName("actionMinimize")
self.actionNew_window = QtWidgets.QAction(BaseWindow) self.actionNew_window = QtWidgets.QAction(BaseWindow)
self.actionNew_window.setObjectName("actionNew_window") self.actionNew_window.setObjectName("actionNew_window")

View File

@ -18,9 +18,9 @@ class Ui_Form(object):
self.verticalLayout_2 = QtWidgets.QVBoxLayout(Form) self.verticalLayout_2 = QtWidgets.QVBoxLayout(Form)
self.verticalLayout_2.setContentsMargins(3, 3, 3, 3) self.verticalLayout_2.setContentsMargins(3, 3, 3, 3)
self.verticalLayout_2.setObjectName("verticalLayout_2") self.verticalLayout_2.setObjectName("verticalLayout_2")
self.comboBox = QtWidgets.QComboBox(Form) self.graph_combobox = QtWidgets.QComboBox(Form)
self.comboBox.setObjectName("comboBox") self.graph_combobox.setObjectName("graph_combobox")
self.verticalLayout_2.addWidget(self.comboBox) self.verticalLayout_2.addWidget(self.graph_combobox)
self.listWidget = QtWidgets.QListWidget(Form) self.listWidget = QtWidgets.QListWidget(Form)
self.listWidget.setObjectName("listWidget") self.listWidget.setObjectName("listWidget")
self.verticalLayout_2.addWidget(self.listWidget) self.verticalLayout_2.addWidget(self.listWidget)

View File

@ -220,3 +220,6 @@ class Ellipse(GraphicsObject):
self.log_mode = [x_mode, y_mode] self.log_mode = [x_mode, y_mode]
self.informViewBoundsChanged() self.informViewBoundsChanged()
def get_state(self):
return {'center': self.center, 'axes': self.ax}

View File

@ -21,18 +21,10 @@ class DrawingsWidget(QtWidgets.QWidget, Ui_Form):
def update_tree(self): def update_tree(self):
for gid, windows in self.graphs.items(): for gid, windows in self.graphs.items():
item = QtWidgets.QTreeWidgetItem([windows.title]) self.graph_combobox.addItem(windows.title, userData=gid)
item.setData(0, QtCore.Qt.UserRole, gid)
for d in windows.drawings.values():
child = QtWidgets.QTreeWidgetItem([d])
item.addChild(child)
self.treeWidget.addTopLevelItem(item)
# self.graph_comboBox.addItem(name, userData=gid)
def clear(self): def clear(self):
self.graph_comboBox.clear() self.graph_combobox.clear()
@QtCore.pyqtSlot(int, name='on_mode_comboBox_currentIndexChanged') @QtCore.pyqtSlot(int, name='on_mode_comboBox_currentIndexChanged')
def change_draw_type(self, idx: int): def change_draw_type(self, idx: int):

View File

@ -734,7 +734,7 @@
<string>Maximize</string> <string>Maximize</string>
</property> </property>
<property name="visible"> <property name="visible">
<bool>false</bool> <bool>true</bool>
</property> </property>
</action> </action>
<action name="actionTile"> <action name="actionTile">
@ -750,7 +750,7 @@
<string>Minimize</string> <string>Minimize</string>
</property> </property>
<property name="visible"> <property name="visible">
<bool>false</bool> <bool>true</bool>
</property> </property>
</action> </action>
<action name="actionNew_window"> <action name="actionNew_window">

View File

@ -27,7 +27,7 @@
<number>3</number> <number>3</number>
</property> </property>
<item> <item>
<widget class="QComboBox" name="comboBox"/> <widget class="QComboBox" name="graph_combobox"/>
</item> </item>
<item> <item>
<widget class="QListWidget" name="listWidget"/> <widget class="QListWidget" name="listWidget"/>