Important: Please read the Qt Code of Conduct -

Use QSqlQueryModel with Qt Remote Objects module

  • Hi everyone
    I have next .rep file:

    class CFooBar {
        MODEL credsModel(display);

    On source side I call:

    QSqlQueryModel* model { new QSqlQueryModel };
            "SELECT fname,lname "
            "FROM \"my_table\""
    model->setHeaderData(0, Qt::Horizontal, QObject::tr("First name"), Qt::DisplayRole);
    model->setHeaderData(1, Qt::Horizontal, QObject::tr("Last name"), Qt::DisplayRole);

    This emits credsModelChanged(model);, that I set to table view on replica side. But nothing happens. But if I'm using enableRemoting and acquireModel interfaces, it works.

    How to properly work with MODEL keyword of repc in this context?

Log in to reply