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. [SOLVED] Set table view column full of clickable icons
Forum Update on Monday, May 27th 2025

[SOLVED] Set table view column full of clickable icons

Scheduled Pinned Locked Moved General and Desktop
qtableviewiconicons
2 Posts 2 Posters 2.1k 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.
  • M Offline
    M Offline
    mkolenda
    wrote on last edited by mkolenda
    #1

    Brief description: http://i.imgur.com/ukAQNaI.png

    I have model whose n-th column have interesting me number. Instead of displaying these numbers in tableView i want in place of text add clickable icon If number is set, or not if number isn't set. Fiddling with Qt::DisplayRole in model doesn't seem to be what i want.
    Is custom QItemDelegate answer to my problems?
    How to change mouse cursor to this fancy click_me-hand when mouse is over that icon?

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

      Hi

      I would say a Delegate would be the way to do it.
      Have a look at
      "Star Delegate Example"

      For your fancy hand, you can use
      QApplication::setOverrideCursor(QCursor(Qt::PointingHandCursor));
      QApplication::restoreOverrideCursor();

      Its also possible via the model
      http://daniel-albuschat.blogspot.dk/2009/09/setting-mouse-cursor-for-qts-item-views.html

      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