Exemplo n.º 1
0
    def reset(self):
        """
        Clear the widget from inspecting the current view.
        """
        if self.mainview:

            rect = self.rect()
            item = self.model.itemFromIndex(
                self.proxy.mapToSource(self.view.indexAt(rect.topLeft())))
            if item:
                node = item.data()
                key = ParentItem.key(node) if node else item.text()
                self.scrolled[self.mainview] = key
            else:
                self.scrolled.pop(self.mainview, None)

            try:
                scene = self.mainview.scene()
                disconnect(scene.index.sgnItemAdded, self.add)
                disconnect(scene.index.sgnItemRemoved, self.remove)
            except RuntimeError:
                pass
            finally:
                self.mainview = None

        self.model.clear()
Exemplo n.º 2
0
 def stopMove(self):
     """
     Stop the view movement by destroying the timer object causing it.
     """
     if self.moveTimer:
         self.moveTimer.stop()
         disconnect(self.moveTimer.timeout)
         self.moveTimer = None
Exemplo n.º 3
0
 def stopMove(self):
     """
     Stop the view movement by destroying the timer object causing it.
     """
     if self.moveTimer:
         self.moveTimer.stop()
         disconnect(self.moveTimer.timeout)
         self.moveTimer = None
Exemplo n.º 4
0
    def newConnection(self):
        """
        Executed whenever a message is received.
        """
        if self.inSocket:
            # Disconnect previously connected signal slot.
            disconnect(self.inSocket.readyRead, self.readyRead)

        # Create a new socket.
        self.inSocket = self.server.nextPendingConnection()

        if self.inSocket:
            self.inStream = QTextStream(self.inSocket)
            self.inStream.setCodec('UTF-8')
            connect(self.inSocket.readyRead, self.readyRead)
            self.activate()
Exemplo n.º 5
0
    def newConnection(self):
        """
        Executed whenever a message is received.
        """
        if self.inSocket:
            # Disconnect previously connected signal slot.
            disconnect(self.inSocket.readyRead, self.readyRead)

        # Create a new socket.
        self.inSocket = self.server.nextPendingConnection()

        if self.inSocket:
            self.inStream = QTextStream(self.inSocket)
            self.inStream.setCodec('UTF-8')
            connect(self.inSocket.readyRead, self.readyRead)
            self.activate()
Exemplo n.º 6
0
    def reset(self):
        """
        Clear the widget from browsing the current view.
        """
        if self.mainview:

            try:
                scene = self.mainview.scene()
                disconnect(scene.selectionChanged, self.updateView)
                disconnect(scene.sgnUpdated, self.updateView)
            except RuntimeError:
                pass
            finally:
                self.mainview = None

        viewport = self.viewport()
        viewport.update()
Exemplo n.º 7
0
    def reset(self):
        """
        Clear the widget from inspecting the current view.
        """
        if self.scene:

            try:
                disconnect(self.scene.selectionChanged, self.stack)
                disconnect(self.scene.sgnItemAdded, self.stack)
                disconnect(self.scene.sgnItemRemoved, self.stack)
                disconnect(self.scene.sgnUpdated, self.stack)
            except RuntimeError:
                pass
            finally:
                self.scene = None

        self.stack()
Exemplo n.º 8
0
    def reset(self):
        """
        Clear the widget from inspecting the current view.
        """
        if self.scene:

            try:
                disconnect(self.scene.selectionChanged, self.stack)
                disconnect(self.scene.sgnItemAdded, self.stack)
                disconnect(self.scene.sgnItemRemoved, self.stack)
                disconnect(self.scene.sgnUpdated, self.stack)
            except RuntimeError:
                pass
            finally:
                self.scene = None

        self.stack()