Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. PyQt5, Qt5.1.1, ASSERT failure in QVector
Forum Updated to NodeBB v4.3 + New Features

PyQt5, Qt5.1.1, ASSERT failure in QVector

Scheduled Pinned Locked Moved Language Bindings
1 Posts 1 Posters 1.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    tuxerware
    wrote on last edited by
    #1

    Hi! I'm experiencing a problem that might be a bug in PyQt. Example:

    @class CommClient(QObject):

    def init(self, parent=None):
    QObject.init(self)
    self._devicelist = "--"

    self.timer = QTimer()
    self.timer.timeout.connect(self.test)
    self.timer.start(2000)

    def setDeviceList( self, devlist ):
    self._devicelist = devlist
    self.deviceListUpdated.emit()

    def getDevicelist(self):
    return self._devicelist
    deviceListUpdated = pyqtSignal()
    devicelist = pyqtProperty(str, getDevicelist, notify=deviceListUpdated)

    def test(self):
    self._devicelist = "New Device"
    self.deviceListUpdated.emit()
    self.timer.stop()

    app = QApplication(sys.argv)

    qmlRegisterType(CommClient, 'SDL', 1, 0, 'CommClient')

    view = QQuickView()
    view.setWidth(500)
    view.setHeight(500)
    view.setTitle('CommClient')

    view.setSource(QUrl('main.qml'))
    view.show()
    app.exec_()

    @

    And the qml file:

    @import QtQuick 2.0
    import SDL 1.0

    Rectangle {
    width: 400
    height: 400

    Text {
    id: myText
    text: commClient.devicelist
    anchors.horizontalCenter: parent.horizontalCenter
    }

    CommClient {
        id: commClient
    }
    

    }@

    When the time fires and the signal is emitted I get:

    @
    ASSERT failure in QVector<T>::at: "index out of range", file ../../include/QtCore/../../src/corelib/tools/qvector.h, line 350
    Aborted
    @

    Does anyone have a clue if it's a bug in my code or perhaps PyQt?

    I am running the latest snapshot of PyQt5.1 ( PyQt-gpl-5.1.1-snapshot-41b8f6ca2ea4. ) and stable Qt5.1.1 built from source on Ubuntu 12.04.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved