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. QTableView emits double click signal twice
Forum Updated to NodeBB v4.3 + New Features

QTableView emits double click signal twice

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

    I'm trying to connect to the double click signal from a QTableView and act on it, which works as expected. I can execute my behavior as I need it. However, the signal is emitted twice for some reason, which is not what I want.
    All I'm doing is:

    connect(ui->tableView, &QAbstractItemView::doubleClicked, this, &Receiver::on_tableView_doubleClicked);
    

    Nothing else is interacting with the double click slot, since I specifically added it and nothing else is connected to the double clicked signal as far as I'm aware.

    Qt Version is 5.13.

    Insight is appreciated.

    Christian EhrlicherC 1 Reply Last reply
    0
    • P philfors

      I'm trying to connect to the double click signal from a QTableView and act on it, which works as expected. I can execute my behavior as I need it. However, the signal is emitted twice for some reason, which is not what I want.
      All I'm doing is:

      connect(ui->tableView, &QAbstractItemView::doubleClicked, this, &Receiver::on_tableView_doubleClicked);
      

      Nothing else is interacting with the double click slot, since I specifically added it and nothing else is connected to the double clicked signal as far as I'm aware.

      Qt Version is 5.13.

      Insight is appreciated.

      Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @philfors said in QTableView emits double click event twice:

      All I'm doing is:

      on_tableView_doubleClicked()

      This slot is named so that the (stupid) auto-connect feature kicks in and does an automatic connection. Rename the slot.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      P 1 Reply Last reply
      1
      • P philfors has marked this topic as solved on
      • Christian EhrlicherC Christian Ehrlicher

        @philfors said in QTableView emits double click event twice:

        All I'm doing is:

        on_tableView_doubleClicked()

        This slot is named so that the (stupid) auto-connect feature kicks in and does an automatic connection. Rename the slot.

        P Offline
        P Offline
        philfors
        wrote on last edited by
        #3

        @Christian-Ehrlicher Yep that sure did it, thank you!
        Still new in Qt and learning the ropes.

        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