コード例 #1
0
ファイル: basetree.py プロジェクト: ESRF-BCU/qarbon
    def __init__(self, view=None, parent=None):
        BaseToolBar.__init__(self, name="Taurus selection toolbar", view=view,
                             parent=parent)

        self._expandAllAction = getAction("Expand All", parent=self,
            icon=getIcon(":/controls/expand.png"),
            tooltip="Expand all items",
            triggered=self.onExpandAll)
        self._collapseAllAction = getAction("Collapse All", parent=self,
            icon=getIcon(":/controls/collapse.png"),
            tooltip="Collapse all items",
            triggered=self.onCollapseAll)
        self._expandSelectionAction = getAction("Expand selection",
            parent=self,
            icon=getIcon(":/controls/expand-selection.png"),
            tooltip="Expand selection",
            triggered=self.onExpandSelection)
        self._collapseSelectionAction = getAction("Collapse All", parent=self,
            icon=getIcon(":/controls/collapse-selection.png"),
            tooltip="Collapse selection",
            triggered=self.onCollapseSelection)
        self.addAction(self._expandAllAction)
        self.addAction(self._collapseAllAction)
        self.addAction(self._expandSelectionAction)
        self.addAction(self._collapseSelectionAction)
コード例 #2
0
ファイル: basetree.py プロジェクト: andygotz/qarbon
    def __init__(self, view=None, parent=None):
        BaseToolBar.__init__(self,
                             name="Taurus selection toolbar",
                             view=view,
                             parent=parent)

        self._expandAllAction = getAction(
            "Expand All",
            parent=self,
            icon=getIcon(":/controls/expand.png"),
            tooltip="Expand all items",
            triggered=self.onExpandAll)
        self._collapseAllAction = getAction(
            "Collapse All",
            parent=self,
            icon=getIcon(":/controls/collapse.png"),
            tooltip="Collapse all items",
            triggered=self.onCollapseAll)
        self._expandSelectionAction = getAction(
            "Expand selection",
            parent=self,
            icon=getIcon(":/controls/expand-selection.png"),
            tooltip="Expand selection",
            triggered=self.onExpandSelection)
        self._collapseSelectionAction = getAction(
            "Collapse All",
            parent=self,
            icon=getIcon(":/controls/collapse-selection.png"),
            tooltip="Collapse selection",
            triggered=self.onCollapseSelection)
        self.addAction(self._expandAllAction)
        self.addAction(self._collapseAllAction)
        self.addAction(self._expandSelectionAction)
        self.addAction(self._collapseSelectionAction)
コード例 #3
0
ファイル: basetree.py プロジェクト: andygotz/qarbon
    def __init__(self, view=None, parent=None):
        BaseToolBar.__init__(self,
                             name="Taurus selection toolbar",
                             view=view,
                             parent=parent)

        self._goIntoAction = getAction("Go Into",
                                       parent=self,
                                       icon=getIcon("go-down"),
                                       tooltip="Go into the selected item",
                                       triggered=self.goInto)
        self._goUpAction = getAction("Go Up",
                                     parent=self,
                                     icon=getIcon("go-up"),
                                     tooltip="Go up one level",
                                     triggered=self.goUp)
        self._goTopAction = getAction("Go Top",
                                      parent=self,
                                      icon=getIcon("go-top"),
                                      tooltip="Go to top level",
                                      triggered=self.goTop)
        self.addAction(self._goIntoAction)
        self.addAction(self._goUpAction)
        self.addAction(self._goTopAction)
        self._navigationWidget = _NavigationWidget(view, self, parent=self)
        self._navigationAction = self.addWidget(self._navigationWidget)
コード例 #4
0
    def test_getIcon(self):
        icon = getIcon("folder-open")
        self.assert_(not icon.isNull(), "Got a null icon!")

        icon = getIcon(":/controls/collapse.png")
        self.assert_(not icon.isNull(), "Got a null icon!")

        icon = getIcon(QtGui.QStyle.SP_MessageBoxWarning)
        self.assert_(not icon.isNull(), "Got a null icon!")
コード例 #5
0
ファイル: baseview.py プロジェクト: ESRF-BCU/qarbon
    def __init__(self, view=None, parent=None, designMode=False):
        BaseToolBar.__init__(self, name="Selection toolbar", view=view,
                             parent=parent, designMode=designMode)

        self._selectAllAction = Action("Select All", parent=self,
                                       icon=getIcon("edit-select-all"),
                                       tooltip="Select all items",
                                       triggered=self.onSelectAll)
        self._clearSelectionAction = Action("Clear selection", parent=self,
                                            icon=getIcon("edit-clear"),
                                            tooltip="Clears current selection",
                                             triggered=self.onclearSelection)

        self.addAction(self._selectAllAction)
        self.addAction(self._clearSelectionAction)
コード例 #6
0
ファイル: test_groupbox.py プロジェクト: ESRF-BCU/qarbon
    def test_groupBox(self):
        gb = GroupBox()

        gb.title = "Test box"
        self.assertEquals(gb.getTitle(), "Test box",
                          "Title was not properly set!")

        gb.titleIcon = getIcon("folder-open")
        self.assert_(not gb.getTitleIcon().isNull(), "Got a null icon!")

        gb.contentVisible = True
        self.assert_(gb.isContentVisible(), "Content is not visible!")

        gb.contentVisible = False
        self.assert_(not gb.isContentVisible(),
                     "Invisible content is visible!")

        content = gb.content()
        self.assert_(content is None, "content is not None!")

        content = QtGui.QFrame()
        gb.setContent(content)
        self.assert_(content == gb.content(),
                     "content is not the given content!")
        self.assert_(content.layout() is None, "content already has a layout!")

        size = gb.size()
        self.assert_(size.width() > 10, "width is suspiciously small!")
        self.assert_(size.height() > 10, "height is suspiciously small!")
コード例 #7
0
    def test_groupBox(self):
        gb = GroupBox()

        gb.title = "Test box"
        self.assertEquals(gb.getTitle(), "Test box",
                          "Title was not properly set!")

        gb.titleIcon = getIcon("folder-open")
        self.assert_(not gb.getTitleIcon().isNull(), "Got a null icon!")

        gb.contentVisible = True
        self.assert_(gb.isContentVisible(), "Content is not visible!")

        gb.contentVisible = False
        self.assert_(not gb.isContentVisible(),
                     "Invisible content is visible!")

        content = gb.content()
        self.assert_(content is None, "content is not None!")

        content = QtGui.QFrame()
        gb.setContent(content)
        self.assert_(content == gb.content(),
                     "content is not the given content!")
        self.assert_(content.layout() is None, "content already has a layout!")

        size = gb.size()
        self.assert_(size.width() > 10, "width is suspiciously small!")
        self.assert_(size.height() > 10, "height is suspiciously small!")
コード例 #8
0
ファイル: baseview.py プロジェクト: ESRF-BCU/qarbon
    def __init__(self, view=None, parent=None, designMode=False):
        BaseToolBar.__init__(self, name="Refresh toolbar", view=view,
                             parent=parent, designMode=designMode)

        self._refreshAction = Action("Refresh", parent=self,
                                     icon=getIcon("view-refresh"),
                                     tooltip="Refresh view",
                                     triggered=self.onRefresh)
        self.addAction(self._refreshAction)
コード例 #9
0
    def __init__(self, view=None, parent=None, designMode=False):
        BaseToolBar.__init__(self,
                             name="Selection toolbar",
                             view=view,
                             parent=parent,
                             designMode=designMode)

        self._selectAllAction = Action("Select All",
                                       parent=self,
                                       icon=getIcon("edit-select-all"),
                                       tooltip="Select all items",
                                       triggered=self.onSelectAll)
        self._clearSelectionAction = Action("Clear selection",
                                            parent=self,
                                            icon=getIcon("edit-clear"),
                                            tooltip="Clears current selection",
                                            triggered=self.onclearSelection)

        self.addAction(self._selectAllAction)
        self.addAction(self._clearSelectionAction)
コード例 #10
0
ファイル: basetree.py プロジェクト: ESRF-BCU/qarbon
    def __init__(self, view=None, parent=None):
        BaseToolBar.__init__(self, name="Taurus selection toolbar", view=view,
                             parent=parent)

        self._goIntoAction = getAction("Go Into", parent=self,
                                       icon=getIcon("go-down"),
                                       tooltip="Go into the selected item",
                                       triggered=self.goInto)
        self._goUpAction = getAction("Go Up", parent=self,
                                     icon=getIcon("go-up"),
                                     tooltip="Go up one level",
                                     triggered=self.goUp)
        self._goTopAction = getAction("Go Top", parent=self,
                                      icon=getIcon("go-top"),
                                      tooltip="Go to top level",
                                      triggered=self.goTop)
        self.addAction(self._goIntoAction)
        self.addAction(self._goUpAction)
        self.addAction(self._goTopAction)
        self._navigationWidget = _NavigationWidget(view, self, parent=self)
        self._navigationAction = self.addWidget(self._navigationWidget)
コード例 #11
0
ファイル: baseview.py プロジェクト: ESRF-BCU/qarbon
    def __init__(self, view=None, parent=None, designMode=False):
        BaseToolBar.__init__(self, name="Editor toolbar", view=view,
                             parent=parent, designMode=designMode)

        self._addAction = Action("New item", parent=self,
                                 icon=getIcon("list-add"),
                                 tooltip="Add new item",
                                 triggered=self.onAdd)
        self._removeAction = Action("Remove item", parent=self,
                                 icon=getIcon("list-remove"),
                                 tooltip="Remove item",
                                 triggered=self.onRemove)
        self._moveTopAction = Action("To top", parent=self,
                                 icon=getIcon("go-top"),
                                 tooltip="Move selected item to top",
                                 triggered=self.onMoveTop)
        self._moveUpAction = Action("Move up", parent=self,
                                 icon=getIcon("go-up"),
                                 tooltip="Move selected item up one level",
                                 triggered=self.onMoveUp)
        self._moveDownAction = Action("Move down", parent=self,
                                 icon=getIcon("go-down"),
                                 tooltip="Move selected item down one level",
                                 triggered=self.onMoveDown)
        self._moveBottomAction = Action("To bottom", parent=self,
                                 icon=getIcon("go-bottom"),
                                 tooltip="Move selected item to bottom",
                                 triggered=self.onMoveBottom)
        self.addAction(self._addAction)
        self.addAction(self._removeAction)
        self.addAction(self._moveTopAction)
        self.addAction(self._moveUpAction)
        self.addAction(self._moveDownAction)
        self.addAction(self._moveBottomAction)
コード例 #12
0
    def __init__(self, view=None, parent=None, designMode=False):
        BaseToolBar.__init__(self,
                             name="Refresh toolbar",
                             view=view,
                             parent=parent,
                             designMode=designMode)

        self._refreshAction = Action("Refresh",
                                     parent=self,
                                     icon=getIcon("view-refresh"),
                                     tooltip="Refresh view",
                                     triggered=self.onRefresh)
        self.addAction(self._refreshAction)
コード例 #13
0
ファイル: baseview.py プロジェクト: ESRF-BCU/qarbon
    def __init__(self, view=None, parent=None, designMode=False):
        BaseToolBar.__init__(self, name="Filter toolbar", view=view,
                             parent=parent, designMode=designMode)
        filterLineEdit = self._filterLineEdit = QtGui.QLineEdit(self)
        filterLineEdit.setSizePolicy(QtGui.QSizePolicy(
                                            QtGui.QSizePolicy.Preferred,
                                            QtGui.QSizePolicy.Preferred))
        filterLineEdit.setToolTip("Quick filter")
        filterLineEdit.textChanged.connect(self.onFilterChanged)
        filterLineEdit.textEdited.connect(self.onFilterEdited)
        self.addWidget(filterLineEdit)

        self._clearFilterAction = Action("Clear", parent=self,
                                         icon=getIcon("edit-clear"),
                                         tooltip="Clears the filter",
                                         triggered=self.onClearFilter)
        self.addAction(self._clearFilterAction)
コード例 #14
0
    def __init__(self, view=None, parent=None, designMode=False):
        BaseToolBar.__init__(self,
                             name="Filter toolbar",
                             view=view,
                             parent=parent,
                             designMode=designMode)
        filterLineEdit = self._filterLineEdit = QtGui.QLineEdit(self)
        filterLineEdit.setSizePolicy(
            QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                              QtGui.QSizePolicy.Preferred))
        filterLineEdit.setToolTip("Quick filter")
        filterLineEdit.textChanged.connect(self.onFilterChanged)
        filterLineEdit.textEdited.connect(self.onFilterEdited)
        self.addWidget(filterLineEdit)

        self._clearFilterAction = Action("Clear",
                                         parent=self,
                                         icon=getIcon("edit-clear"),
                                         tooltip="Clears the filter",
                                         triggered=self.onClearFilter)
        self.addAction(self._clearFilterAction)
コード例 #15
0
    def __init__(self, view=None, parent=None, designMode=False):
        BaseToolBar.__init__(self,
                             name="Editor toolbar",
                             view=view,
                             parent=parent,
                             designMode=designMode)

        self._addAction = Action("New item",
                                 parent=self,
                                 icon=getIcon("list-add"),
                                 tooltip="Add new item",
                                 triggered=self.onAdd)
        self._removeAction = Action("Remove item",
                                    parent=self,
                                    icon=getIcon("list-remove"),
                                    tooltip="Remove item",
                                    triggered=self.onRemove)
        self._moveTopAction = Action("To top",
                                     parent=self,
                                     icon=getIcon("go-top"),
                                     tooltip="Move selected item to top",
                                     triggered=self.onMoveTop)
        self._moveUpAction = Action("Move up",
                                    parent=self,
                                    icon=getIcon("go-up"),
                                    tooltip="Move selected item up one level",
                                    triggered=self.onMoveUp)
        self._moveDownAction = Action(
            "Move down",
            parent=self,
            icon=getIcon("go-down"),
            tooltip="Move selected item down one level",
            triggered=self.onMoveDown)
        self._moveBottomAction = Action("To bottom",
                                        parent=self,
                                        icon=getIcon("go-bottom"),
                                        tooltip="Move selected item to bottom",
                                        triggered=self.onMoveBottom)
        self.addAction(self._addAction)
        self.addAction(self._removeAction)
        self.addAction(self._moveTopAction)
        self.addAction(self._moveUpAction)
        self.addAction(self._moveDownAction)
        self.addAction(self._moveBottomAction)
コード例 #16
0
 def icon(self):
     return getIcon(self.getIconName())
コード例 #17
0
def main():
    from qarbon.qt.gui.icon import getIcon

    app = Application()
    app.setStyleSheet(GROUPBOX_NEBULA_STYLESHEET)

    w = QtGui.QWidget()
    l = QtGui.QVBoxLayout()
    w.setLayout(l)

    panel = GroupBox()
    panel.title = "Database"
    content = QtGui.QWidget()
    contentLayout = QtGui.QFormLayout()
    content.setLayout(contentLayout)
    panel.setContent(content)
    contentLayout.addRow("&Host", QtGui.QLineEdit())
    contentLayout.addRow("&Port", QtGui.QLineEdit())
    l.addWidget(panel, 0)

    panel = GroupBox()
    panel.title = "Hello world"
    panel.titleIcon = getIcon("video-x-generic")
    panel.styleMap = {
        'title_start_color': 'rgb(255, 60, 60)',
        'title_stop_color': 'rgb(200, 0, 0)',
        'title_font_color': 'rgb(140, 0, 0)',
        'title_border_radius': '10px',
        'content_border_radius': '0px',
    }

    content = QtGui.QWidget()
    contentLayout = QtGui.QFormLayout()
    content.setLayout(contentLayout)
    panel.setContent(content)
    contentLayout.addRow("State", QtGui.QPushButton("Press here"))
    contentLayout.addRow("Status", QtGui.QLineEdit())
    contentLayout.addRow("Coment", QtGui.QLineEdit())
    contentLayout.addRow("Build", QtGui.QCheckBox())
    contentLayout.addRow("Upper limit", QtGui.QSpinBox())
    contentLayout.addRow("Lower limit", QtGui.QSpinBox())
    l.addWidget(panel, 0)

    panel = GroupBox()
    panel.title = "Hello world 2"
    panel.titleIcon = getIcon("network-server")
    panel.titleVisible = False
    content = QtGui.QWidget()
    contentLayout = QtGui.QFormLayout()
    content.setLayout(contentLayout)
    panel.setContent(content)
    contentLayout.addRow("Something", QtGui.QLineEdit())
    contentLayout.addRow("More", QtGui.QLineEdit())
    l.addWidget(panel, 0)

    panel = GroupBox()
    panel.title = "5"
    panel.titleIcon = getIcon("folder")
    content = QtGui.QWidget()
    contentLayout = QtGui.QVBoxLayout()
    content.setLayout(contentLayout)
    panel.setContent(content)
    panel2 = GroupBox()
    panel2.title = "5.1"
    panel2.titleIcon = getIcon("folder")
    panel2.titleHeight = 48

    content2 = QtGui.QWidget()
    contentLayout2 = QtGui.QFormLayout()
    content2.setLayout(contentLayout2)
    panel2.setContent(content2)
    contentLayout2.addRow("Something", QtGui.QLineEdit())
    contentLayout2.addRow("More", QtGui.QLineEdit())
    contentLayout.addWidget(panel2, 0)
    l.addWidget(panel, 0)

    l.addStretch(1)

    w.show()
    w.adjustSize()

    app.exec_()
    return w
コード例 #18
0
ファイル: groupbox.py プロジェクト: ESRF-BCU/qarbon
def main():
    from qarbon.qt.gui.icon import getIcon

    app = Application()
    app.setStyleSheet(GROUPBOX_NEBULA_STYLESHEET)

    w = QtGui.QWidget()
    l = QtGui.QVBoxLayout()
    w.setLayout(l)

    panel = GroupBox()
    panel.title = "Database"
    content = QtGui.QWidget()
    contentLayout = QtGui.QFormLayout()
    content.setLayout(contentLayout)
    panel.setContent(content)
    contentLayout.addRow("&Host", QtGui.QLineEdit())
    contentLayout.addRow("&Port", QtGui.QLineEdit())
    l.addWidget(panel, 0)

    panel = GroupBox()
    panel.title = "Hello world"
    panel.titleIcon = getIcon("video-x-generic")
    panel.styleMap = {
        'title_start_color':     'rgb(255, 60, 60)',
        'title_stop_color':      'rgb(200, 0, 0)',
        'title_font_color':      'rgb(140, 0, 0)',
        'title_border_radius':   '10px',
        'content_border_radius': '0px',
    }

    content = QtGui.QWidget()
    contentLayout = QtGui.QFormLayout()
    content.setLayout(contentLayout)
    panel.setContent(content)
    contentLayout.addRow("State", QtGui.QPushButton("Press here"))
    contentLayout.addRow("Status", QtGui.QLineEdit())
    contentLayout.addRow("Coment", QtGui.QLineEdit())
    contentLayout.addRow("Build", QtGui.QCheckBox())
    contentLayout.addRow("Upper limit", QtGui.QSpinBox())
    contentLayout.addRow("Lower limit", QtGui.QSpinBox())
    l.addWidget(panel, 0)

    panel = GroupBox()
    panel.title = "Hello world 2"
    panel.titleIcon = getIcon("network-server")
    panel.titleVisible = False
    content = QtGui.QWidget()
    contentLayout = QtGui.QFormLayout()
    content.setLayout(contentLayout)
    panel.setContent(content)
    contentLayout.addRow("Something", QtGui.QLineEdit())
    contentLayout.addRow("More", QtGui.QLineEdit())
    l.addWidget(panel, 0)

    panel = GroupBox()
    panel.title = "5"
    panel.titleIcon = getIcon("folder")
    content = QtGui.QWidget()
    contentLayout = QtGui.QVBoxLayout()
    content.setLayout(contentLayout)
    panel.setContent(content)
    panel2 = GroupBox()
    panel2.title = "5.1"
    panel2.titleIcon = getIcon("folder")
    panel2.titleHeight = 48

    content2 = QtGui.QWidget()
    contentLayout2 = QtGui.QFormLayout()
    content2.setLayout(contentLayout2)
    panel2.setContent(content2)
    contentLayout2.addRow("Something", QtGui.QLineEdit())
    contentLayout2.addRow("More", QtGui.QLineEdit())
    contentLayout.addWidget(panel2, 0)
    l.addWidget(panel, 0)

    l.addStretch(1)

    w.show()
    w.adjustSize()

    app.exec_()
    return w