Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. how to pop-up the QlistWidget item on hovering???
Forum Updated to NodeBB v4.3 + New Features

how to pop-up the QlistWidget item on hovering???

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
3 Posts 3 Posters 1.2k 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.
  • K Offline
    K Offline
    kishore_hemmady
    wrote on last edited by kishore_hemmady
    #1

    hi,
    how to display a QListwidget content on mouse hovering.can i do it using style sheet ??
    0_1533554633672_scshot.png .
    I have to do like the above image .please suggest me..
    thank you

    jsulmJ 1 Reply Last reply
    0
    • K kishore_hemmady

      hi,
      how to display a QListwidget content on mouse hovering.can i do it using style sheet ??
      0_1533554633672_scshot.png .
      I have to do like the above image .please suggest me..
      thank you

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @kishore_hemmady http://doc.qt.io/qt-5/qlistwidgetitem.html#setToolTip

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      4
      • VRoninV Offline
        VRoninV Offline
        VRonin
        wrote on last edited by VRonin
        #3

        Requires Qt >= 5.11

        QObject::connect(listWidget->model(),&QAbstractItemModel::dataChanged,
            [=](const QModelIndex& topLeft,const QModelIndex& bottomRight, const QVector<int>& roles){
                if(!roles.isEmpty() && !roles.contains(Qt::DisplayRole)) 
                    return;
                for(int i=topLeft.row();i<=bottomRight.row();++i){
                    const QModelIndex tempIdx = listWidget->model()->index(i,0);
                    listWidget->model()->setData(tempIdx,tempIdx.data(Qt::DisplayRole),Qt::ToolTipRole);
                }
        });

        "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
        ~Napoleon Bonaparte

        On a crusade to banish setIndexWidget() from the holy land of Qt

        1 Reply Last reply
        3

        • Login

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