Python PyQt5.QtGui.QStandardItemModel() Examples

The following are code examples for showing how to use PyQt5.QtGui.QStandardItemModel(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: Lector   Author: BasioMeusPuga   File: dockwidgets.py    GNU General Public License v3.0 6 votes vote down vote up
def populate(self):
        self.setFeatures(QtWidgets.QDockWidget.DockWidgetClosable)
        self.setTitleBarWidget(QtWidgets.QWidget(self))  # Removes titlebar
        self.sideDockTabWidget = QtWidgets.QTabWidget(self)
        self.setWidget(self.sideDockTabWidget)

        # This order is important
        self.bookmarkModel = QtGui.QStandardItemModel(self)
        self.bookmarkProxyModel = BookmarkProxyModel(self)
        self.bookmarks = Bookmarks(self)
        self.bookmarks.generate_bookmark_model()

        if not self.parent.are_we_doing_images_only:
            self.annotationModel = QtGui.QStandardItemModel(self)
            self.annotations = Annotations(self)
            self.annotations.generate_annotation_model()

            self.searchResultsModel = QtGui.QStandardItemModel(self)
            self.search = Search(self) 
Example 2
Project: XulDebugTool   Author: starcor-company   File: FavoriteTreeView.py    GNU Lesser General Public License v3.0 6 votes vote down vote up
def __init__(self,window, parent=None):
        self.mainWindow = window
        try:
            super(FavoriteTreeView,self).__init__(parent)
            self.treeModel = QStandardItemModel()
            self.favorites = QStandardItem(ROOT_FAVORITES)
            self.buildFavoritesTree()
            self.providerQueryHistory = QStandardItem(ROOT_PROVIDERQUERYHISTORY)
            self.buildQueryHistory()
            self.treeModel.appendColumn([self.favorites,self.providerQueryHistory])
            self.treeModel.setHeaderData(0, Qt.Horizontal, 'Record')

            self.setModel(self.treeModel)
            self.setEditTriggers(QAbstractItemView.NoEditTriggers)
            self.setContextMenuPolicy(Qt.CustomContextMenu)
            self.customContextMenuRequested.connect(self.openContextMenu)
            self.doubleClicked.connect(self.onTreeItemDoubleClicked)
            self.setSelectionBehavior(QAbstractItemView.SelectItems)
            # 设置该控件可以多选
            self.setSelectionMode(QAbstractItemView.ExtendedSelection)
            # self.clicked.connect(self.clickState)
        except Exception as e:
            STCLogger().e(e) 
Example 3
Project: FIRST-plugin-ida   Author: vrtadmin   File: first.py    GNU General Public License v2.0 6 votes vote down vote up
def _model_builder(self, model, data, initialize=False):
            '''
            Build the function model.
            @param model: QStandardItemModel object
            '''
            if initialize:
                model.clear()  # Clear the model
                FIRSTUI.SharedObjects.make_model_headers(model)

            if not data:
                return

            model.add_data(data)

            # Add db functions to the model
            root_node = model.invisibleRootItem()
            for address, matches in data.iteritems():
                function = FIRST.Metadata.get_function(address)

                func_row = self._make_function_item(function, len(matches))
                root_node.appendRow(func_row)

                for match in matches:
                    info_list = FIRSTUI.SharedObjects.make_match_info(match)
                    func_row[0].appendRow(info_list) 
Example 4
Project: opcua-modeler   Author: FreeOpcUa   File: refnodesets_widget.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, view):
        QObject.__init__(self, view)
        self.view = view
        self.model = QStandardItemModel()
        self.view.setModel(self.model)
        self.nodesets = []
        self.server_mgr = None
        self.view.header().setSectionResizeMode(1)
        
        addNodeSetAction = QAction("Add Reference Node Set", self.model)
        addNodeSetAction.triggered.connect(self.add_nodeset)
        self.removeNodeSetAction = QAction("Remove Reference Node Set", self.model)
        self.removeNodeSetAction.triggered.connect(self.remove_nodeset)

        self.view.setContextMenuPolicy(Qt.CustomContextMenu)
        self.view.customContextMenuRequested.connect(self.showContextMenu)
        self._contextMenu = QMenu()
        self._contextMenu.addAction(addNodeSetAction)
        self._contextMenu.addAction(self.removeNodeSetAction) 
Example 5
Project: opcua-modeler   Author: FreeOpcUa   File: namespace_widget.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, view):
        QObject.__init__(self, view)
        self.view = view
        self.model = QStandardItemModel()
        self.view.setModel(self.model)
        delegate = MyDelegate(self.view, self)
        delegate.error.connect(self.error.emit)
        self.view.setItemDelegate(delegate)
        self.node = None
        self.view.header().setSectionResizeMode(1)
        
        self.addNamespaceAction = QAction("Add Namespace", self.model)
        self.addNamespaceAction.triggered.connect(self.add_namespace)
        self.removeNamespaceAction = QAction("Remove Namespace", self.model)
        self.removeNamespaceAction.triggered.connect(self.remove_namespace)

        self.view.setContextMenuPolicy(Qt.CustomContextMenu)
        self.view.customContextMenuRequested.connect(self.showContextMenu)
        self._contextMenu = QMenu()
        self._contextMenu.addAction(self.addNamespaceAction)
        self._contextMenu.addAction(self.removeNamespaceAction) 
Example 6
Project: EGGTol   Author: lnls-gam   File: PointsListMenu.py    GNU Lesser General Public License v3.0 6 votes vote down vote up
def initUI(self, parent):
        """
        # Method: initUI.
        # Description: This method initializes the User Interface Elements of the Points
        List Menu side widget.
        # Parameters: * MainWindow parent = A reference for the main window object.
        """

        # Defining some properties for the treeView:
        self.setAnimated(True)
        self.setHeaderHidden(True)
        self.setContextMenuPolicy(Qt.CustomContextMenu)
        self.customContextMenuRequested.connect(lambda position : self.openMenu(position, parent))
        self.model = QStandardItemModel()
        self.model.appendRow(QStandardItem(''))
        self.model.appendRow(QStandardItem('To delete a point or a group of points,'))
        self.model.appendRow(QStandardItem('right-click on the corresponding group'))
        self.model.appendRow(QStandardItem('and select DELETE.'))
        self.model.appendRow(QStandardItem(''))
        self.model.appendRow(QStandardItem('ALL POINTS'))
        self.model.appendRow(QStandardItem(''))
        self.addItems(self.model, parent.pointsList)
        self.setModel(self.model) 
Example 7
Project: kdesrc-build-genconf   Author: Wenzel   File: kdesrc-build-genconf.py    GNU General Public License v2.0 6 votes vote down vote up
def setupModelData(xml_tree):
    model = QStandardItemModel()
    model.setHorizontalHeaderLabels(['Name'])
    root = model.invisibleRootItem()

    for comp in xml_tree.findall('component'):
        comp_item = QStandardItem(comp.attrib['identifier'])
        comp_item.setCheckable(True)
        comp_item.setSelectable(False)
        for mod in comp.findall('module'):
            mod_item = QStandardItem(mod.attrib['identifier'])
            mod_item.setCheckable(True)
            for proj in mod.findall('project'):
                proj_item = QStandardItem(proj.attrib['identifier'])
                proj_item.setCheckable(True)
                mod_item.appendRow(proj_item)
            comp_item.appendRow(mod_item)
        root.appendRow(comp_item)

    return model 
Example 8
Project: opcua-client-gui   Author: FreeOpcUa   File: mainwindow.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, window, uaclient):
        self.window = window
        self.uaclient = uaclient
        self._handler = EventHandler()
        self._subscribed_nodes = []  # FIXME: not really needed
        self.model = QStandardItemModel()
        self.window.ui.evView.setModel(self.model)
        self.window.ui.actionSubscribeEvent.triggered.connect(self._subscribe)
        self.window.ui.actionUnsubscribeEvents.triggered.connect(self._unsubscribe)
        # context menu
        self.window.addAction(self.window.ui.actionSubscribeEvent)
        self.window.addAction(self.window.ui.actionUnsubscribeEvents)
        self.window.addAction(self.window.ui.actionAddToGraph)
        self._handler.event_fired.connect(self._update_event_model, type=Qt.QueuedConnection)

        # accept drops
        self.model.canDropMimeData = self.canDropMimeData
        self.model.dropMimeData = self.dropMimeData 
Example 9
Project: opcua-client-gui   Author: FreeOpcUa   File: mainwindow.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, window, uaclient):
        self.window = window
        self.uaclient = uaclient
        self._subhandler = DataChangeHandler()
        self._subscribed_nodes = []
        self.model = QStandardItemModel()
        self.window.ui.subView.setModel(self.model)
        self.window.ui.subView.horizontalHeader().setSectionResizeMode(1)

        self.window.ui.actionSubscribeDataChange.triggered.connect(self._subscribe)
        self.window.ui.actionUnsubscribeDataChange.triggered.connect(self._unsubscribe)

        # populate contextual menu
        self.window.addAction(self.window.ui.actionSubscribeDataChange)
        self.window.addAction(self.window.ui.actionUnsubscribeDataChange)

        # handle subscriptions
        self._subhandler.data_change_fired.connect(self._update_subscription_model, type=Qt.QueuedConnection)
        
        # accept drops
        self.model.canDropMimeData = self.canDropMimeData
        self.model.dropMimeData = self.dropMimeData 
Example 10
Project: CustomWidgets   Author: PyQt5   File: CColorItems.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, colors, *args, **kwargs):
        super(CColorItems, self).__init__(*args, **kwargs)
        self.setItemDelegate(StyledItemDelegate(self))
        self.setEditTriggers(self.NoEditTriggers)
        self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        self.setFlow(self.LeftToRight)
        self.setWrapping(True)
        self.setResizeMode(self.Adjust)
        self.setSpacing(6)
        self.setCursor(Qt.PointingHandCursor)
        self.setFrameShape(self.NoFrame)
        self._model = QStandardItemModel(self)
        self.setModel(self._model)

        for color in colors:
            self.addColor(color) 
Example 11
Project: quantumpt   Author: QuantumPrayerTimes   File: settingsdialog.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None):
        super(MainSettingsFrame, self).__init__(parent)

        self.setObjectName(self.__class__.__name__)

        self.city_object = None
        self.grid_layout = QtWidgets.QGridLayout()

        self.listview_countries = ListView(self)
        self.country_model = QStandardItemModel()

        self.listview_cities = ListView(self)
        self.list_cities = {}
        self.city_model = QStringListModel()

        self._selected_country = ""
        self._selected_city = ""

        self.frame_city = FrameCitySetting(self)

        self.setup_ui() 
Example 12
Project: quantumpt   Author: QuantumPrayerTimes   File: locationofflinepage.py    GNU General Public License v3.0 6 votes vote down vote up
def set_completer(self, city):
        """
        Set the completer by creating a model of cities that have more than 3 letters.
        Avoir lag and memory resources problems.

        :param city: 4 first letters of the city.
        """

        query = QSqlQuery(self.db)
        query.exec("SELECT * from DATABASE WHERE (city LIKE '{}%')".format(city))

        model = QStandardItemModel()

        while query.next():
            record = query.record()
            item = QStandardItem()
            item.setIcon(QIcon(":/icons/countries/{}.png".format(str(record.value('cc')))))
            nam = "{}, {}, {}".format(record.value('city'), record.value('state'), record.value('country'))
            item.setText(nam)
            model.appendRow(item)

        self.line_edit.city_completer.setModel(model) 
Example 13
Project: solar-viewer   Author: RobertJaro   File: composite.py    BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def onAction(self):
        dlg = QtWidgets.QDialog()
        ui = Ui_OpenComposite()
        ui.setupUi(dlg)

        model = QStandardItemModel()
        viewer_ctrls = self.content_ctrl.getViewerControllers(DataType.MAP)
        for v in viewer_ctrls:
            item = QStandardItem("{}: {}".format(v.v_id, v.getTitle()))
            item.setCheckable(True)
            item.v_id = v.v_id
            model.appendRow(item)

        ui.list.setModel(model)

        if not dlg.exec_():
            return
        map_models = self._getSelectedDataModels(model)
        if len(map_models) == 0:
            return

        model = self._createModel(map_models)
        ctrl = CompositeMapViewerController.fromModel(model)
        self.content_ctrl.addViewerController(ctrl) 
Example 14
Project: Dwarf   Author: iGio90   File: elf_info_dlg.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent=None, file_path=None):
        super().__init__(parent=parent)
        h_box = QHBoxLayout(self)
        self._ident_titles = ['EI_MAG0', 'EI_MAG1', 'EI_MAG2', 'EI_MAG3', 'EI_CLASS', 'EI_DATA', 'EI_VERSION', 'EI_OSABI', 'EI_ABIVERSION', 'EI_PAD']
        self.elf_info = DwarfListView(self)
        self.elf_info.setRootIsDecorated(True)
        self.elf_info.setExpandsOnDoubleClick(True)
        self.elf_info.setContextMenuPolicy(Qt.CustomContextMenu)
        self.elf_info.customContextMenuRequested.connect(self._on_context_menu)
        h_box.addWidget(self.elf_info)
        self._elf_info_mdl = QStandardItemModel(0, 2)
        self._elf_info_mdl.setHeaderData(0, Qt.Horizontal, 'Name')
        self._elf_info_mdl.setHeaderData(1, Qt.Horizontal, 'Value')
        self.elf_info.setModel(self._elf_info_mdl)
        self.elf_info.doubleClicked.connect(self._on_dblclicked)
        self.title = "ELF Info"
        self._elf_file_path = None
        self.setLayout(h_box)
        if file_path:
            self.set_elf_file(file_path) 
Example 15
Project: r2dwarf   Author: iGio90   File: e_vars_list.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, plugin):
        super().__init__()

        self.plugin = plugin

        self.e_vars_refresher = RefreshVars(self.plugin)
        self.e_vars_refresher.onFinishVarsRefresh.connect(self.on_vars_refresh)

        self.e_list_model = QStandardItemModel(0, 2)
        self.e_list_model.setHeaderData(0, Qt.Horizontal, 'e vars')
        self.e_list_model.setHeaderData(1, Qt.Horizontal, '')
        self.setModel(self.e_list_model)

        self.doubleClicked.connect(self._item_double_clicked) 
Example 16
Project: pywerami   Author: ondrolexa   File: mainapp.py    GNU General Public License v3.0 5 votes vote down vote up
def import_data(self, filename=None):
        if not filename:
            filename = QtWidgets.QFileDialog.getOpenFileName(self, "Import data file", ".", "Perple_X Table (*.tab *.TAB);;TCInvestigator (*.tci *.TCI)")[0]
        if filename:
            if filename.lower().endswith('.tab'):
                self.data = GridData.from_tab(filename)
            elif filename.lower().endswith('.tci'):
                self.data = GridData.from_tci(filename)
            else:
                raise Exception('Unsupported file format')
            # populate listview and setup properties
            self.datafilename = filename
            self.ready = True
            self.project = None
            self.changed = True
            self.props = {}
            self._model = QtGui.QStandardItemModel(self.listView)
            for var in self.data.dep:
                item = QtGui.QStandardItem(var)
                item.setCheckable(True)
                self._model.appendRow(item)
                self.default_var_props(var)

            self.listView.setModel(self._model)
            self.listView.show()

            # connect listview signals
            self.varSel = self.listView.selectionModel()
            try: elf.varSel.selectionChanged.disconnect()
            except Exception: pass
            self.varSel.selectionChanged.connect(self.on_var_changed)
            try: self._model.itemChanged.disconnect()
            except Exception: pass
            self._model.itemChanged.connect(self.plot)

            # all done focus
            self.action3D.setChecked(False) # no 3d on import
            self.varSel.setCurrentIndex(self._model.index(0, 0), QtCore.QItemSelectionModel.ClearAndSelect | QtCore.QItemSelectionModel.Rows)
            self.listView.setFocus()
            self.plot()
            self.statusbar.showMessage("Data from {} imported".format(self.data.label), 5000) 
Example 17
Project: dcc   Author: amimo   File: xrefwindow.py    Apache License 2.0 5 votes vote down vote up
def __init__(self, parent=None, win=None, xrefs=None, headers=None):
        super(XrefValueWindow, self).__init__(parent)
        self.parent = parent
        self.mainwin = win
        self.xrefs = xrefs
        self.headers = headers

        self.reverse_strings = {}

        self.proxyModel = QtCore.QSortFilterProxyModel()
        self.proxyModel.setDynamicSortFilter(True)

        self.model = QtGui.QStandardItemModel(len(self.xrefs),
                                              len(self.headers), self)

        column = 0
        for header in headers:
            self.model.setHeaderData(column, QtCore.Qt.Horizontal, header)
            column += 1

        row = 0
        for ref in xrefs:
            for column in range(len(self.headers)):
                self.model.setData(self.model.index(
                    row, column, QtCore.QModelIndex()), "%s" % ref[column])
            row += 1

        self.proxyModel.setSourceModel(self.model)

        self.setRootIsDecorated(False)
        self.setAlternatingRowColors(True)
        self.setModel(self.proxyModel)
        self.setSortingEnabled(True)
        self.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)

        self.doubleClicked.connect(self.slotDoubleClicked) 
Example 18
Project: cct   Author: awacha   File: logviewer.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def setupUi(self, Form):
        Ui_Form.setupUi(self, Form)
        Form.logModel = LogModel()
        Form.logTreeView.setModel(Form.logModel)
        Form.logLevelModel = QtGui.QStandardItemModel()
        Form.logLevelModel.setColumnCount(2)
        Form.filterLevelComboBox.setModel(Form.logLevelModel)
        for i in range(256):
            name = logging.getLevelName(i)
            if not name.startswith('Level '):
                Form.logLevelModel.appendRow([QtGui.QStandardItem(name), QtGui.QStandardItem(str(i))])
        Form.filterLevelComboBox.currentTextChanged.connect(Form.filterLevelChanged)
        Form.keptMessagesSpinBox.valueChanged.connect(Form.keptMessagesChanged) 
Example 19
Project: cct   Author: awacha   File: logviewer.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def filterLevelChanged(self):
        assert isinstance(self.logLevelModel, QtGui.QStandardItemModel)
        level = int(self.logLevelModel.item(self.filterLevelComboBox.currentIndex(), 1).text())
        self.logModel.setLevel(level)
        self.shownMessagesLabel.setText('{:d} from {:d}'.format(self.logModel.rowCount(), len(self.logModel))) 
Example 20
Project: python-aptly-gui   Author: chnyda   File: package_promotion.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, data_manager, parent=None):
        super(PackagePromotion, self).__init__(data_manager, parent)

        self.component_box = QComboBox()
        self.component_label = QLabel("Component")
        self.source_publish_box = QComboBox()
        self.source_publish_label = QLabel("Source")
        self.target_publish_box = QComboBox()
        self.target_publish_label = QLabel("Target")
        publish_button = self.create_button("Promote", self.update_publish)

        self.add_form_element("Source publish", self.source_publish_box)
        self.add_form_element("Source component", self.component_box)
        self.add_form_element("Target publish", self.target_publish_box)
        self.add_form_element("")
        self.add_form_element("Action", publish_button)
        self.add_select_buttons()
        self.add_form_element("Packages")

        # initialize data
        self.model = QStandardItemModel(self.package_label)
        self.fill_publish_box()
        self.recreate_package_box()
        # controllers
        self.source_publish_box.currentIndexChanged.connect(self.update_snapshot_box)
        self.component_box.currentIndexChanged.connect(self.recreate_package_box)

        self.configure_layout() 
Example 21
Project: python-aptly-gui   Author: chnyda   File: list_tab.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, data_manager, parent=None):
        super(ListTab, self).__init__(parent)
        self.data_manager = data_manager

        self.layout = QVBoxLayout()
        self.form_layout = QFormLayout()
        self.grid_layout = QGridLayout()

        self.package_label = QListView()
        self.package_label.setEditTriggers(QAbstractItemView.NoEditTriggers)
        self.model = QStandardItemModel(self.package_label)

        self.grid_layout.addWidget(self.package_label, 0, 0, 0, 0) 
Example 22
Project: eddy   Author: obdasystems   File: description.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        """
        Initialize the WikiTagDialog widget.
        :param parent: the parent widget
        """
        super().__init__(parent)

        self.iconAttribute = QtGui.QIcon(':/icons/18/ic_treeview_attribute')
        self.iconConcept = QtGui.QIcon(':/icons/18/ic_treeview_concept')
        self.iconInstance = QtGui.QIcon(':/icons/18/ic_treeview_instance')
        self.iconRole = QtGui.QIcon(':/icons/18/ic_treeview_role')
        self.iconValue = QtGui.QIcon(':/icons/18/ic_treeview_value')

        self.model = QtGui.QStandardItemModel(self)
        self.proxy = QtCore.QSortFilterProxyModel(self)
        self.proxy.setDynamicSortFilter(False)
        self.proxy.setFilterCaseSensitivity(QtCore.Qt.CaseInsensitive)
        self.proxy.setSortCaseSensitivity(QtCore.Qt.CaseSensitive)
        self.proxy.setSourceModel(self.model)
        self.initUI()

        # nodes allowed in the list view
        self.nodeTypes = {Item.IndividualNode, Item.ConceptNode, Item.AttributeNode, Item.RoleNode}
        self.nodeKeys = set()

        # extract the list of nodes in the diagram
        for node in [node for node in self.project.nodes() if node.type() in self.nodeTypes]:
            if self.nodeKey(node) not in self.nodeKeys:
                self.nodeKeys.add(self.nodeKey(node))
                self.doAddNode(node)

        connect(self.search.textChanged, self.doFilterItem)
        connect(self.search.returnPressed, self.onSearchReturnPressed)
        connect(self.predicateView.doubleClicked, self.onItemDoubleClicked)
        connect(self.predicateView.sgnCurrentItemChanged, self.onItemChanged)
        connect(self.confirmationBox.accepted, self.accept)
        connect(self.confirmationBox.rejected, self.reject) 
Example 23
Project: PyFluxPro   Author: OzFlux   File: pfp_gui.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def edit_L1_gui(self):
        """ Edit L1 control file GUI."""
        # get a QTreeView and a standard model
        self.view = QtWidgets.QTreeView()
        self.model = QtGui.QStandardItemModel()
        #self.tree = custom_treeview()
        # set the context menu policy
        self.view.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        # connect the context menu requested signal to appropriate slot
        self.view.customContextMenuRequested.connect(self.context_menu)
        # do the QTreeView layout
        vbox = QtWidgets.QVBoxLayout()
        vbox.addWidget(self.view)
        self.setLayout(vbox)
        self.setGeometry(300, 300, 600, 400)
        # set some features of the QTreeView
        self.view.setAlternatingRowColors(True)
        #self.tree.setSortingEnabled(True)
        self.view.setHeaderHidden(False)
        self.view.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectItems)
        # set the QTreeView model
        self.view.setModel(self.model)
        # enable drag and drop
        #self.view.setDragDropMode(QtGui.QAbstractItemView.InternalMove)
        # build the model
        self.get_model_from_data()
        # set the default width for the first column
        self.view.setColumnWidth(0, 200)
        # expand the top level of the sections
        for row in range(self.model.rowCount()):
            idx = self.model.index(row, 0)
            self.view.expand(idx) 
Example 24
Project: PyFluxPro   Author: OzFlux   File: pfp_gui.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def edit_L2_gui(self):
        """ Edit L2 control file GUI."""
        # get a QTreeView and a standard model
        self.view = QtWidgets.QTreeView()
        self.model = QtGui.QStandardItemModel()
        # set the context menu policy
        self.view.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        # connect the context menu requested signal to appropriate slot
        self.view.customContextMenuRequested.connect(self.context_menu)
        vbox = QtWidgets.QVBoxLayout()
        vbox.addWidget(self.view)
        self.setLayout(vbox)
        self.setGeometry(300, 300, 600, 400)
        # Tree view
        self.view.setAlternatingRowColors(True)
        #self.tree.setSortingEnabled(True)
        self.view.setHeaderHidden(False)
        self.view.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectItems)
        # set the QTreeView model
        self.view.setModel(self.model)
        # enable drag and drop
        #self.view.setDragDropMode(QtGui.QAbstractItemView.InternalMove)
        # build the model
        self.get_model_from_data()
        # set the default width for the first column
        self.view.setColumnWidth(0, 200)
        # expand the top level of the sections
        for row in range(self.model.rowCount()):
            idx = self.model.index(row, 0)
            self.view.expand(idx) 
Example 25
Project: PyFluxPro   Author: OzFlux   File: pfp_gui.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def edit_L3_gui(self):
        """ Edit L3 control file GUI."""
        # get a QTreeView and a standard model
        self.view = QtWidgets.QTreeView()
        self.model = QtGui.QStandardItemModel()
        # set the context menu policy
        self.view.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        # connect the context menu requested signal to appropriate slot
        self.view.customContextMenuRequested.connect(self.context_menu)
        vbox = QtWidgets.QVBoxLayout()
        vbox.addWidget(self.view)
        self.setLayout(vbox)
        self.setGeometry(300, 300, 600, 400)
        # Tree view
        self.view.setAlternatingRowColors(True)
        #self.tree.setSortingEnabled(True)
        self.view.setHeaderHidden(False)
        self.view.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectItems)
        self.view.setModel(self.model)
        # enable drag and drop
        #self.view.setDragDropMode(QtGui.QAbstractItemView.InternalMove)
        # build the model
        self.get_model_from_data()
        # set the default width for the first column
        self.view.setColumnWidth(0, 200)
        # expand the top level of the sections
        for row in range(self.model.rowCount()):
            idx = self.model.index(row, 0)
            self.view.expand(idx) 
Example 26
Project: PyFluxPro   Author: OzFlux   File: pfp_gui.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def edit_concatenate_gui(self):
        """ Edit a concatenate control file GUI."""
        # get a QTreeView
        self.view = QtWidgets.QTreeView()
        self.model = QtGui.QStandardItemModel()
        # set the context menu policy
        self.view.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        # connect the context menu requested signal to appropriate slot
        self.view.customContextMenuRequested.connect(self.context_menu)
        vbox = QtWidgets.QVBoxLayout()
        vbox.addWidget(self.view)
        self.setLayout(vbox)
        self.setGeometry(300, 300, 600, 400)
        # Tree view
        self.view.setAlternatingRowColors(True)
        #self.tree.setSortingEnabled(True)
        self.view.setHeaderHidden(False)
        self.view.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectItems)
        self.view.setModel(self.model)
        # build the model
        self.get_model_from_data()
        # set the default width for the first column
        self.view.setColumnWidth(0, 200)
        # expand the top level of the sections
        for row in range(self.model.rowCount()):
            idx = self.model.index(row, 0)
            self.view.expand(idx) 
Example 27
Project: PyFluxPro   Author: OzFlux   File: pfp_gui.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def edit_l4_gui(self):
        """ Edit an L4 control file GUI."""
        # get a QTreeView
        self.view = QtWidgets.QTreeView()
        self.model = QtGui.QStandardItemModel()
        # set the context menu policy
        self.view.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        # connect the context menu requested signal to appropriate slot
        self.view.customContextMenuRequested.connect(self.context_menu)
        vbox = QtWidgets.QVBoxLayout()
        vbox.addWidget(self.view)
        self.setLayout(vbox)
        self.setGeometry(300, 300, 600, 400)
        # Tree view
        self.view.setAlternatingRowColors(True)
        #self.tree.setSortingEnabled(True)
        self.view.setHeaderHidden(False)
        self.view.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectItems)
        self.view.setModel(self.model)
        # enable drag and drop
        #self.view.setDragDropMode(QtGui.QAbstractItemView.InternalMove)
        # build the model
        self.get_model_from_data()
        # set the default width for the first column
        self.view.setColumnWidth(0, 210)
        # expand the top level of the sections
        for row in range(self.model.rowCount()):
            idx = self.model.index(row, 0)
            self.view.expand(idx) 
Example 28
Project: PyFluxPro   Author: OzFlux   File: pfp_gui.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def edit_l6_gui(self):
        """ Edit an L6 control file GUI."""
        # get a QTreeView
        self.view = QtWidgets.QTreeView()
        self.model = QtGui.QStandardItemModel()
        # set the context menu policy
        self.view.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        # connect the context menu requested signal to appropriate slot
        self.view.customContextMenuRequested.connect(self.context_menu)
        vbox = QtWidgets.QVBoxLayout()
        vbox.addWidget(self.view)
        self.setLayout(vbox)
        self.setGeometry(300, 300, 600, 400)
        # Tree view
        self.view.setAlternatingRowColors(True)
        self.view.setHeaderHidden(False)
        self.view.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectItems)
        self.view.setModel(self.model)
        # enable drag and drop
        #self.view.setDragDropMode(QtGui.QAbstractItemView.InternalMove)
        # build the model
        self.get_model_from_data()
        # set the default width for the first column
        self.view.setColumnWidth(0, 200)
        # expand the top level of the sections
        for row in range(self.model.rowCount()):
            idx = self.model.index(row, 0)
            self.view.expand(idx) 
Example 29
Project: PyFluxPro   Author: OzFlux   File: pfp_gui.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def edit_nc2csv_ecostress_gui(self):
        """ Edit an nc2csv_ecostress control file GUI."""
        # get a QTreeView
        self.view = QtWidgets.QTreeView()
        self.model = QtGui.QStandardItemModel()
        # set the context menu policy
        self.view.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        # connect the context menu requested signal to appropriate slot
        self.view.customContextMenuRequested.connect(self.context_menu)
        vbox = QtWidgets.QVBoxLayout()
        vbox.addWidget(self.view)
        self.setLayout(vbox)
        self.setGeometry(300, 300, 600, 400)
        # Tree view
        self.view.setAlternatingRowColors(True)
        #self.tree.setSortingEnabled(True)
        self.view.setHeaderHidden(False)
        self.view.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectItems)
        self.view.setModel(self.model)
        #self.tree.setDragDropMode(QtGui.QAbstractItemView.InternalMove)
        # build the model
        self.get_model_from_data()
        # set the default width for the first column
        self.view.setColumnWidth(0, 210)
        # expand the top level of the sections
        for row in range(self.model.rowCount()):
            idx = self.model.index(row, 0)
            self.view.expand(idx) 
Example 30
Project: serialport-gui   Author: kaka-lin   File: modbusbox.py    MIT License 5 votes vote down vote up
def _setup_ui(self):
        self.model = QtGui.QStandardItemModel(1, 3, self)
        self.table = QtWidgets.QTableView(self)
        self.model.setHorizontalHeaderLabels(['registers', 'Hi byte', 'Low byte'])
        self.model.setItem(0,0, QtGui.QStandardItem('0x101'))
        self.model.setItem(0,1, QtGui.QStandardItem('01'))
        self.model.setItem(0,2, QtGui.QStandardItem('00'))
        self.table.setModel(self.model)
        self.ui.value_area.addWidget(self.table, 1, 0, 1, 2)

        self.setComboBox() 
Example 31
Project: FIRST-plugin-ida   Author: vrtadmin   File: first.py    GNU General Public License v2.0 5 votes vote down vote up
def make_model_headers(model, full=True, check_all=True):
            '''
            Set the model horizontal header data
            @param model: the QStandardItemModel which headers should be set

            When full is set to False this mean the headers are for the user
            to review metadata they've created.
            '''
            center_align = ['Rank', 'Similarity', 'i', 'Matches']
            headers = [ ('Function', 'function name'),
                        ('Rank', 'number of times metadata has been applied'),
                        ('Prototype', 'function prototype')]

            if full:
                full_headers = [headers[0]]
                if check_all:
                    full_headers.append(('Matches', 'number of unique matches'))

                full_headers += [
                            headers[1],
                            ('Similarity', 'percent of how similary the match is to the function'),
                            headers[2],
                            ('i', 'full prototype information'),
                            ('Engines', 'engines that matched on this function'),
                            ('i', 'detailed engine information'),
                            ('User', 'creator of the metadata')
                                ]

                headers = full_headers

            i = 0
            for display_name, tooltip in headers:
                item_header = QtGui.QStandardItem(display_name)
                item_header.setToolTip(tooltip)

                if display_name in center_align:
                    item_header.setTextAlignment(Qt.AlignCenter)

                model.setHorizontalHeaderItem(i, item_header)

                i += 1 
Example 32
Project: acbDecrypter   Author: Rieksee   File: window_adxKeySelect.py    GNU General Public License v3.0 5 votes vote down vote up
def read_file(self, file):
        with open(file, 'r') as f:
            for line in f:
                lis = line.split(' : ')
                if len(lis) != 2:
                    continue
                key = (lis[1], lis[0])
                self.keys.append(key)
        self.ui.model = QtGui.QStandardItemModel(self.ui.listView)
        for key in self.keys:
            item = QtGui.QStandardItem(key[0].rstrip('\n'))
            self.ui.model.appendRow(item)
        self.ui.listView.setModel(self.ui.model) 
Example 33
Project: acbDecrypter   Author: Rieksee   File: window_main.py    GNU General Public License v3.0 5 votes vote down vote up
def read_file(self, file):
        if file is None:
            return
        with open(file, 'r') as f:
            for line in f:
                lis = line.split(' : ')
                if len(lis) != 2:
                    continue
                key = (lis[1], lis[0])
                self.keys.append(key)
        self.ui.model = QtGui.QStandardItemModel(self.ui.listView)
        for key in self.keys:
            item = QtGui.QStandardItem(key[0].rstrip('\n'))
            self.ui.model.appendRow(item)
        self.ui.listView.setModel(self.ui.model) 
Example 34
Project: EGGTol   Author: lnls-gam   File: EntitiesMenu.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def initUI(self, parent):
        """
        # Method: initUI.
        # Description: This method initializes the User Interface Elements of the Entities
        Menu side widget.
        # Parameters: * MainWindow parent = A reference for the main window object.
        """
        self.setHeaderHidden(True)
        self.model = QStandardItemModel()
        self.addItems(self.model, parent.entitiesList)
        self.setModel(self.model) 
Example 35
Project: EMFT_ARCHIVE   Author: theendsofinvention   File: base.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, on_change: callable, choices: list = None, parent=None, model: QStandardItemModel = None):
        QComboBox.__init__(self, parent=parent)
        self.on_change = on_change
        if choices:
            self.addItems(choices)
        if model:
            self.setModel(model)
            # noinspection PyUnresolvedReferences
            model.modelAboutToBeReset.connect(self.begin_reset_model)
            # noinspection PyUnresolvedReferences
            model.modelReset.connect(self.end_reset_model)
        # noinspection PyUnresolvedReferences
        self.activated.connect(on_change)
        self._current_text = None 
Example 36
Project: OpenOTDR   Author: hydratim   File: OpenOTDR.py    Mozilla Public License 2.0 5 votes vote down vote up
def __init__(self):
        super(MainWindow, self).__init__()
        self.user_interface = mainwindow.Ui_MainWindow()
        self.user_interface.setupUi(self)
        self.project_model = QtGui.QStandardItemModel()
        self.user_interface.treeView.setModel(self.project_model)
        self.events_model = QtGui.QStandardItemModel()
        self.events_proxy_model = NaturalSortFilterProxyModel()
        self.events_proxy_model.setSourceModel(self.events_model)
        self.events_proxy_model.sort(1, QtCore.Qt.AscendingOrder)
        self.user_interface.eventTableView.setModel(self.events_proxy_model)
        self.user_interface.openProject.clicked.connect(self.open_project)
        self.user_interface.saveProject.clicked.connect(self.save_project)
        self.user_interface.printReport.clicked.connect(self.print_pdf)
        self.user_interface.printReport.setDisabled(True)
        self.user_interface.addTrace.clicked.connect(self.add_trace)
        self.user_interface.removeTrace.clicked.connect(self.remove_trace)
        self.user_interface.recalculateEvents.clicked.connect(self.recalculate_events)
        self.window_len = 0
        self.canvas = None
        self.toolbar = None
        self.raw_features = []
        self.raw_traces = []
        self.files = {}
        self.meta = {}
        self.busy = Lock()
        self._draw() 
Example 37
Project: drdwarf   Author: iGio90   File: explorer.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, plugin):
        super().__init__()

        self.plugin = plugin
        self.adb = plugin.adb

        self.current_path = ''

        self.path_input = QComboBox(self)
        self.path_input.activated[str].connect(self.set_path)

        self.explorer = DwarfListView()
        self.explorer_model = QStandardItemModel(0, 6)
        self.explorer_model.setHeaderData(0, Qt.Horizontal, 'permissions')
        self.explorer_model.setHeaderData(1, Qt.Horizontal, 'uid')
        self.explorer_model.setHeaderData(2, Qt.Horizontal, 'gid')
        self.explorer_model.setHeaderData(3, Qt.Horizontal, 'size')
        self.explorer_model.setHeaderData(4, Qt.Horizontal, 'modified')
        self.explorer_model.setHeaderData(5, Qt.Horizontal, 'name')
        self.explorer.setModel(self.explorer_model)
        self.explorer.doubleClicked.connect(self._item_double_clicked)
        self.explorer.setContextMenuPolicy(Qt.CustomContextMenu)
        self.explorer.customContextMenuRequested.connect(self._on_context_menu)

        box = QVBoxLayout()
        box.addWidget(self.path_input)
        box.addWidget(self.explorer)
        self.setLayout(box) 
Example 38
Project: RealTimeOpenControl   Author: Haschtl   File: RTOC_Import.py    GNU General Public License v3.0 5 votes vote down vote up
def swapXY(self):
        newmodel = QtGui.QStandardItemModel(self)
        for i in reversed(range(self.model.columnCount())):
            c = self.model.takeColumn(i)
            newmodel.insertRow(newmodel.rowCount(), c)
        self.model = newmodel
        self.tableView.setModel(self.model)
        self.tableView.resizeColumnsToContents()
        self.validateSignals() 
Example 39
Project: OnkoDICOM   Author: didymo   File: DicomTree.py    GNU Lesser General Public License v2.1 5 votes vote down vote up
def init_headers_tree(self):
		"""
		Initialize the model and the headers of the DICOM tree
		"""
		self.modelTree = QtGui.QStandardItemModel(0, 5)
		self.modelTree.setHeaderData(0, QtCore.Qt.Horizontal, "Name")
		self.modelTree.setHeaderData(1, QtCore.Qt.Horizontal, "Value")
		self.modelTree.setHeaderData(2, QtCore.Qt.Horizontal, "Tag")
		self.modelTree.setHeaderData(3, QtCore.Qt.Horizontal, "VM")
		self.modelTree.setHeaderData(4, QtCore.Qt.Horizontal, "VR")
		self.treeView.setModel(self.modelTree) 
Example 40
Project: OnkoDICOM   Author: didymo   File: test_tree.py    GNU Lesser General Public License v2.1 5 votes vote down vote up
def array_to_model(self, array):
        model = QtGui.QStandardItemModel()
        parentItem = model.invisibleRootItem()
        for ntuple in array:
            tag = ntuple[0]
            value = ntuple[1]
            if isinstance(value, dict):
                self.recurse_dic_to_item(value, parentItem)
            else:
                item = QtGui.QStandardItem(tag + str(value))
                parentItem.appendRow(item)
        return parentItem 
Example 41
Project: OnkoDICOM   Author: didymo   File: test_tree.py    GNU Lesser General Public License v2.1 5 votes vote down vote up
def dic_to_model(self, dic):
        model = QtGui.QStandardItemModel()
        parentItem = model.invisibleRootItem()
        self.recurse_dic_to_item(dic, parentItem)
        return model 
Example 42
Project: VUT-FIT-IFJ-2017-toolkit   Author: thejoeejoee   File: tree_view_model.py    GNU General Public License v3.0 5 votes vote down vote up
def _create_item(self, parent_model: Union[QStandardItem, QStandardItemModel], name: str, data: Dict) -> QStandardItem:
        item = QStandardItem(name)
        for user_role, row_data in data.items():
            item.setData(row_data, user_role)
        parent_model.appendRow(item)
        return item 
Example 43
Project: git-annex-metadata-gui   Author: alpernebbi   File: field_item_edit_plugin.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self):
        super().__init__()
        self._set = {'foo', 'bar'}

        self._model = QtGui.QStandardItemModel()
        self._model.appendRow(self) 
Example 44
Project: Nenetic   Author: persts   File: point_widget.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, canvas, parent=None):
        QtWidgets.QWidget.__init__(self, parent)
        self.setupUi(self)
        self.canvas = canvas

        self.pushButtonAddClass.clicked.connect(self.add_class)
        self.pushButtonRemoveClass.clicked.connect(self.remove_class)
        self.pushButtonSave.clicked.connect(self.save)
        self.pushButtonLoadPoints.clicked.connect(self.load)
        self.pushButtonReset.clicked.connect(self.reset)
        self.pushButtonExport.clicked.connect(self.export)

        self.tableWidgetClasses.verticalHeader().setVisible(False)
        self.tableWidgetClasses.horizontalHeader().setMinimumSectionSize(1)
        self.tableWidgetClasses.horizontalHeader().setStretchLastSection(False)
        self.tableWidgetClasses.horizontalHeader().setSectionResizeMode(0, QtWidgets.QHeaderView.Stretch)
        self.tableWidgetClasses.setColumnWidth(1, 30)
        self.tableWidgetClasses.cellClicked.connect(self.cell_clicked)
        self.tableWidgetClasses.cellChanged.connect(self.cell_changed)
        self.tableWidgetClasses.selectionModel().selectionChanged.connect(self.selection_changed)

        self.checkBoxDisplayPoints.toggled.connect(self.display_points)
        self.canvas.image_loaded.connect(self.image_loaded)
        self.canvas.update_point_count.connect(self.update_point_count)
        self.canvas.points_loaded.connect(self.display_classes)

        self.model = QtGui.QStandardItemModel()
        self.treeView.setModel(self.model)
        self.reset_model()
        self.treeView.doubleClicked.connect(self.double_click)

        self.spinBoxPointRadius.valueChanged.connect(self.canvas.set_point_radius) 
Example 45
Project: MARA_Framework   Author: xtiankisutsa   File: xrefwindow.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None, win=None, xrefs=None, headers=None):
        super(XrefValueWindow, self).__init__(parent)
        self.parent = parent
        self.mainwin = win
        self.xrefs = xrefs
        self.headers = headers

        self.reverse_strings = {}

        self.proxyModel = QtCore.QSortFilterProxyModel()
        self.proxyModel.setDynamicSortFilter(True)

        self.model = QtGui.QStandardItemModel(len(self.xrefs),
                                              len(self.headers), self)

        column = 0
        for header in headers:
            self.model.setHeaderData(column, QtCore.Qt.Horizontal, header)
            column += 1

        row = 0
        for ref in xrefs:
            for column in range(len(self.headers)):
                self.model.setData(self.model.index(
                    row, column, QtCore.QModelIndex()), "%s" % ref[column])
            row += 1

        self.proxyModel.setSourceModel(self.model)

        self.setRootIsDecorated(False)
        self.setAlternatingRowColors(True)
        self.setModel(self.proxyModel)
        self.setSortingEnabled(True)
        self.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)

        self.doubleClicked.connect(self.slotDoubleClicked) 
Example 46
Project: guppy-proxy   Author: roglew   File: reqtree.py    MIT License 5 votes vote down vote up
def __init__(self):
        QWidget.__init__(self)

        self.setLayout(QVBoxLayout())
        self.layout().setSpacing(0)
        self.layout().setContentsMargins(0, 0, 0, 0)

        self.nodes = {}
        self.tree_view = QTreeView()
        self.tree_view.header().close()
        self.root = QStandardItemModel()
        self.tree_view.setModel(self.root)
        self.layout().addWidget(self.tree_view) 
Example 47
Project: guppy-proxy   Author: roglew   File: reqtree.py    MIT License 5 votes vote down vote up
def clear(self):
        self.nodes = {}
        self.root = QStandardItemModel()
        self.tree_view.setModel(self.root) 
Example 48
Project: CvStudio   Author: haruiz   File: labels_tableview.py    MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(LabelsTableView,self).__init__(parent)
        self._model=QStandardItemModel(0,3)
        self._model.setHorizontalHeaderLabels(["name","color"])
        self.setModel(self._model)
        self.setSelectionBehavior(QAbstractItemView.SelectRows)
        self.setSelectionMode(QAbstractItemView.SingleSelection)
        delegate=LabelsTableDelegate()
        self.setItemDelegate(delegate)
        self.setCursor(QtCore.Qt.PointingHandCursor)
        header=self.horizontalHeader()
        self.setEditTriggers(QAbstractItemView.NoEditTriggers)
        header.setSectionResizeMode(0,QHeaderView.Stretch)
        header.setSectionResizeMode(1,QHeaderView.Stretch)
        self.setColumnHidden(2,True) 
Example 49
Project: tablist-extractor   Author: dbpedia   File: guiExtractor.py    GNU General Public License v3.0 5 votes vote down vote up
def showDomain(self):
        """
        Display the mappers associated with the given domain.

        :return:
        """

        # get the domain name
        domain = str(self.ui.DomainsListCombo.currentText())
        self.ui.DomainNameLineEdit.setText(domain)

        self.ui.UpdateDomainMessageLabel.clear()

        self.mapperListModel = QStandardItemModel()
        # get all the mappers list
        all_mappers = list(self.custom_mappers.keys()) + self.static_mappers
        # keep only the associated mappers in check state.
        for mapper in all_mappers:
            item = QStandardItem(mapper)
            item.setEditable(False)
            if mapper in self.domains[domain]:
                item.setCheckState(Qt.Checked)
            else:
                item.setCheckState(Qt.Unchecked)
            item.setCheckable(True)
            self.mapperListModel.appendRow(item)
        self.ui.MappersListView.setModel(self.mapperListModel) 
Example 50
Project: tablist-extractor   Author: dbpedia   File: guiExtractor.py    GNU General Public License v3.0 5 votes vote down vote up
def getResourceList(self):
        """
        Get all the resources associated with a particular domain and display them.

        :return:
        """

        # get domain name
        domain = str(self.ui.DomainLineEdit.text())
        # get language
        language = str(self.ui.DomainLanguageCombo.currentText())
        # validate domain name
        if domain == "" :
            self.ui.ResourcesListResult.setText("Domain cannot be empty!")
            return

        # create an utils instance
        utils = Utilities.Utilities(language, domain, 't', True)
        selector = Selector.Selector(utils)

        if selector.tot_res_interested > 0:
            selector.collect_resources()
            uri_resource_file = selector.res_list_file
            # open file containing the resources list
            contents = open(uri_resource_file).read().split('\n')
            contents = contents[:-1]

            self.resourcesListModel = QStandardItemModel()
            # display the contents
            for content in contents:
                item = QStandardItem(content)
                item.setEditable(False)
                self.resourcesListModel.appendRow(item)
            self.ui.ResoucesListView.setModel(self.resourcesListModel)
            self.ui.ResourcesListResult.setText("Total resources found: "+str(selector.tot_res_interested))


        else:
            self.ui.ResourcesListResult.setText("No resources found.")