Results 1 to 2 of 2

Thread: How to use openPersistentEditor(...) properly?

  1. #1
    Join Date
    Mar 2010
    Posts
    36
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default How to use openPersistentEditor(...) properly?

    Hi there

    In my app I created a Table which uses custom table view, table model and delegate.
    In one of the columns of the table should be shown a button. I managed to set is as editor in my delegate.
    But now I'd like to have the button always shown in the table.
    I tried with openPersistentEditor(...) in the view. But I don't know how to use it properly.
    Where and how should I call it.

    Thanks for your help!
    Cheers
    Using Qt 4.7
    Developping on Win 7 and XP
    Using Qt Creator, Eclipse and Visual Studio
    Target Platforms Win, Linux and soon OS X

  2. #2
    Join Date
    Mar 2010
    Posts
    36
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to use openPersistentEditor(...) properly?

    So I found a solution.

    I created a slot in the table view in which I call the function openPersistentEditor(...) for every row:
    Qt Code:
    1. void TableView::makeButtonsPersistentEditors()
    2. {
    3. for (int i=0; i<model()->rowCount(); i++) {
    4. openPersistentEditor(model()->index(i, _filtersColumn, QModelIndex()));
    5. }
    6. }
    To copy to clipboard, switch view to plain text mode 

    The slot is connected with the modelReset() signal of the table model.

    Cheers woodtluk
    Using Qt 4.7
    Developping on Win 7 and XP
    Using Qt Creator, Eclipse and Visual Studio
    Target Platforms Win, Linux and soon OS X

Similar Threads

  1. How to properly install QCA on Mac OS?
    By unix7777 in forum Newbie
    Replies: 1
    Last Post: 2nd September 2010, 00:20
  2. How to install Qxt properly?
    By blurboy in forum Newbie
    Replies: 3
    Last Post: 18th October 2009, 20:12
  3. How to properly delete structures?
    By aarelovich in forum General Programming
    Replies: 5
    Last Post: 24th February 2009, 00:39
  4. openPersistentEditor() -- how should it be used?
    By fpeelo in forum Qt Programming
    Replies: 4
    Last Post: 12th January 2008, 23:50
  5. How do I use QTcpSocket properly ?
    By mnemonic_fx in forum Qt Programming
    Replies: 13
    Last Post: 29th March 2007, 20:33

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.