Ejemplo n.º 1
2
class Widget(QWidget):
    def __init__(self, parent=None):
        super(Widget, self).__init__(parent)
        self.uiTeachingWidget = teachingwidget.Widget()
        self.uiExperimentWidget = experimentwidget.Widget()

        self.uiStackedWidget = QStackedWidget()
        self.uiStackedWidget.addWidget(self.uiTeachingWidget)
        self.uiStackedWidget.addWidget(self.uiExperimentWidget)
        self.uiButtonNext = QPushButton('Next')
        self.uiButtonBack = QPushButton('Back')
        self.uiButtonBack.setEnabled(False)
        hboxLayout = QHBoxLayout()
        hboxLayout.addStretch(1)
        hboxLayout.addWidget(self.uiButtonBack)
        hboxLayout.addWidget(self.uiButtonNext)

        vboxLayout = QVBoxLayout()
        vboxLayout.addWidget(self.uiStackedWidget)
        vboxLayout.addLayout(hboxLayout)
        self.setLayout(vboxLayout)
        self.setWindowTitle('Teaching one linear neuron (example 3)')
        self.connect(self.uiButtonNext, SIGNAL('clicked()'), self.nextWidget)
        self.connect(self.uiButtonBack, SIGNAL('clicked()'), self.backWidget)

    def nextWidget(self):
        self.uiButtonNext.setEnabled(False)
        self.uiButtonBack.setEnabled(True)
        self.uiStackedWidget.setCurrentIndex(1)

    def backWidget(self):
        self.uiButtonNext.setEnabled(True)
        self.uiButtonBack.setEnabled(False)
        self.uiStackedWidget.setCurrentIndex(0)
Ejemplo n.º 2
0
class MainWindow(QMainWindow):
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)

        # codeCompletionBlock start
        from PyQt4.QtGui import QComboBox, QToolButton, QStackedWidget

        self.accountSelection = QComboBox()
        self.accountButton = QToolButton()
        self.accountStack = QStackedWidget()
        # codeCompletionBlock end

        uic.loadUi(getUiFile('MainWindow'), self)

        self.model = Model()
        self.model.loadLastSession()

        self.actionAdd_Account.triggered.connect(self.addSubAccount)
        self.accountSelection.currentIndexChanged.connect(self.accountStack.setCurrentIndex)

    def addSubAccount(self):
        data = inquireAccountData()
        account = self.model.createNewAccount(data['name'],
                                              data['description'],
                                              data['numbers'])
        self.model.addNewAccount(account)

        self.accountSelection.addItem(account.description)
        self.accountStack.addWidget(AccountWidget())
Ejemplo n.º 3
0
    def __init__(self, edis=None):
        QWidget.__init__(self, edis)
        self.setAcceptDrops(True)
        self.box = QVBoxLayout(self)
        self.box.setContentsMargins(0, 0, 0, 0)
        self.box.setSpacing(0)

        # Stacked
        self.stack = QStackedWidget()
        self.box.addWidget(self.stack)

        # Replace widget
        #FIXME: mover esto
        self._replace_widget = replace_widget.ReplaceWidget()
        self._replace_widget.hide()
        self.box.addWidget(self._replace_widget)

        # Editor widget
        self.editor_widget = editor_widget.EditorWidget()

        # Conexiones
        self.connect(self.editor_widget, SIGNAL("saveCurrentFile()"),
                     self.save_file)
        self.connect(self.editor_widget, SIGNAL("fileClosed(int)"),
                     self._file_closed)
        self.connect(self.editor_widget, SIGNAL("recentFile(QStringList)"),
                     self.update_recents_files)
        self.connect(self.editor_widget, SIGNAL("allFilesClosed()"),
                     self.add_start_page)
        self.connect(self.editor_widget, SIGNAL("currentWidgetChanged(int)"),
                     self.change_widget)

        Edis.load_component("principal", self)
Ejemplo n.º 4
0
class FormComboWidget(QWidget):
    def __init__(self, datalist, comment="", parent=None):
        QWidget.__init__(self, parent)
        layout = QVBoxLayout()
        self.setLayout(layout)
        self.combobox = QComboBox()
        layout.addWidget(self.combobox)

        self.stackwidget = QStackedWidget(self)
        layout.addWidget(self.stackwidget)
        self.connect(self.combobox, SIGNAL("currentIndexChanged(int)"),
                     self.stackwidget, SLOT("setCurrentIndex(int)"))

        self.widgetlist = []
        for data, title, comment in datalist:
            self.combobox.addItem(title)
            widget = FormWidget(data, comment=comment, parent=self)
            self.stackwidget.addWidget(widget)
            self.widgetlist.append(widget)

    def setup(self):
        for widget in self.widgetlist:
            widget.setup()

    def get(self):
        return [widget.get() for widget in self.widgetlist]
Ejemplo n.º 5
0
    def __init__(self, parent):
        QStackedWidget.__init__(self, parent)
        vbox = QVBoxLayout()

        self.webView = ReportWebView(self)
        self.textWidget = QWidget(self)
        self.textEdit = QTextEdit(self)

        self.addWidget(self.webView)

        self.__saveState = True
        self.connect(self.textEdit, SIGNAL("textChanged()"), self.setUnsaved)

        vbox.addWidget(self.textEdit)
        self.buttonSaveNote = QPushButton("&Save note", self.textWidget)
        self.connect(self.buttonSaveNote, SIGNAL("clicked()"), self.saveNotes)
        vbox.addWidget(self.buttonSaveNote)
        self.textWidget.setLayout(vbox)
        self.addWidget(self.textWidget)

        self.buttonSaveNote.hide()
        self.urlRenderer = UrlRenderer(self)
        page = self.webView.page()
        page.setNetworkAccessManager(self.urlRenderer)
        page.setForwardUnsupportedContent(True)
        self.showReportPreview()
Ejemplo n.º 6
0
class FormComboWidget(QWidget):

    def __init__(self, datalist, comment="", parent=None):
        QWidget.__init__(self, parent)
        layout = QVBoxLayout()
        self.setLayout(layout)
        self.combobox = QComboBox()
        layout.addWidget(self.combobox)

        self.stackwidget = QStackedWidget(self)
        layout.addWidget(self.stackwidget)
        self.connect(self.combobox, SIGNAL("currentIndexChanged(int)"),
                     self.stackwidget, SLOT("setCurrentIndex(int)"))

        self.widgetlist = []
        for data, title, comment in datalist:
            self.combobox.addItem(title)
            widget = FormWidget(data, comment=comment, parent=self)
            self.stackwidget.addWidget(widget)
            self.widgetlist.append(widget)

    def setup(self):
        for widget in self.widgetlist:
            widget.setup()

    def get(self):
        return [widget.get() for widget in self.widgetlist]
Ejemplo n.º 7
0
    def setup(self, fname):
        """Setup Run Configuration dialog with filename *fname*"""
        combo_label = QLabel(_("Select a run configuration:"))
        self.combo = QComboBox()
        self.combo.setMaxVisibleItems(20)
        self.combo.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLength)
        self.combo.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)

        self.stack = QStackedWidget()

        configurations = _get_run_configurations()
        for index, (filename, options) in enumerate(configurations):
            if fname == filename:
                break
        else:
            # There is no run configuration for script *fname*:
            # creating a temporary configuration that will be kept only if
            # dialog changes are accepted by the user
            configurations.insert(0, (fname, RunConfiguration(fname).get()))
            index = 0
        for filename, options in configurations:
            widget = RunConfigOptions(self)
            widget.set(options)
            self.combo.addItem(filename)
            self.stack.addWidget(widget)
        self.connect(self.combo, SIGNAL("currentIndexChanged(int)"),
                     self.stack.setCurrentIndex)
        self.combo.setCurrentIndex(index)

        self.add_widgets(combo_label, self.combo, 10, self.stack)
        self.add_button_box(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)

        self.setWindowTitle(_("Run Settings"))
Ejemplo n.º 8
0
    def __init__(self, parent):
        QStackedWidget.__init__(self, parent)
        SMPluginMixin.__init__(self, parent)
        self.shellwidgets = {}

        # Initialize plugin
        self.initialize_plugin()
Ejemplo n.º 9
0
    def __init__(self, parent, noi):
        super(Declaration, self).__init__(parent)
        self.setupUi(self)
        self.setStyleSheet(OfSs.declaration_page_style)
        self.noidec = noi
        self.parent = parent
        self.scenario = parent.scenario

        self.pages_widget = QStackedWidget(self)
        self.connect(self.pages_widget, SIGNAL("currentChanged(int)"),
                     self.current_page_changed)
        self.connect(self.contents_widget, SIGNAL("currentRowChanged(int)"),
                     self.pages_widget.setCurrentIndex)

        self.scrollArea.setWidget(self.pages_widget)

        self.connect(self.next_btn, SIGNAL('clicked()'), self.next_page)
        self.connect(self.prev_btn, SIGNAL('clicked()'), self.prev_page)

        self.pages = [
            Page01(self),
            Page02(self),
            Page03(self),
            Page04(self),
            Page05(self),
            Page06(self),
            Page07(self),
            PageIsf(self)
        ]

        for widget in self.pages:
            self.add_page(widget)

        self.set_current_index(0)
        self.current_page_changed(0)
Ejemplo n.º 10
0
    def __init__(self, type_key, title, select_min_time_value=False):
        QWidget.__init__(self)

        self.__type_key = type_key
        self.__type = None

        self.__double_spinner = self.createDoubleSpinner(minimum=-1e15, maximum=1e15)
        self.__integer_spinner = self.createIntegerSpinner(minimum=0, maximum=1e10)

        self.__time_map = ReportStepsModel().getList()
        self.__time_index_map = {}
        for index in range(len(self.__time_map)):
            time = self.__time_map[index]
            self.__time_index_map[time] = index

        self.__time_spinner = self.createTimeSpinner(select_minimum_value=select_min_time_value)

        layout = QVBoxLayout()
        self.setLayout(layout)

        self.__label = QLabel(title)
        self.__label.setAlignment(Qt.AlignHCenter)

        self.__stack = QStackedWidget()
        self.__stack.setSizePolicy(QSizePolicy(QSizePolicy.Preferred))
        self.__stack.addWidget(self.__integer_spinner)
        self.__stack.addWidget(self.__double_spinner)
        self.__stack.addWidget(self.__time_spinner)

        layout.addWidget(self.__stack)
        layout.addWidget(self.__label)

        self.setLayout(layout)
Ejemplo n.º 11
0
    def __init__(self, chatWindow, nick):
        QWidget.__init__(self)

        self.chatWindow = chatWindow
        self.nick = nick
        self.unreadCount = 0

        self.widgetStack = QStackedWidget(self)
        self.widgetStack.addWidget(
            QNickInputWidget('new_chat.png',
                             150,
                             self.connectClicked,
                             parent=self))
        self.widgetStack.addWidget(QConnectingWidget(self))
        self.widgetStack.addWidget(
            QChatWidget(self.chatWindow.connectionManager, self))

        # Skip the chat layout if the nick was given denoting an incoming connection
        if self.nick is None or self.nick == '':
            self.widgetStack.setCurrentIndex(0)
        else:
            self.widgetStack.setCurrentIndex(2)

        layout = QHBoxLayout()
        layout.addWidget(self.widgetStack)
        self.setLayout(layout)
Ejemplo n.º 12
0
class ConfigWidget(QWidget):

    def __init__(self, parent=None):
        QWidget.__init__(self, parent)

        layout = QFormLayout()
        self.setLayout(layout)

        self.label = QLabel("Audio Input")
        self.inputLayout = QHBoxLayout()
        self.combobox = QComboBox()
        self.combobox.setMinimumWidth(150)
        self.inputSettingsToolButton = QToolButton()
        self.inputSettingsToolButton.setText("Settings")
        configIcon = QIcon.fromTheme("preferences-other")
        self.inputSettingsToolButton.setIcon(configIcon)
        self.inputSettingsToolButton.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
        self.inputSettingsToolButton.setToolButtonStyle(Qt.ToolButtonIconOnly)
        self.inputSettingsStack = QStackedWidget()
        blankWidget = QWidget()
        self.inputSettingsStack.addWidget(blankWidget)
        self.inputSettingsStack.addWidget(self.inputSettingsToolButton)
        self.inputLayout.addWidget(self.combobox)
        self.inputLayout.addWidget(self.inputSettingsStack)
        layout.addRow(self.label, self.inputLayout)
Ejemplo n.º 13
0
 def _fill_environment_box(self):
     
     # Main Layout
     main_lo = QVBoxLayout()        
     self.environment_gb.setLayout(main_lo)
             
     # Combobox
     lo, self.env_select_cb, lab = GBuilder().label_combobox(self, "Current Environment:", [], self._env_select_changed)
     hl = QHBoxLayout()
     hl.addLayout(lo)
     but = GBuilder().pushbutton(self, "New", self._new_env_hit)
     but.setFixedWidth(40)
     hl.addWidget(but)        
     lab.setFixedWidth(140)
     self.env_select_cb.setFixedHeight(22)  
     self.env_select_cb.setFixedWidth(350)      
     main_lo.addLayout(hl)
     
     # Groupbox (to make it look nicer)
     self.content_gb = EnvironmentView(self.environment_gb)    
     main_lo.addWidget(self.content_gb)
     self.content_gb.setFixedHeight(550)  
     self.content_gb.setFixedWidth(1000)  
     self.content_gb.setLayout(lo)
     
     # QStackedWidget with environments
     self.stacked_env = QStackedWidget()
     lo.addWidget(self.stacked_env)
Ejemplo n.º 14
0
    def __init__(self, parent):
        QStackedWidget.__init__(self, parent)
        SMPluginMixin.__init__(self, parent)
        self.shellwidgets = {}

        # Initialize plugin
        self.initialize_plugin()
Ejemplo n.º 15
0
class ConfigWidget(QWidget):
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)

        layout = QFormLayout()
        self.setLayout(layout)

        self.label = QLabel("Audio Input")
        self.inputLayout = QHBoxLayout()
        self.combobox = QComboBox()
        self.combobox.setMinimumWidth(150)
        self.inputSettingsToolButton = QToolButton()
        self.inputSettingsToolButton.setText("Settings")
        configIcon = QIcon.fromTheme("preferences-other")
        self.inputSettingsToolButton.setIcon(configIcon)
        self.inputSettingsToolButton.setSizePolicy(QSizePolicy.Maximum,
                                                   QSizePolicy.Maximum)
        self.inputSettingsToolButton.setToolButtonStyle(Qt.ToolButtonIconOnly)
        self.inputSettingsStack = QStackedWidget()
        blankWidget = QWidget()
        self.inputSettingsStack.addWidget(blankWidget)
        self.inputSettingsStack.addWidget(self.inputSettingsToolButton)
        self.inputLayout.addWidget(self.combobox)
        self.inputLayout.addWidget(self.inputSettingsStack)
        layout.addRow(self.label, self.inputLayout)
Ejemplo n.º 16
0
 def __init__(self, *args):
     QStackedWidget.__init__(self, *args)
     BackgroundJob.__init__(self)
     # The widget stack has two widgets, a log and a PDF preview.
     # the Log is already created in BackgroundJob
     self.addWidget(self.log)
     self.setCurrentWidget(self.log)
     
     # the PDF preview, load Okular part.
     # If not, we just run the default PDF viewer.
     self.part = None
     factory = KPluginLoader("okularpart").factory()
     if factory:
         part = factory.create(self)
         if part:
             self.part = part
             self.addWidget(part.widget())
             self.setCurrentWidget(part.widget())
             # hide mini pager
             w = part.widget().findChild(QWidget, "miniBar")
             if w:
                 w.parent().hide()
             # hide left panel
             a = part.actionCollection().action("show_leftpanel")
             if a and a.isChecked():
                 a.toggle()
             # default to single page layout
             a = part.actionCollection().action("view_render_mode_single")
             if a and not a.isChecked():
                 a.trigger()
             # change shortcut context for this one (bound to Esc)
             a = part.actionCollection().action("close_find_bar")
             if a:
                 a.setShortcutContext(Qt.WidgetShortcut)
Ejemplo n.º 17
0
 def __init__(self, app, debug=False):
     super(MainWindow, self).__init__()
     # Tab management private attributes, modify at own risk
     self.__tabMoved = False
     self.__tabAreaInformation = (-1, -1, [])
     self.__tabConnections = set()
     self.app = app
     self.debug = debug
     self.sched = scheduler.sched
     self.vfs = vfs.vfs()
     self.createRootNodes()
     self.dialog = Dialog(self)
     self.initCallback()
     self.setupUi(self)
     self.translation()
     self.setWindowModality(QtCore.Qt.ApplicationModal)
     self.resize(
         QtCore.QSize(QtCore.QRect(0, 0, 1014, 693).size()).expandedTo(
             self.minimumSizeHint()))
     self.shellActions = ShellActions(self)
     self.interpreterActions = InterpreterActions(self)
     self.setCentralWidget(None)
     self.setDockNestingEnabled(True)
     self.init()
     self.status = QStackedWidget()
     sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum)
     sizePolicy.setHorizontalStretch(1)
     sizePolicy.setVerticalStretch(1)
     self.status.setSizePolicy(sizePolicy)
     self.statusBar().addWidget(self.status)
Ejemplo n.º 18
0
class RunConfigDialog(BaseRunConfigDialog):
    """Run configuration dialog box: multiple file version"""
    def __init__(self, parent=None):
        BaseRunConfigDialog.__init__(self, parent)
        self.file_to_run = None
        self.combo = None
        self.stack = None

    def run_btn_clicked(self):
        """Run button was just clicked"""
        self.file_to_run = unicode(self.combo.currentText())

    def setup(self, fname):
        """Setup Run Configuration dialog with filename *fname*"""
        combo_label = QLabel(_("Select a run configuration:"))
        self.combo = QComboBox()
        self.combo.setMaxVisibleItems(20)
        self.combo.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLength)
        self.combo.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)

        self.stack = QStackedWidget()

        configurations = _get_run_configurations()
        for index, (filename, options) in enumerate(configurations):
            if fname == filename:
                break
        else:
            # There is no run configuration for script *fname*:
            # creating a temporary configuration that will be kept only if
            # dialog changes are accepted by the user
            configurations.insert(0, (fname, RunConfiguration(fname).get()))
            index = 0
        for filename, options in configurations:
            widget = RunConfigOptions(self)
            widget.set(options)
            self.combo.addItem(filename)
            self.stack.addWidget(widget)
        self.connect(self.combo, SIGNAL("currentIndexChanged(int)"),
                     self.stack.setCurrentIndex)
        self.combo.setCurrentIndex(index)

        self.add_widgets(combo_label, self.combo, 10, self.stack)
        self.add_button_box(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)

        self.setWindowTitle(_("Run Settings"))

    def accept(self):
        """Reimplement Qt method"""
        configurations = []
        for index in range(self.stack.count()):
            filename = unicode(self.combo.itemText(index))
            runconfigoptions = self.stack.widget(index)
            if index == self.stack.currentIndex() and\
               not runconfigoptions.is_valid():
                return
            options = runconfigoptions.get()
            configurations.append((filename, options))
        _set_run_configurations(configurations)
        QDialog.accept(self)
Ejemplo n.º 19
0
class RunConfigDialog(BaseRunConfigDialog):
    """Run configuration dialog box: multiple file version"""
    def __init__(self, parent=None):
        BaseRunConfigDialog.__init__(self, parent)
        self.file_to_run = None
        self.combo = None
        self.stack = None
        
    def run_btn_clicked(self):
        """Run button was just clicked"""
        self.file_to_run = unicode(self.combo.currentText())
        
    def setup(self, fname):
        """Setup Run Configuration dialog with filename *fname*"""
        combo_label = QLabel(_("Select a run configuration:"))
        self.combo = QComboBox()
        self.combo.setMaxVisibleItems(20)
        self.combo.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLength)
        self.combo.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        
        self.stack = QStackedWidget()

        configurations = _get_run_configurations()
        for index, (filename, options) in enumerate(configurations):
            if fname == filename:
                break
        else:
            # There is no run configuration for script *fname*:
            # creating a temporary configuration that will be kept only if
            # dialog changes are accepted by the user
            configurations.insert(0, (fname, RunConfiguration(fname).get()))
            index = 0
        for filename, options in configurations:
            widget = RunConfigOptions(self)
            widget.set(options)
            self.combo.addItem(filename)
            self.stack.addWidget(widget)
        self.connect(self.combo, SIGNAL("currentIndexChanged(int)"),
                     self.stack.setCurrentIndex)
        self.combo.setCurrentIndex(index)

        self.add_widgets(combo_label, self.combo, 10, self.stack)
        self.add_button_box(QDialogButtonBox.Ok|QDialogButtonBox.Cancel)

        self.setWindowTitle(_("Run Settings"))
        
    def accept(self):
        """Reimplement Qt method"""
        configurations = []
        for index in range(self.stack.count()):
            filename = unicode(self.combo.itemText(index))
            runconfigoptions = self.stack.widget(index)
            if index == self.stack.currentIndex() and\
               not runconfigoptions.is_valid():
                return
            options = runconfigoptions.get()
            configurations.append( (filename, options) )
        _set_run_configurations(configurations)
        QDialog.accept(self)
Ejemplo n.º 20
0
    def __init__(self, parent):
        super(ScorePartsWidget, self).__init__(parent)

        self.typesLabel = QLabel()
        self.typesView = QTreeView(selectionMode=QTreeView.ExtendedSelection,
                                   selectionBehavior=QTreeView.SelectRows,
                                   animated=True,
                                   headerHidden=True)
        self.scoreLabel = QLabel()
        self.scoreView = widgets.treewidget.TreeWidget(
            selectionMode=QTreeView.ExtendedSelection,
            selectionBehavior=QTreeView.SelectRows,
            headerHidden=True,
            animated=True,
            dragDropMode=QTreeView.InternalMove)
        self.addButton = QPushButton(icon=icons.get("list-add"))
        self.removeButton = QPushButton(icon=icons.get("list-remove"))
        self.upButton = QToolButton(icon=icons.get("go-up"))
        self.downButton = QToolButton(icon=icons.get("go-down"))
        self.partSettings = QStackedWidget()

        w = QWidget()
        self.addWidget(w)
        layout = QVBoxLayout(spacing=0)
        w.setLayout(layout)

        layout.addWidget(self.typesLabel)
        layout.addWidget(self.typesView)
        layout.addWidget(self.addButton)

        w = QWidget()
        self.addWidget(w)
        layout = QVBoxLayout(spacing=0)
        w.setLayout(layout)

        layout.addWidget(self.scoreLabel)
        layout.addWidget(self.scoreView)

        box = QHBoxLayout(spacing=0)
        layout.addLayout(box)

        box.addWidget(self.removeButton)
        box.addWidget(self.upButton)
        box.addWidget(self.downButton)

        self.addWidget(self.partSettings)

        self.typesView.setModel(parts.model())
        app.translateUI(self)

        # signal connections
        self.addButton.clicked.connect(self.slotAddButtonClicked)
        self.removeButton.clicked.connect(self.slotRemoveButtonClicked)
        self.typesView.doubleClicked.connect(self.slotDoubleClicked)
        self.scoreView.currentItemChanged.connect(self.slotCurrentItemChanged)
        self.upButton.clicked.connect(self.scoreView.moveSelectedChildrenUp)
        self.downButton.clicked.connect(
            self.scoreView.moveSelectedChildrenDown)
Ejemplo n.º 21
0
 def __init__(self, parent=None):
     QStackedWidget.__init__(self, parent)
     sizePolicy = QSizePolicy(QSizePolicy.MinimumExpanding,
                              QSizePolicy.MinimumExpanding)
     sizePolicy.setVerticalStretch(1)
     self.setSizePolicy(sizePolicy)
     self.currentWidget = None
     self.loader = loader()
     self.moduleName = None
Ejemplo n.º 22
0
    def __init__(self, *args, **kwargs):
        super(FltsSearchDockWidget, self).__init__(*args, **kwargs)
        self.setAllowedAreas(Qt.BottomDockWidgetArea)
        self._search_reg = SearchConfigurationRegistry.instance()
        self._stack_widget = QStackedWidget(self)
        self.setWidget(self._stack_widget)

        # Index data source to their location in the stack widget
        self._search_widget_idx = dict()
Ejemplo n.º 23
0
    def __init__(self, parent=None, fixedTime=''):
        self.fixedTime = fixedTime
        self.default_quote_font_size = 40
        self.default_author_font_size = 37
        self.min_font_size = 10

        QWidget.__init__(self)
        #set up the main quote area
        self.stackIndex = 0
        self.setObjectName("clockWidget")
        self.setStyleSheet(myStyleSheet)
        vlayout = QVBoxLayout()
        self.font = QFont()
        self.font.setFamily("Times")
        self.font.setPointSize(self.default_quote_font_size)
        self.font.setBold(False)
        self.font.setWeight(50)
        self.timeLabel = QTextEdit()
        self.timeLabel.setFixedSize(750, 340)  # 400)
        self.timeLabel.setFont(self.font)
        self.timeLabel.setObjectName("timeLabel")
        self.timeLabel.setText("Some great quote goes here!")
        self.timeLabel.setReadOnly(True)
        self.timeLabel.mousePressEvent = self.toggleStack
        self.timeLabel.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        #we make this a stack widget so we can display the quit button and quote, dialog boxes are ugly with full screen apps
        self.stack = QStackedWidget()
        self.stack.addWidget(self.timeLabel)
        self.quitWidget = quitW()
        self.stack.addWidget(self.quitWidget)
        self.stack.setCurrentIndex(self.stackIndex)
        vlayout.addWidget(self.stack)
        #set up the author area
        self.authLabel = QTextEdit()
        self.authLabel.setFixedSize(680, 81)
        self.fonta = QFont()
        self.fonta.setFamily("Times")
        self.fonta.setPointSize(self.default_author_font_size)
        self.authLabel.setFont(self.fonta)
        self.authLabel.setObjectName("authorLabel")
        self.authLabel.setText("Title, Author")
        self.authLabel.setAlignment(Qt.AlignRight)
        self.authLabel.setReadOnly(True)
        self.authLabel.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        vlayout.addWidget(self.authLabel)
        #add the layouts to the widget
        mainLayout = QGridLayout()
        mainLayout.addLayout(vlayout, 0, 1)
        self.setLayout(mainLayout)
        self.loadData()
        #set up the timer to run every second
        self.timer = QTimer(self)
        self.timer.timeout.connect(self.Time)
        self.currentMin = 61  #to ensure it triggers time diff check at start up
        self.Time()
        self.timer.start(1000)
Ejemplo n.º 24
0
 def __init__(self, parent=None):
     super(MainWindow, self).__init__(parent)
     self.setWindowFlags(Qt.FramelessWindowHint)
     self.setGeometry(geom['win']['g']['x'], geom['win']['g']['y'], geom['win']['g']['w'], geom['win']['g']['h'])
     self.setStyleSheet(BG_STYLE)
     self.cw = QStackedWidget()
     self.setCentralWidget(self.cw)
     stopby = Stopat(IMAGES, self, options = VLC_OPTIONS)
     self.cw.insertWidget(STOPAT_NDX, stopby)
     self.cw.setCurrentIndex(STOPAT_NDX)
Ejemplo n.º 25
0
 def __init__(self, parent=None):
     """
     Constructor
     
     @param parent reference to the parent widget
     @type QWidget
     """
     QStackedWidget.__init__(self, parent)
     self.parent=parent
     self.setupUi(self)
Ejemplo n.º 26
0
class AccountWidget(QWidget):
    def __init__(self, parent=None):
        super(AccountWidget, self).__init__(parent)

        # codeCompletionBlock start
        from PyQt4.QtGui import QTreeWidget, QStackedWidget
        self.dateTree = QTreeWidget()
        self.monthStack = QStackedWidget()
        # codeCompletionBlock end

        uic.loadUi(getUiFile('AccountWidget'), self)

        self.dateTree.currentItemChanged.connect(self.syncronizeStack)

        self.addTopLevelPeriod('CurrentTotal')

    def addNewSubaccount(self):
        data = self.inquireSubaccountData()
        print self

    def inquireSubaccountData(self):
        pass

    def addNextMonth(self):
        # treewidget get toplevel items
        # find last item
        # add new toplevvelitem if  toplevel item has 12 subitems
        # add new sublevel item

        last = self.getLastItem()

        month = last.monthwidget
        self.dateTree.addMonth(month)


    def addSecondLevelPeriod(self, text):
        # TODO: find previous item
        item = self.dateTree.currentItem()
        if item:
            item.addChildren([QTreeWidgetItem([text])])
            self.monthStack.addWidget(MonthWidget())
            print self.getLastItem()

    def getLastItem(self):
        return MonthItem(1, MonthWidget())

    def addTopLevelPeriod(self, text):
        self.monthStack.addWidget(MonthWidget())
        item = QTreeWidgetItem([text])
        self.dateTree.addTopLevelItem(item)
        self.dateTree.setCurrentItem(item)

    def syncronizeStack(self, item):
        print item
Ejemplo n.º 27
0
class ConfigWidget(QWidget):
    def __init__(self, parent=None):
        QWidget.__init__(self, parent)

        layout = QFormLayout()
        self.setLayout(layout)

        self.inputLabel = QLabel("Video Input")
        self.inputLayout = QHBoxLayout()
        self.inputCombobox = QComboBox()
        self.inputSettingsToolButton = QToolButton()
        self.inputSettingsToolButton.setText("Settings")
        configIcon = QIcon.fromTheme("preferences-other")
        self.inputSettingsToolButton.setIcon(configIcon)
        self.inputSettingsToolButton.setSizePolicy(QSizePolicy.Maximum,
                                                   QSizePolicy.Maximum)
        self.inputSettingsToolButton.setToolButtonStyle(Qt.ToolButtonIconOnly)
        self.inputSettingsStack = QStackedWidget()
        blankWidget = QWidget()
        self.inputSettingsStack.addWidget(blankWidget)
        self.inputSettingsStack.addWidget(self.inputSettingsToolButton)
        self.inputLayout.addWidget(self.inputCombobox)
        self.inputLayout.addWidget(self.inputSettingsStack)
        layout.addRow(self.inputLabel, self.inputLayout)

        self.videocolourLabel = QLabel(self.tr("Colour Format"))
        self.videocolourComboBox = QComboBox()
        self.videocolourComboBox.addItem("video/x-raw-rgb")
        self.videocolourComboBox.addItem("video/x-raw-yuv")
        self.videocolourComboBox.setSizePolicy(QSizePolicy.Minimum,
                                               QSizePolicy.Maximum)
        layout.addRow(self.videocolourLabel, self.videocolourComboBox)

        self.framerateLabel = QLabel("Framerate")
        self.framerateLayout = QHBoxLayout()
        self.framerateSlider = QSlider()
        self.framerateSlider.setOrientation(Qt.Horizontal)
        self.framerateSlider.setMinimum(1)
        self.framerateSlider.setMaximum(60)
        self.framerateSpinBox = QSpinBox()
        self.framerateSpinBox.setMinimum(1)
        self.framerateSpinBox.setMaximum(60)
        self.framerateLayout.addWidget(self.framerateSlider)
        self.framerateLayout.addWidget(self.framerateSpinBox)
        layout.addRow(self.framerateLabel, self.framerateLayout)

        self.videoscaleLabel = QLabel("Video Scale")
        self.videoscaleComboBox = QComboBox()
        for scale in resmap:
            self.videoscaleComboBox.addItem(scale)
        self.videoscaleComboBox.setSizePolicy(QSizePolicy.Minimum,
                                              QSizePolicy.Maximum)
        layout.addRow(self.videoscaleLabel, self.videoscaleComboBox)
Ejemplo n.º 28
0
    def __init__(self):
        QWidget.__init__(self)

        layout = QVBoxLayout()

        self._simulation_mode_combo = QComboBox()
        addHelpToWidget(self._simulation_mode_combo, "run/simulation_mode")

        self._simulation_mode_combo.currentIndexChanged.connect(
            self.toggleSimulationMode)

        simulation_mode_layout = QHBoxLayout()
        simulation_mode_layout.addSpacing(10)
        simulation_mode_layout.addWidget(QLabel("Simulation mode:"), 0,
                                         Qt.AlignVCenter)
        simulation_mode_layout.addWidget(self._simulation_mode_combo, 0,
                                         Qt.AlignVCenter)

        simulation_mode_layout.addSpacing(20)

        self.run_button = QToolButton()
        self.run_button.setIconSize(QSize(32, 32))
        self.run_button.setText("Start Simulation")
        self.run_button.setIcon(resourceIcon("ide/gear_in_play"))
        self.run_button.clicked.connect(self.runSimulation)
        self.run_button.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
        addHelpToWidget(self.run_button, "run/start_simulation")

        simulation_mode_layout.addWidget(self.run_button)
        simulation_mode_layout.addStretch(1)

        layout.addSpacing(5)
        layout.addLayout(simulation_mode_layout)
        layout.addSpacing(10)

        self._simulation_stack = QStackedWidget()
        self._simulation_stack.setLineWidth(1)
        self._simulation_stack.setFrameStyle(QFrame.StyledPanel)

        layout.addWidget(self._simulation_stack)

        self._simulation_widgets = OrderedDict()
        """ :type: OrderedDict[BaseRunModel,SimulationConfigPanel]"""

        self.addSimulationConfigPanel(SingleTestRunPanel())
        self.addSimulationConfigPanel(EnsembleExperimentPanel())
        self.addSimulationConfigPanel(EnsembleSmootherPanel())
        self.addSimulationConfigPanel(
            IteratedEnsembleSmootherPanel(advanced_option=True))
        self.addSimulationConfigPanel(MultipleDataAssimilationPanel())

        self.setLayout(layout)
Ejemplo n.º 29
0
    def __init__(self,
                 parentApplet,
                 dataSelectionOperator,
                 serializer,
                 instructionText,
                 guiMode=GuiMode.Normal,
                 max_lanes=None,
                 show_axis_details=False):
        """
        Constructor.
        
        :param dataSelectionOperator: The top-level operator.  Must be of type :py:class:`OpMultiLaneDataSelectionGroup`.
        :param serializer: The applet's serializer.  Must be of type :py:class:`DataSelectionSerializer`
        :param instructionText: A string to display in the applet drawer.
        :param guiMode: Either ``GuiMode.Normal`` or ``GuiMode.Batch``.  Currently, there is no difference between normal and batch mode.
        :param max_lanes: The maximum number of lanes that the user is permitted to add to this workflow.  If ``None``, there is no maximum.
        """
        super(DataSelectionGui, self).__init__()
        self._cleaning_up = False
        self.parentApplet = parentApplet
        self._max_lanes = max_lanes
        self._default_h5_volumes = {}
        self.show_axis_details = show_axis_details

        self._viewerControls = QWidget()
        self.topLevelOperator = dataSelectionOperator
        self.guiMode = guiMode
        self.serializer = serializer
        self.threadRouter = ThreadRouter(self)

        self._initCentralUic()
        self._initAppletDrawerUic(instructionText)

        self._viewerControlWidgetStack = QStackedWidget(self)

        def handleImageRemove(multislot, index, finalLength):
            # Remove the viewer for this dataset
            datasetSlot = self.topLevelOperator.DatasetGroup[index]
            if datasetSlot in self.volumeEditors.keys():
                editor = self.volumeEditors[datasetSlot]
                self.viewerStack.removeWidget(editor)
                self._viewerControlWidgetStack.removeWidget(
                    editor.viewerControlWidget())
                editor.stopAndCleanUp()

        self.topLevelOperator.DatasetGroup.notifyRemove(
            bind(handleImageRemove))

        opWorkflow = self.topLevelOperator.parent
        assert hasattr(opWorkflow.shell, 'onSaveProjectActionTriggered'), \
            "This class uses the IlastikShell.onSaveProjectActionTriggered function.  Did you rename it?"
Ejemplo n.º 30
0
class ConfigWidget(QWidget):

    def __init__(self, parent=None):
        QWidget.__init__(self, parent)

        layout = QFormLayout()
        self.setLayout(layout)

        self.inputLabel = QLabel("Video Input")
        self.inputLayout = QHBoxLayout()
        self.inputCombobox = QComboBox()
        self.inputSettingsToolButton = QToolButton()
        self.inputSettingsToolButton.setText("Settings")
        configIcon = QIcon.fromTheme("preferences-other")
        self.inputSettingsToolButton.setIcon(configIcon)
        self.inputSettingsToolButton.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
        self.inputSettingsToolButton.setToolButtonStyle(Qt.ToolButtonIconOnly)
        self.inputSettingsStack = QStackedWidget()
        blankWidget = QWidget()
        self.inputSettingsStack.addWidget(blankWidget)
        self.inputSettingsStack.addWidget(self.inputSettingsToolButton)
        self.inputLayout.addWidget(self.inputCombobox)
        self.inputLayout.addWidget(self.inputSettingsStack)
        layout.addRow(self.inputLabel, self.inputLayout)

        self.videocolourLabel = QLabel(self.tr("Colour Format"))
        self.videocolourComboBox = QComboBox()
        self.videocolourComboBox.addItem("video/x-raw-rgb")
        self.videocolourComboBox.addItem("video/x-raw-yuv")
        self.videocolourComboBox.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Maximum)
        layout.addRow(self.videocolourLabel, self.videocolourComboBox)

        self.framerateLabel = QLabel("Framerate")
        self.framerateLayout = QHBoxLayout()
        self.framerateSlider = QSlider()
        self.framerateSlider.setOrientation(Qt.Horizontal)
        self.framerateSlider.setMinimum(1)
        self.framerateSlider.setMaximum(60)
        self.framerateSpinBox = QSpinBox()
        self.framerateSpinBox.setMinimum(1)
        self.framerateSpinBox.setMaximum(60)
        self.framerateLayout.addWidget(self.framerateSlider)
        self.framerateLayout.addWidget(self.framerateSpinBox)
        layout.addRow(self.framerateLabel, self.framerateLayout)

        self.videoscaleLabel = QLabel("Video Scale")
        self.videoscaleComboBox = QComboBox()
        for scale in resmap:
            self.videoscaleComboBox.addItem(scale)
        self.videoscaleComboBox.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Maximum)
        layout.addRow(self.videoscaleLabel, self.videoscaleComboBox)
Ejemplo n.º 31
0
	def __init__ (self):
		QMainWindow.__init__ (self)

		self.controller = Controller ()
		self.listener = LeapListener (self)
		self.controller.add_listener (self.listener)

		self.mode = "gallery"
		self.scroll = False
		self.direction = ""
		self.direction_x = 0
		self.scroll_velocity = 0
		self.current_index = 0

		# List containing images for the gallery
		self.list_view = QListWidget ()
		self.list_view.setFlow (0)
		self.list_view.setHorizontalScrollMode (1)
		self.list_view.setMouseTracking (True)
		self.list_view.itemClicked.connect (self.show_image)

		# Setting the style of the ListView, background, item selected, etc
		self.list_view.setStyleSheet ("""
				QListWidget::item:hover {background: transparent;}
				QListWidget::item:disabled:hover {background: transparent;}
				QListWidget::item:hover:!active {background: transparent;}
				QListWidget::item:selected:active {background: transparent;}
	            QListWidget::item:selected:!active {background: transparent;}
	            QListWidget::item:selected:disabled {background: transparent;}
	            QListWidget::item:selected:!disabled {background: transparent;}
	            QListWidget {background: #2C3539}
			""")

		# Image viewer
		self.scene = QGraphicsScene ()
		self.viewer = QGraphicsView (self.scene)

		self.stackedWidget = QStackedWidget ()
		self.stackedWidget.addWidget (self.list_view)
		self.stackedWidget.addWidget (self.viewer)

		self.setCentralWidget (self.stackedWidget)
		self.resize (500, 400)
		self.showMaximized ()

		scan = ScanLibrary ("/home/chris/Example")
		threads.append (scan)
		self.connect (scan, SIGNAL (scan.signal), self.add_images_to_list)
		scan.start ()

		self.connect (self, SIGNAL ("scrollChanged(bool)"), self.scroll_view)
Ejemplo n.º 32
0
    def load_ui(self):
        container = QVBoxLayout(self)

        box = QHBoxLayout()
        box.setContentsMargins(0, 0, 0, 0)
        box.setSpacing(0)
        toolbar = QToolBar()
        toolbar.setToolButtonStyle(3)
        toolbar.setOrientation(Qt.Vertical)
        toolbar.setIconSize(QSize(30, 30))
        toolbar.setObjectName("preferencias")

        environment_section = toolbar.addAction(QIcon(":image/general-pref"),
                                                "Entorno")
        editor_section = toolbar.addAction(QIcon(":image/editor-pref"),
                                           "Editor")
        compiler_section = toolbar.addAction(QIcon(":image/compiler-pref"),
                                             "Compilador")
        self.connect(environment_section, SIGNAL("triggered()"),
                     lambda: self.change_widget(0))
        self.connect(editor_section, SIGNAL("triggered()"),
                     lambda: self.change_widget(1))
        self.connect(compiler_section, SIGNAL("triggered()"),
                     lambda: self.change_widget(2))

        # Set size
        for action in toolbar.actions():
            widget = toolbar.widgetForAction(action)
            widget.setFixedSize(80, 50)

        box.addWidget(toolbar)

        self.stack = QStackedWidget()
        box.addWidget(self.stack)

        # Load sections and subsections
        for section in self.__sections:
            for name, obj in list(section.get_tabs().items()):
                section.install_tab(obj, name)
            self.stack.addWidget(section)

        box_buttons = QHBoxLayout()
        box_buttons.setMargin(10)
        box_buttons.setSpacing(10)
        box_buttons.addStretch(1)
        self.btn_cancel = QPushButton(self.tr("Cancelar"))
        self.btn_guardar = QPushButton(self.tr("Guardar"))
        box_buttons.addWidget(self.btn_cancel)
        box_buttons.addWidget(self.btn_guardar)
        container.addLayout(box)
        container.addLayout(box_buttons)
Ejemplo n.º 33
0
class FormTabWidget(QWidget):
    def __init__(self, datalist, comment="", parent=None):
        QWidget.__init__(self, parent)
        layout = QHBoxLayout()
        self.contentsWidget = QListWidget()
        self.contentsWidget.setViewMode(QListView.ListMode)
        self.contentsWidget.setMovement(QListView.Static)
        self.contentsWidget.setMaximumWidth(128)

        self.pagesWidget = QStackedWidget()
        layout.addWidget(self.contentsWidget)
        layout.addWidget(self.pagesWidget)
        self.setLayout(layout)
        self.widgetlist = []

        for elem in datalist:
            if len(elem) == 4:
                data, title, comment, icon = elem
            else:
                data, title, comment = elem
                icon = None

            if len(data[0]) == 3:
                widget = FormComboWidget(data, comment=comment, parent=self)
            else:
                widget = FormWidget(data, comment=comment, parent=self)
            #index = self.tabwidget.addTab(widget, title)
            #self.tabwidget.setTabToolTip(index, comment)
            self.pagesWidget.addWidget(widget)
            contentItem = QListWidgetItem(self.contentsWidget)
            if icon:
                contentItem.setIcon(icon)
            contentItem.setText(title)
            contentItem.setToolTip(comment)
            contentItem.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled)
            self.contentsWidget.addItem(contentItem)
            self.widgetlist.append(widget)

        self.contentsWidget.currentRowChanged.connect(self.changePage)

    def changePage(self, current):
        if current != -1:
            self.pagesWidget.setCurrentIndex(current)

    def setup(self):
        for widget in self.widgetlist:
            widget.setup()

    def get(self):
        return [ widget.get() for widget in self.widgetlist]
Ejemplo n.º 34
0
class ComboTabWidget(QWidget):
    def __init__(self, parent):
        super(ComboTabWidget, self).__init__(parent)
        layout = QVBoxLayout(self)
        layout.setSpacing(0)
        
        self.switchCombo = QComboBox(self)
        layout.addWidget(self.switchCombo, 0, Qt.AlignCenter)
        
        groupBox = QGroupBox(self)
        groupBoxLayout = QVBoxLayout(groupBox)
        groupBoxLayout.setSpacing(0)
        
        self.pageArea = QStackedWidget(groupBox)
        groupBoxLayout.addWidget(self.pageArea)
        
        layout.addWidget(groupBox, 1)
        
        self.switchCombo.currentIndexChanged.connect(self.pageArea.setCurrentIndex)
        
    def setTabPosition(self, tabPos):
        pass
        
    def addTab(self, w, tabText):
        self.pageArea.addWidget(w)
        self.switchCombo.addItem(tabText)
    
    def insertTab(self, pos, w, tabText):
        self.pageArea.insertWidget(pos, w)
        self.switchCombo.insertItem(pos, tabText)
        
    def removeTab(self, index=-1):
        if index < 0:
            index = self.currentIndex()
        
        w = self.pageArea.widget(index)
        
        self.pageArea.removeWidget(w)
        self.switchCombo.removeItem(index)
        
    def updateTab(self, w, tabText, index=-1):
        if index < 0:
            index = self.switchCombo.currentIndex()
        
        self.removeTab(index)
        self.insertTab(index, w, tabText)
        self.setCurrentIndex(index)
        
    def setCurrentIndex(self, index):
        self.switchCombo.setCurrentIndex(index)
        
    def widget(self, index):
        return self.pageArea.widget(index)
        
    def currentIndex(self):
        return self.switchCombo.currentIndex()
    
    def count(self):
        return self.switchCombo.count()
Ejemplo n.º 35
0
    def setup(self, fname):
        """Setup Run Configuration dialog with filename *fname*"""
        combo_label = QLabel(_("Select a run configuration:"))
        self.combo = QComboBox()
        self.combo.setMaxVisibleItems(20)
        self.combo.setSizeAdjustPolicy(QComboBox.AdjustToMinimumContentsLength)
        self.combo.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        
        self.stack = QStackedWidget()

        configurations = _get_run_configurations()
        for index, (filename, options) in enumerate(configurations):
            if fname == filename:
                break
        else:
            # There is no run configuration for script *fname*:
            # creating a temporary configuration that will be kept only if
            # dialog changes are accepted by the user
            configurations.insert(0, (fname, RunConfiguration(fname).get()))
            index = 0
        for filename, options in configurations:
            widget = RunConfigOptions(self)
            widget.set(options)
            self.combo.addItem(filename)
            self.stack.addWidget(widget)
        self.connect(self.combo, SIGNAL("currentIndexChanged(int)"),
                     self.stack.setCurrentIndex)
        self.combo.setCurrentIndex(index)

        self.add_widgets(combo_label, self.combo, 10, self.stack)
        self.add_button_box(QDialogButtonBox.Ok|QDialogButtonBox.Cancel)

        self.setWindowTitle(_("Run Settings"))
Ejemplo n.º 36
0
    def _create_widgets(self):
        self.stacked = QStackedWidget()
        self.datew = QDateEdit()
        self.datew.setDisplayFormat("yyyy-MM-dd")
        self.stacked.addWidget(self.datew)
        self.buildidw = QLineEdit()
        self.stacked.addWidget(self.buildidw)
        self.releasew = QComboBox()
        self.releasew.addItems([str(k) for k in sorted(releases())])
        self.stacked.addWidget(self.releasew)
        self.revw = QLineEdit()
        self.stacked.addWidget(self.revw)

        self.select_combo = QComboBox()
        self.select_combo.addItems(['date', 'buildid', 'release', 'changeset'])
        self.select_combo.activated.connect(self.stacked.setCurrentIndex)
Ejemplo n.º 37
0
    def __init__(self, data, scheme, parent=None):
        super(NodeWindow, self).__init__(parent)
        self.pathWidget = PathWidget(self.openWidgetByPath, data.path())
        self.setStatusBar(self.pathWidget)
#        layout_set_sm_and_mrg(self.layout)
        self.cachedWidgets = {}
        self.currentStructuredWidget = None
        self.stacked = QStackedWidget(self)
        self.setCentralWidget(self.stacked)

        self.data, self.scheme = data, scheme
        self.data.add_set_notify(self.change_caption)
        self.toolbar = QToolBar()
        self.toolbar.addActions((self.parent().actionSave,self.parent().actionSaveAs,))
        self.addToolBar(self.toolbar)
        self.setUnifiedTitleAndToolBarOnMac(True)
        self.messageBoxChanged = None
        self.reallyQuit = False
        self.change_caption()

        if "ExcelScheme" in self.scheme.get_meta():
            actionExcelExport = QAction("Export to excel", self)
            self.toolbar.addAction(actionExcelExport)
            actionExcelExport.triggered.connect(self.excel_export)
            actionExcelMerge = QAction("Merge from excel", self)
            actionExcelMerge.triggered.connect(self.excel_import)
            self.toolbar.addAction(actionExcelMerge)

        self.tree_widget = DataTreeWidget(self.data, self)
        dock = QDockWidget(self)
        dock.setWidget(self.tree_widget)
        self.addDockWidget(Qt.LeftDockWidgetArea, dock)
        self.tree_widget.pathChanged.connect(self._open_widget_by_path)

        self.openWidgetByPath(Path())
Ejemplo n.º 38
0
    def __init__(self, dataSelectionOperator, serializer, guiControlSignal, guiMode=GuiMode.Normal, title="Input Selection"):
        with Tracer(traceLogger):
            super(DataSelectionGui, self).__init__()

            self.title = title

            self._viewerControls = QWidget()
            self.topLevelOperator = dataSelectionOperator
            self.guiMode = guiMode
            self.serializer = serializer
            self.guiControlSignal = guiControlSignal
            self.threadRouter = ThreadRouter(self)

            self._initCentralUic()
            self._initAppletDrawerUic()
            
            self._viewerControlWidgetStack = QStackedWidget(self)

            def handleImageRemoved(multislot, index, finalLength):
                # Remove the viewer for this dataset
                imageSlot = self.topLevelOperator.Image[index]
                if imageSlot in self.volumeEditors.keys():
                    editor = self.volumeEditors[imageSlot]
                    self.viewerStack.removeWidget( editor )
                    self._viewerControlWidgetStack.removeWidget( editor.viewerControlWidget() )
                    editor.stopAndCleanUp()

            self.topLevelOperator.Image.notifyRemove( bind( handleImageRemoved ) )
Ejemplo n.º 39
0
    def initWidgets(self):
        # create subwidgets
        self.player   = Player(self)
        self.playlist = Playlist(self)
        self.browser  = Browser(self)
        if have_maemo:
            # build Maemo stack hierarchy
            self.playlist.setParent(self.player)
            self.browser.setParent(self.player)
            for w in [ self.player, self.playlist, self.browser ]:
                w.setAttribute( Qt.WA_Maemo5StackedWindow)
                w.setWindowFlags( w.windowFlags() | Qt.Window)

            # add menu bar
            menu = QMenuBar(self.player)
            menu.addAction(self.actionPlaylist)
            menu.addAction(self.actionBrowser)
            menu.addAction(self.actionStats)
            menu.addAction(self.actionOutputs)
            menu.addAction(self.actionPrefs)
            menu.addAction(self.actionConnect)
        else:
            self.stack = QStackedWidget()
            for w in [ self.player, self.playlist, self.browser ]:
                w.setParent(self.stack)
                self.stack.addWidget(w)
Ejemplo n.º 40
0
    def _createWidgets(self):


        self.widgets = QStackedWidget(self)

        self.warning_label = QLabel(self)
        self.warning_label.setStyleSheet(
            "QLabel { background-color : #FF8383;}")

        self.warning_label.setWordWrap(True)
        self.warning_label.setContentsMargins(5, 5, 5, 5)
        self.warning_label.hide()

        self.loading = LoadingWidget(self)
        self.messages = IconWidget(self)
        self.tracklist = TracklistWidget(self)
        self.upload_progress = UploadProgressWidget(self)


        self.widgets.addWidget(self.loading)
        self.widgets.addWidget(self.messages)
        self.widgets.addWidget(self.tracklist)
        self.widgets.addWidget(self.upload_progress)


        settings = self._getSettings()

        if settings.contains('strava/username') or \
           settings.contains('strava/password'):
            self.tracklist.clear_password.show()

        self.tracklist.clear_password.clicked.connect(self._onClearPassword)

        self.upload_progress.close_button.clicked.connect(self._showTracklist)
Ejemplo n.º 41
0
    def __init__(self, parent, noi):
        super(Declaration, self).__init__(parent)
        self.setupUi(self)
        self.noidec = noi
        self.parent = parent
        self.scenario = parent.scenario


        self.pages_widget = QStackedWidget()
        self.connect(self.pages_widget, SIGNAL("currentChanged(int)"), self.current_page_changed)
        self.connect(self.contents_widget, SIGNAL("currentRowChanged(int)"), self.pages_widget.setCurrentIndex)
                
        self.scrollArea.setWidget(self.pages_widget)

        self.connect(self.next_btn, SIGNAL('clicked()'), self.next_page)
        self.connect(self.prev_btn, SIGNAL('clicked()'), self.prev_page)

        self.pages = [Page01(self),  Page02(self), Page03(self), Page04(self), 
                      Page05(self), Page06(self), Page07(self), PageIsf(self)]

        for widget in self.pages:
            self.add_page(widget)


        self.set_current_index(0)
        self.current_page_changed(0)
Ejemplo n.º 42
0
 def __init__(self, manager, parent=None):
     super(ViewSpace, self).__init__(parent)
     self.manager = weakref.ref(manager)
     self.views = []
     
     layout = QVBoxLayout()
     layout.setContentsMargins(0, 0, 0, 0)
     layout.setSpacing(0)
     self.setLayout(layout)
     self.stack = QStackedWidget(self)
     layout.addWidget(self.stack)
     self.status = ViewStatusBar(self)
     self.status.setEnabled(False)
     layout.addWidget(self.status)
     app.languageChanged.connect(self.updateStatusBar)
     app.viewSpaceCreated(self)
Ejemplo n.º 43
0
    def __init__(self, type_key, title, select_min_time_value=False):
        QWidget.__init__(self)

        self.__type_key = type_key
        self.__type = None

        self.__double_spinner = self.createDoubleSpinner(minimum=-999999999.0, maximum=999999999.0)
        self.__integer_spinner = self.createIntegerSpinner(minimum=0, maximum=999999999)

        self.__time_map = ReportStepsModel().getList()
        self.__time_index_map = {}
        for index in range(len(self.__time_map)):
            time = self.__time_map[index]
            self.__time_index_map[time] = index

        self.__time_spinner = self.createTimeSpinner(select_minimum_value=select_min_time_value)

        layout = QVBoxLayout()
        self.setLayout(layout)

        self.__label = QLabel(title)
        self.__label.setAlignment(Qt.AlignHCenter)

        self.__stack = QStackedWidget()
        self.__stack.setSizePolicy(QSizePolicy(QSizePolicy.Preferred))
        self.__stack.addWidget(self.__integer_spinner)
        self.__stack.addWidget(self.__double_spinner)
        self.__stack.addWidget(self.__time_spinner)

        layout.addWidget(self.__stack)
        layout.addWidget(self.__label)

        self.setLayout(layout)
Ejemplo n.º 44
0
    def __init__(self, parent=None):
        super(Widget, self).__init__(parent)

        self.widgetInputCount = inputcountselectionpanel.Widget()
        self.widgetExperiment = experimentpanel.Widget()

        self.stackedWidget = QStackedWidget()
        self.stackedWidget.addWidget(self.widgetInputCount)
        self.stackedWidget.addWidget(self.widgetExperiment)

        self.buttonBack = QPushButton('Back')
        self.buttonBack.setEnabled(False)
        self.buttonNext = QPushButton('Next')

        hboxLayoutButton = QHBoxLayout()
        hboxLayoutButton.addStretch(1)
        hboxLayoutButton.addWidget(self.buttonBack)
        hboxLayoutButton.addWidget(self.buttonNext)

        vboxLayout = QVBoxLayout()
        vboxLayout.addWidget(self.stackedWidget)
        vboxLayout.addLayout(hboxLayoutButton)

        self.setWindowTitle('Examination of a single neuron with multiple inputs (example 01c)')
        self.setLayout(vboxLayout)
        self.connect(self.buttonNext, SIGNAL('clicked()'), self.nextWidget)
        self.connect(self.buttonBack, SIGNAL('clicked()'), self.backWidget)
        self.connect(self.widgetExperiment.buttonRecalculate, SIGNAL('clicked()'), self.updateResult)
Ejemplo n.º 45
0
    def __init__(self, type_key, title, select_min_time_value=False):
        QWidget.__init__(self)

        self.__type_key = type_key
        self.__type = None

        self.__double_spinner = self.createDoubleSpinner(minimum=-99999999.0, maximum=99999999.0)
        self.__integer_spinner = self.createIntegerSpinner(minimum=0, maximum=999999999)

        self.__time_map = ReportStepsModel().getList()
        self.__time_index_map = {}
        for index in range(len(self.__time_map)):
            time = self.__time_map[index]
            self.__time_index_map[time] = index

        self.__time_spinner = self.createTimeSpinner(select_minimum_value=select_min_time_value)

        layout = QVBoxLayout()
        self.setLayout(layout)

        self.__checkbox = QCheckBox(title)
        self.__checkbox.setChecked(False)

        self.__stack = QStackedWidget()
        self.__stack.setSizePolicy(QSizePolicy(QSizePolicy.Minimum))
        self.__stack.addWidget(self.__integer_spinner)
        self.__stack.addWidget(self.__double_spinner)
        self.__stack.addWidget(self.__time_spinner)

        layout.addWidget(self.__stack)
        layout.addWidget(self.__checkbox)

        self.__checkbox.stateChanged.connect(self.toggleCheckbox)
        self.setLayout(layout)
Ejemplo n.º 46
0
 def __init__(self, mainwindow):
     super(PreferencesDialog, self).__init__(mainwindow)
     self.setWindowModality(Qt.WindowModal)
     if mainwindow:
         self.addAction(mainwindow.actionCollection.help_whatsthis)
     layout = QVBoxLayout()
     layout.setSpacing(10)
     self.setLayout(layout)
     
     # listview to the left, stacked widget to the right
     top = QHBoxLayout()
     layout.addLayout(top)
     
     self.pagelist = QListWidget(self)
     self.stack = QStackedWidget(self)
     top.addWidget(self.pagelist, 0)
     top.addWidget(self.stack, 2)
     
     layout.addWidget(widgets.Separator(self))
     
     b = self.buttons = QDialogButtonBox(self)
     b.setStandardButtons(
         QDialogButtonBox.Ok
         | QDialogButtonBox.Cancel
         | QDialogButtonBox.Apply
         | QDialogButtonBox.Reset
         | QDialogButtonBox.Help)
     layout.addWidget(b)
     b.accepted.connect(self.accept)
     b.rejected.connect(self.reject)
     b.button(QDialogButtonBox.Apply).clicked.connect(self.saveSettings)
     b.button(QDialogButtonBox.Reset).clicked.connect(self.loadSettings)
     b.button(QDialogButtonBox.Help).clicked.connect(self.showHelp)
     b.button(QDialogButtonBox.Help).setShortcut(QKeySequence.HelpContents)
     b.button(QDialogButtonBox.Apply).setEnabled(False)
     
     # fill the pagelist
     self.pagelist.setIconSize(QSize(32, 32))
     self.pagelist.setSpacing(2)
     for item in pageorder():
         self.pagelist.addItem(item())
     self.pagelist.currentItemChanged.connect(self.slotCurrentItemChanged)
     
     app.translateUI(self, 100)
     # read our size and selected page
     qutil.saveDialogSize(self, "preferences/dialog/size", QSize(500, 300))
     self.pagelist.setCurrentRow(_prefsindex)
 def __init__(self, parent=None):
     """ Inizializza il componente"""
     QStackedWidget.__init__(self, parent)
     self.__m_vertical=False
     self.__m_speed=500
     self.__m_animationtype = QEasingCurve.OutQuint #QEasingCurve.OutBack
     self.__m_now=0
     self.__m_next=0
     self.__m_pnow=QPoint(0,0)
     self.__m_active = False
     self.__direction = self.__SLIDE_TYPE.RIGHT2LEFT
     self.__animgroup = QtCore.QParallelAnimationGroup()
     self.__animgroup.finished.connect(self.__animationDone)
     self.__animnext = QPropertyAnimation(None, "pos")
     self.__animnow = QPropertyAnimation(None, "pos")
     #self.setMinimumSize(300, 300)
     self.setStyleSheet("background-color: rgb(184, 184, 184);")
 def __init__(self, parent=None):
     """ Inizializza il componente"""
     QStackedWidget.__init__(self, parent)
     self.__m_vertical = False
     self.__m_speed = 500
     self.__m_animationtype = QEasingCurve.OutQuint  #QEasingCurve.OutBack
     self.__m_now = 0
     self.__m_next = 0
     self.__m_pnow = QPoint(0, 0)
     self.__m_active = False
     self.__direction = self.__SLIDE_TYPE.RIGHT2LEFT
     self.__animgroup = QtCore.QParallelAnimationGroup()
     self.__animgroup.finished.connect(self.__animationDone)
     self.__animnext = QPropertyAnimation(None, "pos")
     self.__animnow = QPropertyAnimation(None, "pos")
     #self.setMinimumSize(300, 300)
     self.setStyleSheet("background-color: rgb(184, 184, 184);")
Ejemplo n.º 49
0
    def __init__(self, parent):
        super(ScorePartsWidget, self).__init__(parent)
        
        self.typesLabel = QLabel()
        self.typesView = QTreeView(
            selectionMode=QTreeView.ExtendedSelection,
            selectionBehavior=QTreeView.SelectRows,
            animated=True,
            headerHidden=True)
        self.scoreLabel = QLabel()
        self.scoreView = widgets.treewidget.TreeWidget(
            selectionMode=QTreeView.ExtendedSelection,
            selectionBehavior=QTreeView.SelectRows,
            headerHidden=True,
            animated=True,
            dragDropMode=QTreeView.InternalMove)
        self.addButton = QPushButton(icon = icons.get("list-add"))
        self.removeButton = QPushButton(icon = icons.get("list-remove"))
        self.upButton = QToolButton(icon = icons.get("go-up"))
        self.downButton = QToolButton(icon = icons.get("go-down"))
        self.partSettings = QStackedWidget()
        
        w = QWidget()
        self.addWidget(w)
        layout = QVBoxLayout(spacing=0)
        w.setLayout(layout)
        
        layout.addWidget(self.typesLabel)
        layout.addWidget(self.typesView)
        layout.addWidget(self.addButton)
        
        w = QWidget()
        self.addWidget(w)
        layout = QVBoxLayout(spacing=0)
        w.setLayout(layout)
        
        layout.addWidget(self.scoreLabel)
        layout.addWidget(self.scoreView)
        
        box = QHBoxLayout(spacing=0)
        layout.addLayout(box)
        
        box.addWidget(self.removeButton)
        box.addWidget(self.upButton)
        box.addWidget(self.downButton)
        
        self.addWidget(self.partSettings)

        self.typesView.setModel(parts.model())
        app.translateUI(self)
        
        # signal connections
        self.addButton.clicked.connect(self.slotAddButtonClicked)
        self.removeButton.clicked.connect(self.slotRemoveButtonClicked)
        self.typesView.doubleClicked.connect(self.slotDoubleClicked)
        self.scoreView.currentItemChanged.connect(self.slotCurrentItemChanged)
        self.upButton.clicked.connect(self.scoreView.moveSelectedChildrenUp)
        self.downButton.clicked.connect(self.scoreView.moveSelectedChildrenDown)
Ejemplo n.º 50
0
    def __init__(self, parent=None):
        QDialog.__init__(self, parent)
        
        # Destroying the C++ object right after closing the dialog box,
        # otherwise it may be garbage-collected in another QThread
        # (e.g. the editor's analysis thread in Spyder), thus leading to
        # a segmentation fault on UNIX or an application crash on Windows
        self.setAttribute(Qt.WA_DeleteOnClose)

        self.contents_widget = QListWidget()
        self.contents_widget.setMovement(QListView.Static)
        self.contents_widget.setSpacing(1)

        bbox = QDialogButtonBox(QDialogButtonBox.Ok|QDialogButtonBox.Apply
                                |QDialogButtonBox.Cancel)
        self.apply_btn = bbox.button(QDialogButtonBox.Apply)
        self.connect(bbox, SIGNAL("accepted()"), SLOT("accept()"))
        self.connect(bbox, SIGNAL("rejected()"), SLOT("reject()"))
        self.connect(bbox, SIGNAL("clicked(QAbstractButton*)"),
                     self.button_clicked)

        self.pages_widget = QStackedWidget()
        self.connect(self.pages_widget, SIGNAL("currentChanged(int)"),
                     self.current_page_changed)

        self.connect(self.contents_widget, SIGNAL("currentRowChanged(int)"),
                     self.pages_widget.setCurrentIndex)
        self.contents_widget.setCurrentRow(0)

        hsplitter = QSplitter()
        hsplitter.addWidget(self.contents_widget)
        hsplitter.addWidget(self.pages_widget)

        btnlayout = QHBoxLayout()
        btnlayout.addStretch(1)
        btnlayout.addWidget(bbox)

        vlayout = QVBoxLayout()
        vlayout.addWidget(hsplitter)
        vlayout.addLayout(btnlayout)

        self.setLayout(vlayout)

        self.setWindowTitle(_("Preferences"))
        self.setWindowIcon(get_icon("configure.png"))
Ejemplo n.º 51
0
    def __init__(self):
        QWidget.__init__(self)

        layout = QVBoxLayout()

        simulation_mode_layout = QHBoxLayout()
        simulation_mode_layout.addSpacing(10)
        simulation_mode_model = SimulationModeModel()
        simulation_mode_model.observable().attach(SimulationModeModel.CURRENT_CHOICE_CHANGED_EVENT, self.toggleSimulationMode)
        simulation_mode_combo = ComboChoice(simulation_mode_model, "Simulation mode", "run/simulation_mode")
        simulation_mode_layout.addWidget(QLabel(simulation_mode_combo.getLabel()), 0, Qt.AlignVCenter)
        simulation_mode_layout.addWidget(simulation_mode_combo, 0, Qt.AlignVCenter)

        # simulation_mode_layout.addStretch()
        simulation_mode_layout.addSpacing(20)

        self.run_button = QToolButton()
        self.run_button.setIconSize(QSize(32, 32))
        self.run_button.setText("Start Simulation")
        self.run_button.setIcon(util.resourceIcon("ide/gear_in_play"))
        self.run_button.clicked.connect(self.runSimulation)
        self.run_button.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
        HelpedWidget.addHelpToWidget(self.run_button, "run/start_simulation")

        simulation_mode_layout.addWidget(self.run_button)
        simulation_mode_layout.addStretch(1)

        layout.addSpacing(5)
        layout.addLayout(simulation_mode_layout)
        layout.addSpacing(10)

        self.simulation_stack = QStackedWidget()
        self.simulation_stack.setLineWidth(1)
        self.simulation_stack.setFrameStyle(QFrame.StyledPanel)

        layout.addWidget(self.simulation_stack)

        self.simulation_widgets = {}

        self.addSimulationConfigPanel(EnsembleExperimentPanel())
        self.addSimulationConfigPanel(EnsembleSmootherPanel())
        self.addSimulationConfigPanel(MultipleDataAssimilationPanel())
        self.addSimulationConfigPanel(IteratedEnsembleSmootherPanel())

        self.setLayout(layout)
Ejemplo n.º 52
0
 def __init__(self, datalist, comment="", parent=None):
     super(FormComboWidget, self).__init__(parent)
     layout = QVBoxLayout()
     self.setLayout(layout)
     self.combobox = QComboBox()
     layout.addWidget(self.combobox)
     
     self.stackwidget = QStackedWidget(self)
     layout.addWidget(self.stackwidget)
     self.connect(self.combobox, SIGNAL("currentIndexChanged(int)"),
                  self.stackwidget, SLOT("setCurrentIndex(int)"))
     
     self.widgetlist = []
     for data, title, comment in datalist:
         self.combobox.addItem(title)
         widget = FormWidget(data, comment=comment, parent=self)
         self.stackwidget.addWidget(widget)
         self.widgetlist.append(widget)
Ejemplo n.º 53
0
 def addWidgets(self):
     """Create main layout."""
     logger = self.logger
     logger.debug('adding widgets')
     layout = QVBoxLayout()
     self.setLayout(layout)
     layout.setSpacing(0)
     layout.setContentsMargins(0, 0, 0, 0)
     tabbar = QTabBar(self)
     tabbar.setFocusPolicy(Qt.NoFocus)
     tabbar.setVisible(False)
     tabbar.currentChanged.connect(self.changeVault)
     layout.addWidget(tabbar)
     self.tabbar = tabbar
     stack = QStackedWidget(self)
     layout.addWidget(stack)
     novault = NoVaultWidget(stack)
     stack.addWidget(novault)
     self.stack = stack
Ejemplo n.º 54
0
    def __init__(self, mainWindow):
        """ list of opened documents as it is displayed in the Opened Files Explorer.
        List accessed and modified by enki.core.openedfilemodel.OpenedFileModel class
        """
        QStackedWidget.__init__(self, mainWindow)
        mainWindow.setFocusProxy(self)

        self.setStyleSheet("QStackedWidget { padding-bottom: 5; }");
        self.sortedDocuments = []  # not protected, because available for OpenedFileModel
        self._oldCurrentDocument = None

        # create opened files explorer
        # openedFileExplorer is not protected, because it is available for OpenedFileModel
        self.openedFileExplorer = enki.core.openedfilemodel.OpenedFileExplorer(self)
        mainWindow.addDockWidget(Qt.LeftDockWidgetArea, self.openedFileExplorer)

        self.currentChanged.connect(self._onStackedLayoutIndexChanged)

        self.currentDocumentChanged.connect(self._updateMainWindowTitle)
        self.currentDocumentChanged.connect(self._onCurrentDocumentChanged)
Ejemplo n.º 55
0
    def __init__(self):
        super(TableWidget, self).__init__()

        vbox = QVBoxLayout(self)
        vbox.setContentsMargins(0, 0, 0, 0)

        self.relations = {}

        # Stack
        self.stacked = QStackedWidget()
        vbox.addWidget(self.stacked)
Ejemplo n.º 56
0
    def __init__(self):
        QMainWindow.__init__(self)

        self.controller = Controller()
        self.listener = LeapListener(self)
        self.controller.add_listener(self.listener)

        self.mode = "gallery"
        self.scroll = False
        self.direction = ""
        self.direction_x = 0
        self.scroll_velocity = 0
        self.current_index = 0

        # List containing images for the gallery
        self.list_view = QListWidget()
        self.list_view.setFlow(0)
        self.list_view.setHorizontalScrollMode(1)
        self.list_view.setMouseTracking(True)
        self.list_view.itemClicked.connect(self.show_image)

        # Setting the style of the ListView, background, item selected, etc
        self.list_view.setStyleSheet(
            """
				QListWidget::item:hover {background: transparent;}
				QListWidget::item:disabled:hover {background: transparent;}
				QListWidget::item:hover:!active {background: transparent;}
				QListWidget::item:selected:active {background: transparent;}
	            QListWidget::item:selected:!active {background: transparent;}
	            QListWidget::item:selected:disabled {background: transparent;}
	            QListWidget::item:selected:!disabled {background: transparent;}
	            QListWidget {background: #2C3539}
			"""
        )

        # Image viewer
        self.scene = QGraphicsScene()
        self.viewer = QGraphicsView(self.scene)

        self.stackedWidget = QStackedWidget()
        self.stackedWidget.addWidget(self.list_view)
        self.stackedWidget.addWidget(self.viewer)

        self.setCentralWidget(self.stackedWidget)
        self.resize(500, 400)
        self.showMaximized()

        scan = ScanLibrary("/home/chris/Example")
        threads.append(scan)
        self.connect(scan, SIGNAL(scan.signal), self.add_images_to_list)
        scan.start()

        self.connect(self, SIGNAL("scrollChanged(bool)"), self.scroll_view)
Ejemplo n.º 57
0
 def __init__(self, dialog):
     QWidget.__init__(self, dialog)
     SymbolManager.__init__(self)
     self.setDefaultSymbolSize(40)
     self.dialog = dialog
     self.setLayout(QGridLayout())
     self.tree = QTreeWidget()
     self.stack = QStackedWidget()
     StackFader(self.stack)
     self.systems = QSpinBox()
     newStaves = QVBoxLayout()
     operations = QHBoxLayout()
     self.layout().addLayout(newStaves, 0, 0)
     self.layout().addWidget(self.tree, 0, 1)
     self.layout().addWidget(self.stack, 0, 2, 1, 2)
     self.layout().addWidget(self.systems, 1, 3)
     self.systems.setRange(1, 64)
     l = QLabel(i18n("Systems per page:"))
     l.setBuddy(self.systems)
     self.layout().addWidget(l, 1, 2, Qt.AlignRight)
     self.layout().addLayout(operations, 1, 1)
     
     operations.setSpacing(0)
     operations.setContentsMargins(0, 0, 0, 0)
     removeButton = KPushButton(KStandardGuiItem.remove())
     removeButton.clicked.connect(self.removeSelectedItems)
     operations.addWidget(removeButton)
     upButton = QToolButton()
     upButton.clicked.connect(self.moveSelectedItemsUp)
     upButton.setIcon(KIcon("go-up"))
     operations.addWidget(upButton)
     downButton = QToolButton()
     downButton.clicked.connect(self.moveSelectedItemsDown)
     downButton.setIcon(KIcon("go-down"))
     operations.addWidget(downButton)
     newStaves.setSpacing(0)
     newStaves.setContentsMargins(0, 0, 0, 0)
     
     self.tree.setIconSize(QSize(32, 32))
     self.tree.setDragDropMode(QTreeWidget.InternalMove)
     self.tree.headerItem().setHidden(True)
     self.tree.itemSelectionChanged.connect(self.slotSelectionChanged)
     
     for staffType in (
         BracketItem,
         BraceItem,
         StaffItem,
         ):
         b = QPushButton(staffType.name())
         b.clicked.connect((lambda t: lambda: self.createItem(t))(staffType))
         b.setIconSize(QSize(40, 40))
         self.addSymbol(b, staffType.symbol())
         newStaves.addWidget(b)