Results 1 to 2 of 2

Thread: How to make QListWidget items editable?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2012
    Posts
    15
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default How to make QListWidget items editable?

    hello
    I wanted to know 2 things:
    1) wich is the best way to make QListWidget items editable because I have no idea of where I should start doing it.
    2) how can i open a menu when I click with the right click of the mouse on a QListWWidget, even here I have no clou of where to start
    sorry if the question are too vague but I can't find anything to help me.
    thanks for the help

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to make QListWidget items editable?

    Quote Originally Posted by sax94 View Post
    1) wich is the best way to make QListWidget items editable because I have no idea of where I should start doing it.
    There is no "best" way, just any way that meets your requirements. QListWidgetItem::setFlags()
    2) how can i open a menu when I click with the right click of the mouse on a QListWWidget, even here I have no clou of where to start
    A combination of QWidget::setContextMenuPolicy() on the list widget (an item is not a widget) and some code to determine which item was under the cursor (QListWidget::itemAt()) when the menu was summoned seems like a good place to start. Text text edit demo contains a custom context menu.

Similar Threads

  1. Replies: 2
    Last Post: 1st April 2011, 09:32
  2. Replies: 4
    Last Post: 25th January 2010, 13:52
  3. How to make QListWidget items editable?
    By montylee in forum Qt Programming
    Replies: 14
    Last Post: 3rd October 2008, 09:57
  4. Replies: 2
    Last Post: 11th September 2007, 08:57
  5. Custom Listview with all-time editable items
    By ivan.cukic in forum Qt Programming
    Replies: 5
    Last Post: 6th September 2006, 15:15

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
  •  
Qt is a trademark of The Qt Company.