Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Use QSqlQueryModel with Qt Remote Objects module

Use QSqlQueryModel with Qt Remote Objects module

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 137 Views
  • 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.
  • magrifM Offline
    magrifM Offline
    magrif
    wrote on last edited by magrif
    #1

    Hi everyone
    I have next .rep file:

    class CFooBar {
        MODEL credsModel(display);
    };
    

    On source side I call:

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

    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?
    Thanks!

    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