Skip to content
  • 144k Topics
    720k Posts
    Z
    Thanks again for all the replies here; circling back to mark this as solved. I ended up implementing a custom QAbstractTableModel based on the ModifiedRow class in the QSqlTableModel source code. The local data is populated via a QSqlQuery with setForwardOnly set to true. void CachedSqlTableModel::select() { if(m_select.isEmpty() || m_tableName.isEmpty()){ qDebug() << "Invalid select statement"; return; } //Initialize query QSqlQuery query; query.setForwardOnly(true); query.prepare(selectStatement()); query.exec(); if(query.isActive()){ beginResetModel(); //Reset data structure m_cache.clear(); //Populate header data m_record = query.record(); //Populate table data while(query.next()){ m_cache.push_back(CachedRow(CachedRow::Update, query.record())); } endResetModel(); } else { m_error = query.lastError(); } All of the related cached database operations are executed in the exact same way as the code in the QSqlTableModel database handlers. virtual bool updateRowInTable(int row, const QSqlRecord &values); virtual bool insertRowIntoTable(const QSqlRecord &values); virtual bool deleteRowFromTable(int row); A big thank you to @Kent-Dorfman for the additional insights here. I implemented all of the suggestions above (stored procedures, transactions, indexing, limiting datasets, etc.) and there is a noticeable speed difference on all fronts.
  • Jobs, project showcases, announcements - anything that isn't directly development
    4k 23k
    4k Topics
    23k Posts
    Axel SpoerlA
    Dear Qt community! with seven weeks to go until an exciting year 2025 will have passed, we are pleased to open the nomination period for the Qt Champion 2025 award! See this Wiki page for more information about the award and its nomination process: https://wiki.qt.io/Qt_Champions_2025 We're looking very much forward to reading about your favorite candidates! Cheers Axel
  • Everything related to designing and design tools

    129 392
    129 Topics
    392 Posts
    J
    Using QT Designer might be the simpler route if the main goal is to keep the workflow smooth with Python. QT Design Studio projects often need manual adjustments before they run properly under PySide6.
  • Everything related to the QA Tools

    84 225
    84 Topics
    225 Posts
    B
    I have had a problem when editing the names.py manually in that Squish no longer recognises the object. I now delete the object and re-enter it after using the picker tool then add to object map. Not sure if this is what you meant, but hopefully this helps
  • Everything related to learning Qt.

    390 2k
    390 Topics
    2k Posts
    Ash_QtA
    Hey @RahmanTaleshi, please reach out to academy@qt.io if you have not already, and we will get this sorted. We are aware of some issues we are not investigating with challenge enrolments.
  • 2k Topics
    13k Posts
    Christian EhrlicherC
    @stash22 said in Why does QTextStream::pos() return -1 while reading a file line-by-line in Qt?: m_readNmeaTextStream.pos() becomes -1. The documentation states this: https://doc.qt.io/qt-6/qtextstream.html#pos
  • 4k Topics
    18k Posts
    SGaistS
    C'est étrange... DBus qui part à la dérive ? Comment est-ce ça a été détecté ? Sous Wayland ?
  • This is where all the posts related to the Qt web services go. Including severe sillyness.
    1k 10k
    1k Topics
    10k Posts
    GrecKoG
    I think it would be better to send a mail to gerrit-admin@qt-project.org