Example #1
0
 def __init__(self, model, view):
     QAbstractListModel.__init__(self)
     self._updating = False
     self.view = view
     self.model = model
     self.view.setModel(self)
     self.model.view = self
Example #2
0
 def __init__(self, parent = None):
     QAbstractListModel.__init__(self, parent)
     self._layerStack = []
     self.selectionModel = QItemSelectionModel(self)
     self.selectionModel.selectionChanged.connect(self.updateGUI)
     self._movingRows = False
     QTimer.singleShot(0, self.updateGUI)
Example #3
0
	def __init__(self, parent = None):
		QAbstractListModel.__init__(self, parent)
		self.list = []
		self.strategies = parent
		self.play = QPixmap()
		self.play.load("img/Play.png")
		self.none = QPixmap(32, 32)
		self.none.fill(QColor(0, 0, 0, 0))
Example #4
0
 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     self._layerStack = []
     self.selectionModel = QItemSelectionModel(self)
     self.selectionModel.selectionChanged.connect(self.updateGUI)
     self.selectionModel.selectionChanged.connect(self._onSelectionChanged)
     self._movingRows = False
     QTimer.singleShot(0, self.updateGUI)
Example #5
0
 def __init__(self, outcome_var=None, parent=None, checkeable=False):
     QAbstractListModel.__init__(self, parent)
     self.variables_list = []
     self.header = "Variable"
     self.outcome = outcome_var
     self.checkeable = checkeable
     self.checked_set = None
     if checkeable:
         self.checked_set = set()
 def __init__(self, outcome_var=None, parent=None, checkeable=False):
     QAbstractListModel.__init__(self, parent)
     self.variables_list = []
     self.header = "Variable"
     self.outcome = outcome_var
     self.checkeable = checkeable
     self.checked_set = None
     if checkeable:
         self.checked_set = set()
Example #7
0
    def __init__(self, waveNames=[], parent=None, *args):
        QAbstractListModel.__init__(self, parent, *args)
        self._app = QApplication.instance().window

        self._orderedWaveNames = []
        for w in waveNames:
            self.appendRow(w)

        # Connect signals
        self.appWaves().waveRemoved[Wave].connect(self.removeWave)
Example #8
0
    def __init__(self, storage_file):
        """Creates a series storage object

        :param storage_file: The default file where to store the JSON
                             represenation of this object.
        """
        QAbstractListModel.__init__(self, None)
        self._series = list()
        self._idbyname = dict()
        self.safeToExit = True
        self._def_path = storage_file
    def __init__(self, parent=None):
        QAbstractListModel.__init__(self, parent)
        self.server = "localhost"
        self.port = 6600
        # prepare client
        self.client = mpd.MPDClient()
        self.client.timeout = None
        self.client.idletimeout = None
        self.client.connect(self.server, self.port)

        self.__updatePlaylist()
        self.__updateCurrent()
Example #10
0
    def __init__(self, parent = None):
        QAbstractListModel.__init__(self, parent)
        self.server = "localhost"
        self.port = 6600
        # prepare client
        self.client = mpd.MPDClient()
        self.client.timeout = None
        self.client.idletimeout = None
        self.client.connect(self.server, self.port)

        self.__updatePlaylist()
        self.__updateCurrent()
Example #11
0
 def __init__(self, parent=None, *args):
     QAbstractListModel.__init__(self, parent, *args)
     self.Zonenliste = []
     ctrl = Controller()
     # gets all usages for the zone paired with the usage times
     self.listOFUsages = ctrl.fillBoundaryConditions()
     self.usageTimes = ctrl.fillUsageTimes()
     self.selectionOfZones = []
     for index, wert in enumerate(self.listOFUsages):
         usage = wert.Nutzung
         nutzungDecoded = usage.decode('iso-8859-1')
         self.selectionOfZones.append(nutzungDecoded)
Example #12
0
 def __init__(self, parent=None, *args):
     QAbstractListModel.__init__(self, parent, *args)
     self.Zonenliste = []
     ctrl = Controller()
     # gets all usages for the zone paired with the usage times
     self.listOFUsages = ctrl.fillBoundaryConditions()
     self.usageTimes = ctrl.fillUsageTimes()
     self.selectionOfZones = []
     for index, wert in enumerate(self.listOFUsages):
         usage = wert.Nutzung
         nutzungDecoded = usage.decode("iso-8859-1")
         self.selectionOfZones.append(nutzungDecoded)
Example #13
0
 def __init__(self, mpdclient, library, config):
     QAbstractListModel.__init__(self)
     self.lastEdit = time()
     self._boldFont = QFont()
     self._boldFont.setBold(True)
     self._stdFont = QFont()
     self.playing = None
     self._clear()
     self._oneLine = config.oneLinePlaylist
     self.mpdclient = mpdclient
     self.library = library
     self.config = config
     self.retriever = iconretriever.ThreadedRetriever(config.coverPath)
Example #14
0
 def __init__(self, parent = None):
     QAbstractListModel.__init__(self, parent)
     self._layerStack = []
     self.selectionModel = QItemSelectionModel(self)
     self.selectionModel.selectionChanged.connect(self.updateGUI)
     self.selectionModel.selectionChanged.connect(self._onSelectionChanged)
     self._movingRows = False
     QTimer.singleShot(0, self.updateGUI)
     
     def _handleRemovedLayer(layer):
         # Layerstacks *own* the layers they hold, and thus are 
         #  responsible for cleaning them up when they are removed:
         layer.clean_up()
     self.layerRemoved.connect( _handleRemovedLayer )
Example #15
0
 def __init__(self, backend, data = []):
     '''
     @type backend: L{src.backends.backend.backend}
     @type data: dict
     '''
     QAbstractListModel.__init__(self, parent = None)
     self.__backend = backend
     self.__data = data
     self.__dates = {}
     
     pix = QPixmap(350, 64)
     pix.fill()
    
     self.__loadedimages = {None: QIcon(pix)}
Example #16
0
 def __init__(self, view_state):
     QAbstractListModel.__init__(self)
     self.view_state = view_state
     view_state.updated.connect(self.changed)
     role_names = {
         self.xrole: 'atomx',
         self.yrole: 'atomy',
         self.zrole: 'atomz',
         self.elementrole: 'element',
         self.covradiusrole: 'covalentRadius',
         self.typerole: 'type',
         self.descriptionrole: 'description'
     }
     self.setRoleNames(role_names)
Example #17
0
	def __init__(self, view_state):
		QAbstractListModel.__init__(self)
		self.view_state = view_state
		view_state.updated.connect(self.changed)
		role_names = {
			self.xrole: 'atomx',
			self.yrole: 'atomy',
			self.zrole: 'atomz',
			self.elementrole: 'element',
			self.covradiusrole: 'covalentRadius',
			self.typerole: 'type',
			self.descriptionrole: 'description'
			}
		self.setRoleNames(role_names)
Example #18
0
	def __init__(self, parent=None, interfaces=None):
		"""
		This method initializes the class.

		:param parent: Parent object. ( QObject )
		:param interfaces: InterfacesModel. ( List )
		"""

		LOGGER.debug("> Initializing '{0}()' class.".format(self.__class__.__name__))

		QAbstractListModel.__init__(self, parent)

		# --- Setting class attributes. ---
		self.__interfaces = []
		self.interfaces = interfaces or self.__interfaces
Example #19
0
    def __init__(self, parent=None):
        """
        Create a model.

        ``parent`` is the parent :class:`~PyQt4.QtCore.QObject`.
        """
        QAbstractListModel.__init__(self, parent)
        self._monitor = MouseDevicesMonitor(self)
        self._monitor.mousePlugged.connect(self._mouse_plugged)
        self._monitor.mouseUnplugged.connect(self._mouse_unplugged)
        self._resume_monitor = create_resume_monitor(self)
        if self._resume_monitor:
            self._resume_monitor.resuming.connect(self._reset_device_index)
        self._device_index = list(self._monitor.plugged_devices)
        self._checked_devices = set()
Example #20
0
    def __init__(self, parent=None):
        """
        Create a model.

        ``parent`` is the parent :class:`~PyQt4.QtCore.QObject`.
        """
        QAbstractListModel.__init__(self, parent)
        self._monitor = MouseDevicesMonitor(self)
        self._monitor.mousePlugged.connect(self._mouse_plugged)
        self._monitor.mouseUnplugged.connect(self._mouse_unplugged)
        self._resume_monitor = create_resume_monitor(self)
        if self._resume_monitor:
            self._resume_monitor.resuming.connect(self._reset_device_index)
        self._device_index = list(self._monitor.plugged_devices)
        self._checked_devices = set()
Example #21
0
    def __init__(self, parent=None):
        QAbstractListModel.__init__(self, parent)
        self._layerStack = []
        self.selectionModel = QItemSelectionModel(self)
        self.selectionModel.selectionChanged.connect(self.updateGUI)
        self.selectionModel.selectionChanged.connect(self._onSelectionChanged)
        self._movingRows = False
        QTimer.singleShot(0, self.updateGUI)

        def _handleRemovedLayer(layer):
            # Layerstacks *own* the layers they hold, and thus are
            #  responsible for cleaning them up when they are removed:
            layer.clean_up()

        self.layerRemoved.connect(_handleRemovedLayer)
Example #22
0
    def __init__(self, hex_widget, match_operation):
        QAbstractListModel.__init__(self)
        self._lock = threading.RLock()
        self._newResults = []
        self._matchOperation = match_operation
        self._hexWidget = hex_widget
        self._results = []
        if self._matchOperation is not None:
            with self._matchOperation.lock:
                self._matchOperation.newResults.connect(self._onNewMatches, Qt.DirectConnection)
                self._matchOperation.finished.connect(self._onMatchFinished, Qt.QueuedConnection)

                for match in self._matchOperation.state.results.values():
                    self._results.append((match, self._createRange(match)))
        self.startTimer(400)
Example #23
0
	def __init__(self, view_state):
		QAbstractListModel.__init__(self)
		self.view_state = view_state
		self.pairs = list(view_state.atoms.info['bonds'])
		view_state.updated.connect(self.changed)
		role_names = {
			self.x1role: 'x1',
			self.y1role: 'y1',
			self.z1role: 'z1',
			self.x2role: 'x2',
			self.y2role: 'y2',
			self.z2role: 'z2',
			self.element1role: 'element1',
			self.element2role: 'element2',
			}
		self.setRoleNames(role_names)
Example #24
0
 def __init__(self, view_state):
     QAbstractListModel.__init__(self)
     self.view_state = view_state
     self.pairs = list(view_state.atoms.info['bonds'])
     view_state.updated.connect(self.changed)
     role_names = {
         self.x1role: 'x1',
         self.y1role: 'y1',
         self.z1role: 'z1',
         self.x2role: 'x2',
         self.y2role: 'y2',
         self.z2role: 'z2',
         self.element1role: 'element1',
         self.element2role: 'element2',
     }
     self.setRoleNames(role_names)
Example #25
0
	def __init__(self, parent=None, languages=None):
		"""
		Initializes the class.

		:param parent: Parent object.
		:type parent: QObject
		:param languages: Languages.
		:type languages: list
		"""

		LOGGER.debug("> Initializing '{0}()' class.".format(self.__class__.__name__))

		QAbstractListModel.__init__(self, parent)

		# --- Setting class attributes. ---
		self.__languages = []
		self.languages = languages
Example #26
0
 def __init__(self, mplayerpgm="mplayer"):
     QAbstractListModel.__init__(self, None)
     self._mplayer_path = mplayerpgm
     self._dllist = list()
     self._idbypath = dict()
     pix = QPixmap(22, 22)
     pix.fill(QColor(0, 0, 255, 255))
     self._icon_run = QIcon(pix)
     pix = QPixmap(22, 22)
     pix.fill(QColor(255, 0, 0, 255))
     self._icon_error = QIcon(pix)
     pix = QPixmap(22, 22)
     pix.fill(QColor(0, 255, 0, 255))
     self._icon_fin = QIcon(pix)
     pix = QPixmap(22, 22)
     pix.fill(QColor(0, 0, 0, 255))
     self._icon_wait = QIcon(pix)
Example #27
0
 def itemData(self, index):
     mapping = QAbstractListModel.itemData(self, index)
     if self._is_index_valid_for(index, self._other_data):
         items = list(self._other_data[index.row()].items())
     else:
         items = []
     for key, value in items:
         mapping[key] = value
     return mapping
Example #28
0
    def __init__(self, parent=None, interfaces=None):
        """
		Initializes the class.

		:param parent: Parent object.
		:type parent: QObject
		:param interfaces: InterfacesModel.
		:type interfaces: list
		"""

        LOGGER.debug("> Initializing '{0}()' class.".format(
            self.__class__.__name__))

        QAbstractListModel.__init__(self, parent)

        # --- Setting class attributes. ---
        self.__interfaces = []
        self.interfaces = interfaces or self.__interfaces
Example #29
0
    def mimeData(self, indexlist):
        if len(indexlist) <= 0:
            return None

        items = [self[i.row()] for i in indexlist]
        mime = QAbstractListModel.mimeData(self, indexlist)
        data = pickle.dumps(vars)
        mime.set_data(self.MIME_TYPE, QByteArray(data))
        mime._items = items
        return mime
Example #30
0
    def dropMimeData(self, mime, action, row, column, parent):
        if action == Qt.IgnoreAction:
            return True

        if not mime.hasFormat(self.MIME_TYPE):
            return False

        if hasattr(mime, "_vars"):
            vars_ = mime._vars
        else:
            desc = str(mime.data(self.MIME_TYPE))
            vars_ = pickle.loads(desc)

        return QAbstractListModel.dropMimeData(
            self, mime, action, row, column, parent)
Example #31
0
 def __init__(self, figure=None, parent=None, *args):
     QAbstractListModel.__init__(self, parent, *args)
     self.parent = parent
     self._figure = figure 
 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     self.addons = []
Example #33
0
 def flags(self, index):
     if not index.isValid():
         return Qt.ItemIsEnabled
     return Qt.ItemFlags(QAbstractListModel.flags(self, index)|Qt.ItemIsUserCheckable)
Example #34
0
 def __init__(self, parent=None, *args):
     QAbstractListModel.__init__(self, parent, *args)
     self.listOfZonesForDisplay = []
Example #35
0
 def index(self, row, column=0, parent=QModelIndex()):
     if self._is_index_valid_for(row, self) and column == 0:
         return QAbstractListModel.createIndex(self, row, column, parent)
     else:
         return QModelIndex()
Example #36
0
 def __init__(self, parent=None):
     QAbstractListModel.__init__(self, parent)
     self.data_list = []
     self.load_img()
     self.update_model()
Example #37
0
 def __init__(self, parent, cols):
     QAbstractListModel.__init__(self, parent)
     self._cols = cols
Example #38
0
 def flags(self, index):
     if index.isValid():
         return QAbstractListModel.flags(self, index) | Qt.ItemIsUserCheckable
     return QAbstractListModel.flags(self, index)
Example #39
0
 def __init__(self):
     QAbstractListModel.__init__(self)
     self.widgets = []
Example #40
0
 def __init__(self):
     QAbstractListModel.__init__(self)
     self.shortcuts = []
Example #41
0
 def flags(self, index):
     # return (QAbstractTableModel.flags(self, index)|Qt.ItemIsEditable)
     return (QAbstractListModel.flags(self, index) | Qt.ItemIsEditable)
Example #42
0
 def __init__(self, datain=None, parent=None, *args):
     """initialize the class members"""
     QAbstractListModel.__init__(self, parent, *args)
     self.__listdata = datain
 def __init__(self, engineMap, view):
     QAbstractListModel.__init__(self)
     self.view = view
     self.view.setModel(self)
     self.engineMap = engineMap
     self.engines = list(sorted(self.engineMap.keys()))
Example #44
0
 def __init__(self, databaseFile):
     QAbstractListModel.__init__(self)
     self.db = ShortcutDatabase(databaseFile)
     self.shortcuts = self.db.selectShortcut("")
Example #45
0
 def mimeTypes(self):
     return self.MIME_TYPES + list(QAbstractListModel.mimeTypes(self))
Example #46
0
 def flags(self, index):
     if index.column() == 0:
         return QAbstractListModel.flags(self, index) | Qt.ItemIsEditable
     return QAbstractListModel.flags(self, index)
Example #47
0
File: Bbox.py Project: Lax-T/Bbox
    def __init__(self, datain, headerdata, parent=None):

        QAbstractListModel.__init__(self, parent)
        self.array_data = datain
        self.header_data = headerdata
Example #48
0
 def __init__(self, datain, parent=None, *args):
     """ datain: a list where each item is a row
     """
     QAbstractListModel.__init__(self, parent, *args)
     self.listdata = datain
Example #49
0
 def __init__(self, datain, parent=None, *args): 
     """ datain: a list where each item is a row
     """
     QAbstractListModel.__init__(self, parent, *args) 
     self.listdata = datain
Example #50
0
    def __init__(self):
        QAbstractListModel.__init__(self)

        # Cache the passed data list as a class member.
        self.items = []