Пример #1
0
    def get_tree_widget(self):
        tw = ModelTree(parent=self)
        tw.setObjectName('PaneTree')

        # i hate the sunken frame style
        tw.setFrameShape(QFrame.NoFrame)
        tw.setFrameShadow(QFrame.Plain)

        tw.contextmenu = QMenu(self)
        act = ActionFactory.new_tab(self, self.open_in_new_view)
        tw.contextmenu.addAction(act)
        tw.setContextMenuPolicy(Qt.CustomContextMenu)
        tw.customContextMenuRequested.connect(self.create_context_menu)

        return tw
Пример #2
0
 def __init__(self, parent, section, workspace):
     super(PaneSection, self).__init__(parent)
     self._items = []
     self._workspace = workspace
     self._section = section
     layout = QVBoxLayout()
     layout.setContentsMargins(0, 0, 0, 0)
     section_tree = ModelTree(parent=self)
     # i hate the sunken frame style
     section_tree.setFrameShape(QFrame.NoFrame)
     section_tree.setFrameShadow(QFrame.Plain)
     section_tree.contextmenu = QMenu(self)
     section_tree.setContextMenuPolicy(Qt.CustomContextMenu)
     section_tree.customContextMenuRequested.connect(self.create_context_menu)
     section_tree.setObjectName( 'SectionTree' )
     section_tree.itemClicked.connect( self._item_clicked )
     section_tree.setWordWrap( False )
     layout.addWidget( section_tree )
     self.setLayout(layout)
     post( section.get_items, self.set_items )
Пример #3
0
 def __init__(self, parent, section, workspace):
     super(PaneSection, self).__init__(parent)
     self._items = []
     self._workspace = workspace
     self._section = section
     layout = QVBoxLayout()
     layout.setContentsMargins(0, 0, 0, 0)
     section_tree = ModelTree(parent=self)
     # i hate the sunken frame style
     section_tree.setFrameShape(QFrame.NoFrame)
     section_tree.setFrameShadow(QFrame.Plain)
     section_tree.contextmenu = QMenu(self)
     section_tree.setContextMenuPolicy(Qt.CustomContextMenu)
     section_tree.customContextMenuRequested.connect(self.create_context_menu)
     section_tree.setObjectName( 'SectionTree' )
     section_tree.itemClicked.connect( self._item_clicked )
     section_tree.setWordWrap( False )
     layout.addWidget( section_tree )
     self.setLayout(layout)
     post( section.get_items, self.set_items )
Пример #4
0
 def __init__(self, parent, section, workspace):
     super(PaneSection, self).__init__(parent)
     self._items = []
     self._workspace = workspace
     layout = QVBoxLayout()
     layout.setContentsMargins(0, 0, 0, 0)
     section_tree = ModelTree(parent=self)
     # i hate the sunken frame style
     section_tree.setFrameShape(QFrame.NoFrame)
     section_tree.setFrameShadow(QFrame.Plain)
     section_tree.contextmenu = QMenu(self)
     act = ActionFactory.new_tab(self, self.open_in_new_view)
     section_tree.contextmenu.addAction( act )
     section_tree.setContextMenuPolicy(Qt.CustomContextMenu)
     section_tree.customContextMenuRequested.connect(self.create_context_menu)
     section_tree.setObjectName( 'SectionTree' )
     section_tree.itemClicked.connect( self.open_in_current_view )
     layout.addWidget( section_tree )
     self.setLayout(layout)
     post( section.get_items, self.set_items )
Пример #5
0
 def __init__(self, parent, section, workspace):
     super(PaneSection, self).__init__(parent)
     self._items = []
     self._workspace = workspace
     layout = QVBoxLayout()
     layout.setContentsMargins(0, 0, 0, 0)
     section_tree = ModelTree(parent=self)
     # i hate the sunken frame style
     section_tree.setFrameShape(QFrame.NoFrame)
     section_tree.setFrameShadow(QFrame.Plain)
     section_tree.contextmenu = QMenu(self)
     act = ActionFactory.new_tab(self, self.open_in_new_view)
     section_tree.contextmenu.addAction(act)
     section_tree.setContextMenuPolicy(Qt.CustomContextMenu)
     section_tree.customContextMenuRequested.connect(
         self.create_context_menu)
     section_tree.setObjectName('SectionTree')
     section_tree.itemClicked.connect(self.open_in_current_view)
     layout.addWidget(section_tree)
     self.setLayout(layout)
     post(section.get_items, self.set_items)