mirror of
https://github.com/wassname/sloth.git
synced 2026-07-09 22:07:43 +08:00
connect button area stateChanged to scene
This commit is contained in:
+5
-3
@@ -99,8 +99,8 @@ class ButtonArea(QWidget):
|
||||
|
||||
def get_current_state(self):
|
||||
label_button = self.get_checked_label_button()
|
||||
result = {}
|
||||
if label_button != None:
|
||||
result = {}
|
||||
label = str(label_button.text())
|
||||
if self.label_properties.has_key(label):
|
||||
if self.label_properties[label].has_key("type"):
|
||||
@@ -112,7 +112,9 @@ class ButtonArea(QWidget):
|
||||
checked_button = button_list.get_checked_button()
|
||||
if checked_button != None:
|
||||
result[button_list.name] = str(checked_button.text())
|
||||
return result
|
||||
return result
|
||||
|
||||
return None
|
||||
|
||||
def clickedButton(self):
|
||||
button = self.sender()
|
||||
@@ -140,7 +142,7 @@ class ButtonArea(QWidget):
|
||||
def load(self, config_filepath):
|
||||
execfile(config_filepath)
|
||||
self.init_button_lists()
|
||||
|
||||
|
||||
def main():
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ class MainWindow(QMainWindow):
|
||||
self.buttonarea = ButtonArea()
|
||||
self.buttonarea.load("example_config.py")
|
||||
self.ui.dockAnnotationButtons.setWidget(self.buttonarea)
|
||||
self.connect(self.buttonarea, SIGNAL("stateChanged(state)"), self.scene.setMode)
|
||||
|
||||
self.treeview = AnnotationTreeView()
|
||||
self.ui.dockInformation.setWidget(self.treeview)
|
||||
|
||||
Reference in New Issue
Block a user