def __init__( self, parent ):
        QTreeWidget.__init__( self, parent )

        self.pyQGisApp = parent
        self.canvas = None
        self.layers = self.getLayerSet()

        self.bMousePressedFlag = False
        self.itemBeingMoved = None

        # QTreeWidget properties
        self.setSortingEnabled( False )
        self.setDragEnabled( False )
        self.setAutoScroll( False )
        #self.setVerticalScrollMode( QAbstractItemView.ScrollPerPixel )
        self.setHeaderHidden( True )
        self.setRootIsDecorated( True )
        self.setContextMenuPolicy( Qt.CustomContextMenu )

        self.connect( self, SIGNAL( "customContextMenuRequested(QPoint)" ),
            self.showMenu )
        self.connect( QgsMapLayerRegistry.instance(), SIGNAL("layerWasAdded(QgsMapLayer *)"),
            self.addLayerToLegend )
        self.connect( QgsMapLayerRegistry.instance(), SIGNAL( "removedAll()" ),
            self.removeAll )
        self.connect( self, SIGNAL( "itemChanged(QTreeWidgetItem *,int)" ),
            self.updateLayerStatus )
        self.connect( self, SIGNAL( "currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)" ),
            self.currentItemChanged )
Ejemplo n.º 2
0
    def __init__(self):
        QTreeWidget.__init__(self)
        self.header().setHidden(True)
        self.setSelectionMode(self.SingleSelection)
        self.setAnimated(True)
        self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
        self.header().setResizeMode(0, QHeaderView.ResizeToContents)
        self.header().setStretchLastSection(False)
        self.actualSymbols = ('', {})
        self.docstrings = {}
        self.collapsedItems = {}

        self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"),
            self._go_to_definition)
        self.connect(self, SIGNAL("itemActivated(QTreeWidgetItem *, int)"),
            self._go_to_definition)
        self.setContextMenuPolicy(Qt.CustomContextMenu)
        self.connect(self,
            SIGNAL("customContextMenuRequested(const QPoint &)"),
            self._menu_context_tree)
        self.connect(self, SIGNAL("itemCollapsed(QTreeWidgetItem *)"),
            self._item_collapsed)
        self.connect(self, SIGNAL("itemExpanded(QTreeWidgetItem *)"),
            self._item_expanded)

        IDE.register_service('symbols_explorer', self)
        ExplorerContainer.register_tab(translations.TR_TAB_SYMBOLS, self)
Ejemplo n.º 3
0
 def __init__(self, parent=None):
     QTreeWidget.__init__(self, parent)
     self.setupUi(self)
     self.connect(self, SIGNAL("itemDoubleClicked(QTreeWidgetItem*, int)"),
                  self.displayItem)
     self.copyMenu = AttributeCopyMenu(self)
     self.mainwindow = QApplication.instance().mainWindow
Ejemplo n.º 4
0
    def __init__( self, parent = None ):
        QTreeWidget.__init__( self, parent )

        self.setRootIsDecorated( False )
        self.setItemsExpandable( False )
        self.setSortingEnabled( True )

        self.__headerItem = QTreeWidgetItem( [ "", "File name", "Line",
                                               "Description" ] )

        self.__headerItem.setIcon( 0,
                                   PixmapCache().getIcon("todocompleted.png") )
        self.setHeaderItem( self.__headerItem )

        self.header().setSortIndicator( 1, Qt.AscendingOrder )
        self.__resizeColumns()

        self.todoItems = []

        self.setContextMenuPolicy( Qt.CustomContextMenu )
        self.connect( self,
                      SIGNAL( "customContextMenuRequested(const QPoint &)" ),
                      self.__showContextMenu )
        self.connect( self,
                      SIGNAL( "itemActivated(QTreeWidgetItem *, int)" ),
                      self.__todoItemActivated )
        return
 def __init__(self, controller, parent = None):
     '''
     Constructor - calls parent class constructor
     '''
     QTreeWidget.__init__(self, parent)
     if parent!=None:
         self.parentController = parent
Ejemplo n.º 6
0
    def __init__(self, parent=None):
        QTreeWidget.__init__(self, parent)

        self.setRootIsDecorated(False)
        self.setItemsExpandable(False)
        self.setSortingEnabled(True)

        self.__headerItem = QTreeWidgetItem(
            ["", "File name", "Line", "Description"])

        self.__headerItem.setIcon(0,
                                  PixmapCache().getIcon("todocompleted.png"))
        self.setHeaderItem(self.__headerItem)

        self.header().setSortIndicator(1, Qt.AscendingOrder)
        self.__resizeColumns()

        self.todoItems = []

        self.setContextMenuPolicy(Qt.CustomContextMenu)
        self.connect(self,
                     SIGNAL("customContextMenuRequested(const QPoint &)"),
                     self.__showContextMenu)
        self.connect(self, SIGNAL("itemActivated(QTreeWidgetItem *, int)"),
                     self.__todoItemActivated)
        return
Ejemplo n.º 7
0
 def __init__(self, parent):
     """
     Treewidget constructor
     """
     QTreeWidget.__init__(self, parent)
     self.setDragDropMode(QAbstractItemView.DragDrop)
     self.setDragEnabled(True)
Ejemplo n.º 8
0
Archivo: modules.py Proyecto: kzwkt/dff
 def __init__(self, parent):
     QTreeWidget.__init__(self, parent)
     self.name = "Modules"
     self.tm = TaskManager()
     self.loader = loader.loader()
     self.setupUi(self)
     self.initTreeModule()
Ejemplo n.º 9
0
 def __init__(self,parent = None):
     QTreeWidget.__init__(self,parent)
     self.setColumnCount(1)
     self.header().close()
     self.header().setStretchLastSection(False)
     self.header().setResizeMode(QHeaderView.ResizeToContents)
     self.mainClass = None
Ejemplo n.º 10
0
 def __init__(self,parent = None):
     QTreeWidget.__init__(self,parent)
     self.setColumnCount(1)
     self.setHeaderLabel("Explorer")
     self.projects = []
     self.header().setStretchLastSection(False)
     self.header().setResizeMode(QHeaderView.ResizeToContents)
Ejemplo n.º 11
0
    def __init__(self, state_index=list()):
        QTreeWidget.__init__(self)

        self.header().setHidden(True)
        self.setSelectionMode(QTreeWidget.SingleSelection)
        self.setAnimated(True)

        self._actualProject = None
        #self._projects -> key: [Item, folderStructure]
        self._projects = {}
        self._loading_items = {}
        self._thread_execution = {}
        self.__enableCloseNotification = True
        self._fileWatcher = NinjaFileSystemWatcher
        self._refresh_projects_queue = []
        self._timer_running = False

        self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
        self.header().setResizeMode(0, QHeaderView.ResizeToContents)
        self.header().setStretchLastSection(False)

        self.setContextMenuPolicy(Qt.CustomContextMenu)
        self.connect(self,
                     SIGNAL("customContextMenuRequested(const QPoint &)"),
                     self._menu_context_tree)
        self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"),
                     self._open_file)
        self.connect(self._fileWatcher, SIGNAL("fileChanged(int, QString)"),
                     self._refresh_project_by_path)
        self.itemExpanded.connect(self._item_expanded)
        self.itemCollapsed.connect(self._item_collapsed)
        self.mute_signals = False
        self.state_index = list()
        self._folding_menu = FoldingContextMenu(self)
Ejemplo n.º 12
0
    def __init__(self, parent=None, maxDepth=100):
        logging.debug(__name__ + ": __init__")
        AbstractView.__init__(self)
        QTreeWidget.__init__(self, parent)

        self._operationId = 0
        self._firstItem = None
        self._itemDict = {}
        self._maxDepth = maxDepth
        self._selection = None
        self._updatingFlag = 0
        self._treeDepth = 1
        self._updateCounter = 0

        self.setSortingEnabled(False)
        self.setColumnCount(1)
        self.setRootIsDecorated(True)
        self.header().hide()

        self.connect(self, SIGNAL("itemSelectionChanged()"),
                     self.itemSelectionChanged)
        self.connect(self, SIGNAL("itemCollapsed(QTreeWidgetItem*)"),
                     self.itemExpanded)
        self.connect(self, SIGNAL("itemExpanded(QTreeWidgetItem*)"),
                     self.itemExpanded)
Ejemplo n.º 13
0
    def __init__(self, state_index=list()):
        QTreeWidget.__init__(self)

        self.header().setHidden(True)
        self.setSelectionMode(QTreeWidget.SingleSelection)
        self.setAnimated(True)

        self._actualProject = None
        #self._projects -> key: [Item, folderStructure]
        self._projects = {}
        self._loading_items = {}
        self._thread_execution = {}
        self.__enableCloseNotification = True
        self._fileWatcher = NinjaFileSystemWatcher
        self._refresh_projects_queue = []
        self._timer_running = False

        self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
        self.header().setResizeMode(0, QHeaderView.ResizeToContents)
        self.header().setStretchLastSection(False)

        self.setContextMenuPolicy(Qt.CustomContextMenu)
        self.connect(self, SIGNAL(
            "customContextMenuRequested(const QPoint &)"),
            self._menu_context_tree)
        self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"),
            self._open_file)
        self.connect(self._fileWatcher, SIGNAL("fileChanged(int, QString)"),
            self._refresh_project_by_path)
        self.itemExpanded.connect(self._item_expanded)
        self.itemCollapsed.connect(self._item_collapsed)
        self.mute_signals = False
        self.state_index = list()
        self._folding_menu = FoldingContextMenu(self)
Ejemplo n.º 14
0
	def __init__(self, parent=None, TreeFileName=DefaultTreeFileName):
		QTreeWidget.__init__(self, parent)
		self.parent = parent
		self.setGeometry(0,0, self.parent.width(), self.parent.height())
		self.setColumnCount(2)
		self.setColumnWidth(0,270)
		#self.header().setStretchLastSection(False)
		#self.resizeColumnToContents(1)
		headerTitles = QStringList()
		headerTitles.append(QString("Parameter"))
		headerTitles.append(QString("Value"))
		self.setHeaderLabels(headerTitles)
		self.setEditTriggers(QTreeWidget.DoubleClicked|QTreeWidget.EditKeyPressed)
		self.rootItems = []
		self.currentItemChanged.connect(self.visit)
		self.itemDoubleClicked.connect(self.edit_)
		self.editing = None
		self.expandAll()
		self.ScenarioName = ''
		self.NodeDescriptions = dict()  # textual parameter descriptions
		self.ParamScenario = dict()  # name of corresponding scenario for parameters
		self.changed = False
		self.ApplicationPath = ''
		self.TreeFileName = TreeFileName
		self.RunCfgFileName = DefaultCfgFileName
		self.load()
		self.parent.setWindowTitle(self.NodeValue('Title').replace('_',' ') + ' ' + DefaultTtitle)
Ejemplo n.º 15
0
    def __init__(self, parent):
        QTreeWidget.__init__(self, parent)

        self.pyQGisApp = parent
        self.canvas = None
        self.layers = self.getLayerSet()

        self.bMousePressedFlag = False
        self.itemBeingMoved = None

        # QTreeWidget properties
        self.setSortingEnabled(False)
        self.setDragEnabled(False)
        self.setAutoScroll(False)
        #self.setVerticalScrollMode( QAbstractItemView.ScrollPerPixel )
        self.setHeaderHidden(True)
        self.setRootIsDecorated(True)
        self.setContextMenuPolicy(Qt.CustomContextMenu)

        self.connect(self, SIGNAL("customContextMenuRequested(QPoint)"),
                     self.showMenu)
        self.connect(QgsMapLayerRegistry.instance(),
                     SIGNAL("layerWasAdded(QgsMapLayer *)"),
                     self.addLayerToLegend)
        self.connect(QgsMapLayerRegistry.instance(), SIGNAL("removedAll()"),
                     self.removeAll)
        self.connect(self, SIGNAL("itemChanged(QTreeWidgetItem *,int)"),
                     self.updateLayerStatus)
        self.connect(
            self,
            SIGNAL("currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)"),
            self.currentItemChanged)
Ejemplo n.º 16
0
 def __init__(self, parent):
     QTreeWidget.__init__(self, parent)
     self.name = "Modules"
     self.tm = TaskManager()
     self.loader = loader.loader()
     self.setupUi(self)
     self.initTreeModule()
Ejemplo n.º 17
0
    def __init__(self, debugger, parent=None):
        QTreeWidget.__init__(self, parent)

        self.setRootIsDecorated(True)
        self.setAlternatingRowColors(True)
        self.setUniformRowHeights(True)
        self.setItemDelegate(NoOutlineHeightDelegate(4))

        self.setSelectionBehavior(QAbstractItemView.SelectRows)

        self.setHeaderLabels(["Name", "Value", "Type"])
        header = self.header()
        header.setSortIndicator(0, Qt.AscendingOrder)
        header.setSortIndicatorShown(True)
        header.setClickable(True)
        header.setStretchLastSection(True)

        self.itemExpanded.connect(self.__expandItemSignal)
        self.itemCollapsed.connect(self.collapseItem)

        self.resortEnabled = True
        self.openItems = []
        self.framenr = 0
        self.__debugger = debugger

        # Ugly filtering support
        self.__hideMCFFilter = False
        self.__scopeFilter = 0  # Global and local
        self.__filterIsSet = False
        self.__textFilters = []
        self.__textFiltersCount = 0

        self.setSortingEnabled(True)
        return
Ejemplo n.º 18
0
    def __init__(self):
        QTreeWidget.__init__(self)

        self.header().setHidden(True)
        self.setSelectionMode(QTreeWidget.SingleSelection)
        self.setAnimated(True)

        self._actualProject = None
        #self._projects -> key: [Item, folderStructure]
        self._projects = {}
        self.__enableCloseNotification = True
        self._fileWatcher = QFileSystemWatcher()

        self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
        self.header().setResizeMode(0, QHeaderView.ResizeToContents)
        self.header().setStretchLastSection(False)

        self.setContextMenuPolicy(Qt.CustomContextMenu)
        self.connect(self, SIGNAL(
            "customContextMenuRequested(const QPoint &)"),
            self._menu_context_tree)
        self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"),
            self._open_file)
        self.connect(self._fileWatcher, SIGNAL("directoryChanged(QString)"),
            self._refresh_project_by_path)
Ejemplo n.º 19
0
    def __init__( self, debugger, parent = None ):
        QTreeWidget.__init__( self, parent )

        self.setRootIsDecorated( True )
        self.setAlternatingRowColors( True )
        self.setUniformRowHeights( True )
        self.setItemDelegate( NoOutlineHeightDelegate( 4 ) )

        self.setSelectionBehavior( QAbstractItemView.SelectRows )

        self.setHeaderLabels( [ "Name", "Value", "Type" ] )
        header = self.header()
        header.setSortIndicator( 0, Qt.AscendingOrder )
        header.setSortIndicatorShown( True )
        header.setClickable( True )
        header.setStretchLastSection( True )

        self.itemExpanded.connect( self.__expandItemSignal )
        self.itemCollapsed.connect( self.collapseItem )

        self.resortEnabled = True
        self.openItems = []
        self.framenr = 0
        self.__debugger = debugger

        # Ugly filtering support
        self.__hideMCFFilter = False
        self.__scopeFilter = 0  # Global and local
        self.__filterIsSet = False
        self.__textFilters = []
        self.__textFiltersCount = 0

        self.setSortingEnabled( True )
        return
Ejemplo n.º 20
0
 def __init__(self, hide_parent_element = False):
     """Constructor."""
     QTreeWidget.__init__(self)
     self._content_provider = None
     self._label_providers = {}
     # index table to lookup treeview items associated with model objects.
     self.__indextable = []
     self._hide_parent = hide_parent_element
Ejemplo n.º 21
0
 def __init__(self):
     QTreeWidget.__init__(self)
     self.setHeaderLabels((self.tr('File'), self.tr('Line')))
     self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
     self.header().setResizeMode(0, QHeaderView.ResizeToContents)
     self.header().setResizeMode(1, QHeaderView.ResizeToContents)
     self.header().setStretchLastSection(False)
     self.sortByColumn(0, Qt.AscendingOrder)
Ejemplo n.º 22
0
 def __init__(self):
     QTreeWidget.__init__(self)
     self.setHeaderLabels((self.tr('Description'), self.tr('Shortcut')))
     #columns width
     self.setColumnWidth(0, 175)
     self.header().setStretchLastSection(True)
     self.setSortingEnabled(True)
     self.sortByColumn(0, Qt.AscendingOrder)
Ejemplo n.º 23
0
 def __init__(self):
     QTreeWidget.__init__(self)
     self.__setup_ui()
     self.__connect_slot()
     self.__label_color = [
         'red', 'orange', 'yellow', 'green', 'blue', 'purple'
     ]
     self.__current_label_count = 0
Ejemplo n.º 24
0
 def __init__(self):
     QTreeWidget.__init__(self)
     self.setHeaderLabels((self.tr('File'), self.tr('Line')))
     self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
     self.header().setResizeMode(0, QHeaderView.ResizeToContents)
     self.header().setResizeMode(1, QHeaderView.ResizeToContents)
     self.header().setStretchLastSection(False)
     self.sortByColumn(0, Qt.AscendingOrder)
Ejemplo n.º 25
0
 def __init__(self):
     QTreeWidget.__init__(self)
     self.setHeaderLabels((self.tr('Description'), self.tr('Shortcut')))
     #columns width
     self.setColumnWidth(0, 175)
     self.header().setStretchLastSection(True)
     self.setSortingEnabled(True)
     self.sortByColumn(0, Qt.AscendingOrder)
Ejemplo n.º 26
0
 def __init__(self, parent):
     QTreeWidget.__init__(self, parent)
     self.setItemsExpandable(True)
     self.setColumnCount(1)
     self.connect(self, SIGNAL('itemActivated(QTreeWidgetItem*,int)'),
                  self.activated)
     # Setup context menu
     self.menu = QMenu(self)
     self.common_actions = self.setup_common_actions()
Ejemplo n.º 27
0
 def __init__(self):
     QTreeWidget.__init__(self)
     self.setHeaderLabels((translations.TR_PROJECT_DESCRIPTION,
         translations.TR_SHORTCUT))
     #columns width
     self.setColumnWidth(0, 175)
     self.header().setStretchLastSection(True)
     self.setSortingEnabled(True)
     self.sortByColumn(0, Qt.AscendingOrder)
Ejemplo n.º 28
0
 def __init__(self):
     QTreeWidget.__init__(self)
     self.setHeaderLabels(
         (translations.TR_PROJECT_DESCRIPTION, translations.TR_SHORTCUT))
     #columns width
     self.setColumnWidth(0, 175)
     self.header().setStretchLastSection(True)
     self.setSortingEnabled(True)
     self.sortByColumn(0, Qt.AscendingOrder)
Ejemplo n.º 29
0
 def __init__(self, parent=None):
     QTreeWidget.__init__(self, parent)
     self.setWindowTitle('TreeWidget Context Menu')
     self.header().setHidden(True)
     self.setGeometry(320, 320, 320, 320)
     for index in '12345':
         parent = QTreeWidgetItem(self, ['Parent %s' % index])
         for item in 'ABCDE':
             QTreeWidgetItem(parent, ['Child %s%s' % (index, item)])
         parent.setExpanded(True)
Ejemplo n.º 30
0
 def __init__(self, parent=None):
     QTreeWidget.__init__(self, parent)
     self.service = None
     self.setSelectionMode(QAbstractItemView.MultiSelection)
     self.clicked.connect(self.checkSelection_clicked)
     self.expanded.connect(self.checkSelection_expanded)
     self.collapsed.connect(self.checkSelection_collapsed)
     self.setColumnCount(2)
     self.setHeaderHidden(True)
     self.setItemsExpandable(True)
 def __init__(self, parent=None):
     QTreeWidget.__init__(self, parent)
     self.service = None
     self.setSelectionMode(QAbstractItemView.MultiSelection)
     self.clicked.connect(self.checkSelection_clicked)
     self.expanded.connect(self.checkSelection_expanded)
     self.collapsed.connect(self.checkSelection_collapsed)
     self.setColumnCount(2)
     self.setHeaderHidden(True)
     self.setItemsExpandable(True)
Ejemplo n.º 32
0
 def __init__(self, parent=None):
     QTreeWidget.__init__(self, parent)
     self.headersList = ['Function/Module','TotalTime','LocalTime','Calls','File:line']
     self.iconDict = {'module':'console/python.png','function':'editor/function.png',
                      'builtin':'console/python_t.png','constructor':'editor/class.png'}
     self.profdata = []   # To be filled by self.load_data()
     self.stats = []      # To be filled by self.load_data()
     self.setColumnCount(len(self.headersList))
     self.setHeaderLabels(self.headersList)
     self.initialize_view()
Ejemplo n.º 33
0
    def __init__(self, parent=None):
        QTreeWidget.__init__(self, parent)

        self.singleOverlaySelection = True

        self.header().close()
        self.setSortingEnabled(True)
        self.installEventFilter(self)
        self.spacePressed.connect(self.spacePressedTreewidget)
        self.itemChanged.connect(self.treeItemChanged)
 def __init__(self, parent=None): 
     QTreeWidget.__init__(self, parent) 
     self.setWindowTitle('TreeWidget Context Menu') 
     self.header().setHidden(True) 
     self.setGeometry(320, 320, 320, 320) 
     for index in '12345': 
         parent = QTreeWidgetItem(self, ['Parent %s' % index]) 
         for item in 'ABCDE': 
             QTreeWidgetItem(parent, ['Child %s%s' % (index, item)]) 
         parent.setExpanded(True) 
Ejemplo n.º 35
0
 def __init__(self, parent=None):
     QTreeWidget.__init__(self, parent)
     
     self.singleOverlaySelection = True
     
     self.header().close()
     self.setSortingEnabled(True)
     self.installEventFilter(self)
     self.spacePressed.connect(self.spacePressedTreewidget)
     self.itemChanged.connect(self.treeItemChanged)
Ejemplo n.º 36
0
 def __init__(self, parent, registryQueriesParser, queriesSetName):
   QTreeWidget.__init__(self, parent)
   self.setColumnCount(2)
   self.hLabels = ["Key"]
   self.setHeaderLabels(self.hLabels) 
   self.found = 0
   self.__columnNode = {}
   self.fill(registryQueriesParser.queriesSet(queriesSetName))
   self.header().resizeSections(QHeaderView.ResizeToContents)
   self.header().resizeSections(QHeaderView.Interactive)
Ejemplo n.º 37
0
	def __init__(self, parent):
		QTreeWidget.__init__(self, parent)
		
		self.connection = None
		self.header().hide()
		self.setSortingEnabled(True)
		self.sortItems(0, Qt.AscendingOrder)
		self.buddies = {}
		self.muc = {}
		self.groups = {}
		self.tree = {}
Ejemplo n.º 38
0
 def __init__(self,parent = None):
     QTreeWidget.__init__(self,parent)
     self.setDragEnabled(True)
     self.setAcceptDrops(True)
     self.setColumnCount(1)
     self.header().close()
     self.setContextMenuPolicy(Qt.CustomContextMenu)
     self.connect(self,SIGNAL("customContextMenuRequested(const QPoint &)"), self.doMenu)
     self.connect(self, SIGNAL("dropped"), self.addItem)
     self.projects = []
     self.closed = []
Ejemplo n.º 39
0
 def __init__(self, parent=None):
     QTreeWidget.__init__(self, parent)
     self._ioThread = IoThread(self)
     self._timer = QTimer()
     # connect some signals/slots
     QObject.connect(self, SIGNAL("customContextMenuRequested(const QPoint&)"), self.contextMenu)
     QObject.connect(self, SIGNAL("itemCollapsed(QTreeWidgetItem *)"), self.itemCollapsedOrExpanded)
     QObject.connect(self, SIGNAL("itemExpanded(QTreeWidgetItem *)"), self.itemCollapsedOrExpanded)
     QObject.connect(self._ioThread, SIGNAL("started(void)"), self.connectIoThread)
     self._visibleRowCount = 0
     self._ioThread.start()
Ejemplo n.º 40
0
	def __init__(self, connManager, parent = None):
		QTreeWidget.__init__(self, parent)
		self.sortItems(0, Qt.AscendingOrder)
		self.setSortingEnabled(True)
		self.header().hide()
		self.setColumnCount(1)
		self.connManager = connManager
		self.setIconSize(QSize(32, 32))
		self.connect(self.connManager, SIGNAL("clientAdded(int)"), self.addClient)
		self.connect(self.connManager, SIGNAL("clientRemoved(int)"), self.removeClient)
		self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred)
Ejemplo n.º 41
0
    def __init__(self, parent):
        QTreeWidget.__init__(self, parent)

        self.devices = ExperimentTreeItem(self, "Devices")
        self.experiments = ExperimentTreeItem(self, "Experiments")

        self.dragStartPosition = None

        DeviceCollection.Instance().changed.connect(self.updateDevices)
        ExperimentCollection.Instance().changed.connect(self.updateExperiments)

        self.customContextMenuRequested.connect(self.treeContextMenuRequested)
Ejemplo n.º 42
0
 def __init__(self, parent):
     QTreeWidget.__init__(self)
     self.treeItemMenu = ReportTreeItemMenu(self)
     self.treeNewItemMenu = ReportTreeNewItemMenu(self)
     self.header().hide()
     self.connect(parent, SIGNAL("newCategory"), self.newCategory)
     self.connect(parent, SIGNAL("newPage"), self.newPage)
     self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem*, int)"),
                  self.clicked)
     self.thumbnailer = Thumbnailer()
     self.reportManager = ReportManager()
     self.__categoryItems = []
Ejemplo n.º 43
0
    def __init__(self, user_settings, parent=None, read_only=False):

        QTreeWidget.__init__(self, parent)
        self.header().hide()
        self.header().setResizeMode(QHeaderView.Stretch)
        self.setRootIsDecorated(False)

        self.window = parent
        self.read_only = read_only
        self.user_settings = user_settings
        self.setItemDelegate(SheetDelegate(self, self))
        self.connect(self, SIGNAL('itemPressed(QTreeWidgetItem*,int)'), self.pagesListPressed)
Ejemplo n.º 44
0
    def __init__(self):
        QTreeWidget.__init__(self)
        self.header().setHidden(True)
        self.setSelectionMode(self.SingleSelection)
        self.setAnimated(True)
        self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
        self.header().setResizeMode(0, QHeaderView.ResizeToContents)
        self.header().setStretchLastSection(False)
        self.actualSymbols = ('', {})

        self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"),
            self._go_to_definition)
Ejemplo n.º 45
0
    def __init__(self):
        QTreeWidget.__init__(self)
        self.header().setHidden(True)
        self.setSelectionMode(self.SingleSelection)
        self.setAnimated(True)
        self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
        self.header().setResizeMode(0, QHeaderView.ResizeToContents)
        self.header().setStretchLastSection(False)
        self.actualSymbols = ('', {})

        self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"),
                     self._go_to_definition)
Ejemplo n.º 46
0
 def __init__(self, parent=None):
     QTreeWidget.__init__(self, parent)
     sizePolicy = QSizePolicy(QSizePolicy.Preferred,
                              QSizePolicy.MinimumExpanding)
     self.setSizePolicy(sizePolicy)
     self.loader = loader()
     self.taskmanager = TaskManager()
     moduleMap = self.ppModuleMap()
     self.header().hide()
     self.populate(moduleMap)
     self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem*, int)"),
                  self.moduleClicked)
Ejemplo n.º 47
0
 def __init__(self, parent=None):
     QTreeWidget.__init__(self, parent)
     self.vfs = VFS.Get()
     self.nodesMapWidget = parent
     self.mainWindow = QApplication.instance().mainWindow
     self.countryLevel = {}
     self.countyLevel = {}
     self.streetLevel = {}
     self.nodeLevel = {}
     self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem*, int)"),
                  self.clicked)
     self.connect(self, SIGNAL("focusOnNode"), self.focusOnNodeItem)
     headerItem = self.headerItem().setText(0, "No images found")
     self.imageCount = 0
Ejemplo n.º 48
0
    def __init__(self):
        QTreeWidget.__init__(self)
        self.setObjectName("simbolos")
        self.header().setHidden(True)
        self.setSelectionMode(self.SingleSelection)
        self.setAnimated(True)
        self.header().setStretchLastSection(False)
        self.header().setHorizontalScrollMode(
            QAbstractItemView.ScrollPerPixel)
        self.header().setResizeMode(0, QHeaderView.ResizeToContents)

        # Conexión
        self.itemClicked[QTreeWidgetItem, int].connect(self.go_to_line)
        self.itemActivated[QTreeWidgetItem, int].connect(self.go_to_line)

        Edis.load_lateral("symbols", self)
Ejemplo n.º 49
0
    def __init__(self, headerLabel, dragEnabled=False, mimeType=None, parent=None):
        """ Constructor.
        """
        QTreeWidget.__init__(self,parent)
        self.setMimeType(mimeType)
        self.setAutoFillBackground(True)
        #print "color roles", QPalette.Base, QPalette.Window, self.backgroundRole()
        lightBlueBackgroundColor = QColor(Qt.blue).lighter(195)
        #lightBlueBackgroundColor = QColor(Qt.red)
        self.palette().setColor(QPalette.Base, lightBlueBackgroundColor)       # OS X
        self.palette().setColor(QPalette.Window, lightBlueBackgroundColor)

        self.setColumnCount(1)
        self.setHeaderLabels([headerLabel])
        if dragEnabled:
            self.setDragEnabled(True)
Ejemplo n.º 50
0
    def __init__(self):
        QTreeWidget.__init__(self)
        self.header().setHidden(True)
        self.setSelectionMode(self.SingleSelection)
        self.setAnimated(True)
        self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
        self.header().setResizeMode(0, QHeaderView.ResizeToContents)
        self.header().setStretchLastSection(False)
        self.actualSymbols = ('', {})
        self.docstrings = {}

        self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"),
                     self._go_to_definition)
        self.setContextMenuPolicy(Qt.CustomContextMenu)
        self.connect(self,
                     SIGNAL("customContextMenuRequested(const QPoint &)"),
                     self._menu_context_tree)
Ejemplo n.º 51
0
    def __init__(self):
        QTreeWidget.__init__(self)
        self.header().setHidden(True)
        self.setSelectionMode(self.SingleSelection)
        self.setAnimated(True)
        self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
        self.header().setResizeMode(0, QHeaderView.ResizeToContents)
        self.header().setStretchLastSection(False)
        self.actualSymbols = ('', {})
        self.docstrings = {}

        self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"),
            self._go_to_definition)
        self.setContextMenuPolicy(Qt.CustomContextMenu)
        self.connect(self,
            SIGNAL("customContextMenuRequested(const QPoint &)"),
            self._menu_context_tree)
Ejemplo n.º 52
0
    def __init__(self, parent=None):
        """initialize the widget"""
        QTreeWidget.__init__(self, parent)

        #labels = QStringList()
        #labels << self.tr("Title") << self.tr("Location")

        #self.header().setResizeMode(QHeaderView.Stretch)
        #self.setHeaderLabels(labels)

        self.folderIcon = QIcon()
        self.bookmarkIcon = QIcon()

        self.folderIcon.addPixmap(
            self.style().standardPixmap(QStyle.SP_DirClosedIcon), QIcon.Normal,
            QIcon.Off)
        self.folderIcon.addPixmap(
            self.style().standardPixmap(QStyle.SP_DirOpenIcon), QIcon.Normal,
            QIcon.On)
        self.bookmarkIcon.addPixmap(self.style().standardPixmap(
            QStyle.SP_FileIcon))

        #    self.connect(self, SIGNAL('itemExpanded(QTreeWidgetItem *)'),
        #            self.on_item_expanded)
        #
        #    self.connect(self,
        #            SIGNAL('itemActivated(QTreeWidgetItem *, int)'),
        #            self._on_item_clicked)

        self.__controler = None
        self.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.__currentItem = None

        self.infoIcon_ = QIcon()
        self.infoIcon_.addPixmap(
            QPixmap(_fromUtf8(":/icons/images/info1.png")), QIcon.Normal,
            QIcon.Off)

        self.filesIcon_ = QIcon()
        self.filesIcon_.addPixmap(
            QPixmap(_fromUtf8(":/icons/images/files1.png")), QIcon.Normal,
            QIcon.Off)

        self.__popUp = None
        self.__jobAction = None
        self.__bookmarksAction = None
Ejemplo n.º 53
0
    def __init__(self, main):
        QTreeWidget.__init__(self)
        self.header().setHidden(True)
        self.setSelectionMode(self.SingleSelection)
        self.setAnimated(True)
        self._main = main
        self.extraMenus = {}
        self.actualProject = None
        self.projects = {}

        self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
        self.header().setResizeMode(0, QHeaderView.ResizeToContents)
        self.header().setStretchLastSection(False)

        self.setContextMenuPolicy(Qt.CustomContextMenu)
        self.connect(self, SIGNAL("customContextMenuRequested(const QPoint &)"), self.menuContextTree)
        self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"), self._open_file)
Ejemplo n.º 54
0
    def __init__(self, locator):
        QTreeWidget.__init__(self)
        self.locator = locator
        self._explorer_s = self.locator.get_service('explorer')
        self._main_s = self.locator.get_service('editor')
        #on current tab changed refresh
        self._main_s.currentTabChanged.connect(self._on_tab_changed)
        #on file saved refresh
        self._main_s.fileSaved.connect(self._on_file_saved)

        self.header().setHidden(True)
        self.setSelectionMode(self.SingleSelection)
        self.setAnimated(True)
        self.header().setHorizontalScrollMode(QAbstractItemView.ScrollPerPixel)
        self.header().setResizeMode(0, QHeaderView.ResizeToContents)
        self.header().setStretchLastSection(False)

        self.connect(self, SIGNAL("itemClicked(QTreeWidgetItem *, int)"),
                     self._go_to_definition)
Ejemplo n.º 55
0
    def __init__(self, parent):
        QTreeWidget.__init__(self, parent)
        self.setItemsExpandable(True)
        self.setColumnCount(1)
        self.connect(self, SIGNAL('itemActivated(QTreeWidgetItem*,int)'),
                     self.activated)
        self.connect(self, SIGNAL('itemClicked(QTreeWidgetItem*,int)'),
                     self.clicked)
        # Setup context menu
        self.menu = QMenu(self)
        self.collapse_all_action = None
        self.collapse_selection_action = None
        self.expand_all_action = None
        self.expand_selection_action = None
        self.common_actions = self.setup_common_actions()

        self.__expanded_state = None

        self.connect(self, SIGNAL('itemSelectionChanged()'),
                     self.item_selection_changed)
        self.item_selection_changed()
Ejemplo n.º 56
0
    def __init__(self, parent):
        QTreeWidget.__init__(self, parent)
        
        self.connection = None
        # QTreeWidgetItem configuration
        self.header().hide()
        self.setSortingEnabled(True)
        self.sortItems(0, Qt.AscendingOrder)
        self.buddies = {}
        self.groups  = {}
        self.tree    = {}

        self.setContextMenuPolicy(Qt.CustomContextMenu)
        self.menu = QMenu()
        self.menu.addAction(QIcon("images/rename.png"), "Rename", self.rename)
        self.menu.addAction(QIcon("images/infos.png"), "User Infos", self.getInfo)

        self.connect(self, SIGNAL("customContextMenuRequested(QPoint)"), self.context)

        self.offline = True
        self.away = False