Results 1 to 7 of 7

Thread: QTableWidget::editItem -- how to get pointer to the editor?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2007
    Location
    Toruń, POLAND
    Posts
    24
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QTableWidget::editItem -- how to get pointer to the editor?

    Quote Originally Posted by marcel View Post
    It is not identical. You will still have to call editItem to start editing. But you will also have a pointer to the editor.

    To see how the default editor is created you can look in the sources and create it like just they do.

    Regards
    I hesitate to use such code -- porting really tiny app from Qt3 to Qt4 is an ordeal (imho) and it is still not finished. I am afraid that by using such "hacks" as duplicating Qt source I am at even greater risk when I will port app from Qt4 to Qt5. So what I need is a "legit" way to get the table<->editor connection.

    But don't get me wrong -- I appreciate your help! Thank you.

    have a nice day, bye

    PS. I think I will manage to do it manually -- after creating a delegate in table I can add some method to set which table it is, so delegate will know about table. So when createEditor is called I could pass an extra parameter for this editor, or notify table about the editor.
    Ugly, but since there is no nice method in Qt....
    Last edited by macias; 22nd June 2007 at 22:09.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget::editItem -- how to get pointer to the editor?

    I hesitate to use such code -- porting really tiny app from Qt3 to Qt4 is an ordeal (imho) and it is still not finished. I am afraid that by using such "hacks" as duplicating Qt source I am at even greater risk when I will port app from Qt4 to Qt5. So what I need is a "legit" way to get the table<->editor connection.
    Have it your way, but this is not a hack since it uses the interface provided by Qt.
    I suggested to create the editor as in the Qt sources because you needed something like the default editor.

    So, the bottom line is that this is not a hack. It just means you adapt to the new changes, even if it means making more and unexpected modifications.

    Regards

  3. #3
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTableWidget::editItem -- how to get pointer to the editor?


    PS. I think I will manage to do it manually -- after creating a delegate in table I can add some method to set which table it is, so delegate will know about table. So when createEditor is called I could pass an extra parameter for this editor, or notify table about the editor.
    Ugly, but since there is no nice method in Qt....
    This is a hack.

Similar Threads

  1. Model/View: Custom Persistent Editor
    By No-Nonsense in forum Qt Programming
    Replies: 2
    Last Post: 7th February 2007, 14:55

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.