Results 1 to 2 of 2

Thread: Want a preview(image) besides the cursor when it clicks on a QListWidgetItem in list

  1. #1
    Join Date
    Mar 2012
    Location
    India
    Posts
    102
    Thanks
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Want a preview(image) besides the cursor when it clicks on a QListWidgetItem in list

    Hi everybody,

    I have a QListWidget with four QListWidgetItems.
    I have implements a drag and drop on the list items from the list view
    to another graphics view. Now I want that whenever I click on one of the
    items in the list then along with the hand cursor a small preview like
    image should appear. The image source should be resources folder
    preferably. The feature is already there in the QtDesigner. Whenever we
    click on any widget name in the widget list on the left hand side, with
    the intension of dragging it to the form then a small preview of the
    widget appears on the right of the hand like cursor. I want the same.
    Please help.

    Thanks in advance.
    Charvi Mehta.

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Want a preview(image) besides the cursor when it clicks on a QListWidgetItem in l

    Use QListWidget::itemClicked() or similar signal to know when the item was activated.
    From that signal you get activated QListWidgetItem from which you can get ie path to your resources.
    Having that you can use QLabel to display the image and position it using QCursor:os().

    If you want to move the preview as the mouse moves, you'll need to implement mouseMoveEvent() and set mouse tracking to on.

Similar Threads

  1. Cursor image in qml
    By vinayaka in forum Qt Quick
    Replies: 1
    Last Post: 7th October 2011, 22:09
  2. Replies: 2
    Last Post: 20th December 2010, 18:51
  3. Replies: 3
    Last Post: 12th May 2010, 14:11
  4. Cursor is not moving through QTreeWidgetItem list in QTreeWidget
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 0
    Last Post: 11th December 2009, 07:52
  5. Image Drag without Cursor
    By keshab in forum Newbie
    Replies: 1
    Last Post: 20th December 2006, 04:26

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.