Results 1 to 3 of 3

Thread: Show delegate in treeview all the time regardless of EditTrigger mode

  1. #1
    Join Date
    Jul 2009
    Location
    Jordan, and UAE
    Posts
    55
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Show delegate in treeview all the time regardless of EditTrigger mode

    Hello Everyone,

    I've written a custom delegate and added it to a standard QTreeView, this delegate represents a push-button, and when its clicked it calls a slot to perform some operations

    its working ok, if item editing is enabled, after I double click on the item

    My question is how to make the button visible all the time (EVEN if I disable the editing of items), or I select another row, i would like the button to be visible on all the rows all the time, is that possible?

    Thanks very much for your help

  2. #2
    Join Date
    Jul 2009
    Location
    Jordan, and UAE
    Posts
    55
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Show delegate in treeview all the time regardless of EditTrigger mode

    Hello again,

    I'm able to show the button on all times, I've implemented the 2 virtual functions

    void paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
    QSize sizeHint ( const QStyleOptionViewItem & option, const QModelIndex & index ) const;
    but the button is not enabled till I double click on it, i.e. till its in the edition mode, how can I over come this, so it will be enabled anytime i click on it?

    Thanks very much

  3. #3
    Join Date
    Jul 2009
    Location
    Jordan, and UAE
    Posts
    55
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Show delegate in treeview all the time regardless of EditTrigger mode

    Hello everyone

    its Solved

    I just had to provide
    Qt Code:
    1. tableView.openPersistentEditor(index);
    To copy to clipboard, switch view to plain text mode 

    to the items where I want to button to show!


Similar Threads

  1. Replies: 1
    Last Post: 15th April 2009, 09:00

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.