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. How can I assign the click event handler as I click the row in QT?

How can I assign the click event handler as I click the row in QT?

Scheduled Pinned Locked Moved Unsolved General and Desktop
qsqltablemodelqtableviewqtsql
2 Posts 2 Posters 1.3k 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
    gapry
    wrote on 14 Jan 2016, 13:43 last edited by
    #1

    I know how to bind the QSqlTableModel and QTableView to display all the data in the specific table in the databases. Here, it's my code.

    QSqlTableModel model;
    QTableView *view1 = createView(&model, QObject::tr("Table Model (View 1)"));
    view1->setSelectionBehavior(QAbstractItemView::SelectRows);]

    If I need to jump the other form as I click the ith-row on the view, how do I assign the click event?

    For example, If I click the 3rd rows, I will jump to the user form to show the 3rd user info.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 14 Jan 2016, 13:45 last edited by
      #2

      Hi and welcome to devnet,

      You can use the doubleClicked signal for that.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      1/2

      14 Jan 2016, 13:43

      • Login

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