Results 1 to 11 of 11

Thread: change Qtablewidget vertical header displayrole

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2013
    Posts
    54
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: change Qtablewidget vertical header displayrole

    It seems that you haven't understand me "if so, sorry my english i too bad"

    I'm using QtableWidget not Qtableview

    i want this sign(*) appears in verticalheader when the start editing or typing in one of cell

    also i want another icon shown when the user change selection of row (means when the user go from row1 to row2 or to row0)

    i hope this is clear for you

    thank's

  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: change Qtablewidget vertical header displayrole

    QTableWidget is a QTableView
    I am telling you how to change the text in the header. You still need to work out when to change it.

  3. #3
    Join Date
    Jul 2013
    Posts
    54
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: change Qtablewidget vertical header displayrole

    after reading Qtablewidget class i have gotted an idea and it works perfectly

    her is the code

    Qt Code:
    1. item->setIcon( *(new QIcon("imgs/editIcon.png")));
    2. tableau->setVerticalHeaderItem(row,item);
    To copy to clipboard, switch view to plain text mode 

    the only probleme is how i can catch when the user start editing cell or typing a text

    regards

  4. #4
    Join Date
    Jul 2013
    Posts
    54
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: change Qtablewidget vertical header displayrole

    You might need to use a QStyledItemDelegate on the table to signal when an editor is opened/close so that you can change the vertical header on that row.
    how i detect when the editor is opened ???

  5. #5
    Join Date
    Jul 2013
    Posts
    54
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: change Qtablewidget vertical header displayrole

    any body can help me

Similar Threads

  1. Change tableView vertical header
    By tinysoft in forum Newbie
    Replies: 1
    Last Post: 17th September 2011, 08:35
  2. Replies: 3
    Last Post: 20th January 2011, 13:24
  3. Vertical Header For QTreeView
    By wirasto in forum Qt-based Software
    Replies: 1
    Last Post: 12th October 2010, 05:53
  4. Replies: 2
    Last Post: 17th July 2010, 21:07
  5. Change QTableWidget header name or text
    By ricardo in forum Qt Programming
    Replies: 3
    Last Post: 14th May 2009, 11:37

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.