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. QListWidgetItem's Tool Tip not showing up
Qt 6.11 is out! See what's new in the release blog

QListWidgetItem's Tool Tip not showing up

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.7k Views 1 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.
  • V Offline
    V Offline
    vikinglief
    wrote on last edited by
    #1

    In my application, I'm using a custom class derived from QStyledItemDelegate to control what is shown for any given item in my QListWidget. Previous developers wrote the loading code for said QListWidget such that all of the loading was done in the main thread, leading to a blocked UI experience. While trying to off-load some of that to a worker thread, I ran across this frustration: if I create the instance of my delegate in the worker thread, then the tool tip no longer displays after the call for QListWidgetItem::setToolTip.

    Has anyone encountered anything like this?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vikinglief
      wrote on last edited by
      #2

      For those curious, I did find a solution. Within the worker thread's method that creates the delegate, I had to do delegate->moveToThread(QApplication::instance()->thread()) to change the delegate's thread affinity back to the main thread.

      This is because the tool tip is fired off of the helpEvent slot, which has a return value, and the meta system, when it sees the that the thread affinity between the caller and the target objects are different, will use QueuedConnection, and QueuedConnection does not support return values. Hence, no call to helpEvent and no tooltip being shown.

      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