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. itemDoubleClicked and cellDoubleClicked.What's the difference between the two?

itemDoubleClicked and cellDoubleClicked.What's the difference between the two?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 4 Posters 1.2k Views 2 Watching
  • 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.
  • C Offline
    C Offline
    canid
    wrote on last edited by
    #1

    QTableWidget: : itemDoubleClicked and QTableWidget: : cellDoubleClicked.What's the difference between the two?

    1 Reply Last reply
    0
    • Christian EhrlicherC Online
      Christian EhrlicherC Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      itemDoubleClicked is only emitted if there is an item set for this cell.

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

      1 Reply Last reply
      3
      • C Offline
        C Offline
        canid
        wrote on last edited by
        #3

        Does a cell differ from an item in not having and having content?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          A cell can be empty or contain an item hence the difference.

          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
          3
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi
            If you have a look here
            https://wiki.qt.io/How_to_Use_QTableWidget

            you see we tell how many rows/columns
            m_pTableWidget->setRowCount(10);
            m_pTableWidget->setColumnCount(3);

            so before we put a QTableWidgetItem in all those cells, they are empty and will return a nullptr
            if you ask for the item.
            So yes, an empty cell is not just an item without text. its itemless.

            1 Reply Last reply
            1

            • Login

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