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. Using Qt Item Model
QtWS25 Last Chance

Using Qt Item Model

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 889 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.
  • G Offline
    G Offline
    gabor53
    wrote on last edited by
    #1

    Hi,
    I created a Qt Item Model class using File -> New File or Project. It generated the fixdb_new.h and fixdb_new.cpp as supposed to. I also created an action in mainwindow.cpp to be able to access the page using the following code:

    void MainWindow::on_actionFix_in_New_triggered()
    {
        fixDb_new *mFixDb_new = new fixDb_new(this);
        mFixDb_new->exec();
    }
    

    When I run it I get the following error message:
    C:\Programming\Projects\Folkfriends_1_0\mainwindow.cpp:194: error: 'class fixDb_new' has no member named 'exec'
    mFixDb_new->exec();
    ^
    Do I get it because this class comes with no ui ? if so, how can I access it?
    Thank you.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      First of all , ONLY QDialog has exec()

      If you created a model , then you must assign it to a view to use it

      http://doc.qt.io/qt-5/qtableview.html#setModel

      any view will do.

      http://doc.qt.io/qt-5/modelview.html

      G 1 Reply Last reply
      3
      • mrjjM mrjj

        Hi
        First of all , ONLY QDialog has exec()

        If you created a model , then you must assign it to a view to use it

        http://doc.qt.io/qt-5/qtableview.html#setModel

        any view will do.

        http://doc.qt.io/qt-5/modelview.html

        G Offline
        G Offline
        gabor53
        wrote on last edited by
        #3

        @mrjj
        Thank you.

        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