Results 1 to 4 of 4

Thread: setColumnAlignment QTreeWidget

  1. #1
    Join Date
    Jul 2006
    Posts
    37
    Thanks
    6
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Question setColumnAlignment QTreeWidget

    Hi All,

    Do you know how to align items in colums inside a QTreeWidget

    in Qt 3, with QListView there was setColumnAlignment(int, int) ;

    what is the corresponding feature in Qt 4.3 ?

    Thanks,

    David

  2. #2
    Join Date
    Oct 2007
    Location
    Munich, Bavaria
    Posts
    144
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setColumnAlignment QTreeWidget

    You can do this by calling:
    void QTreeWidgetItem::setTextAlignment ( int column, int alignment )

    Good luck,

    Tom

  3. #3
    Join Date
    Jul 2006
    Posts
    37
    Thanks
    6
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: setColumnAlignment QTreeWidget

    Ok, but when you got many items like (i.e: 10000) and I want to set column alignment only for 1 colum; it means I have to loop through all QTreeWidgetItem and to set the column alignment

    it will consume lot of time ...

    Not something else more lighter ....

    Thanks


    David

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: setColumnAlignment QTreeWidget

    You could of course set the alignment while creating those items unless you want to adjust it at runtime. This is one of those limitations or problems you face with item based convenience views. With model based approach it would be fairly simple..
    J-P Nurmi

Similar Threads

  1. QTreeWidget click
    By ^NyAw^ in forum Qt Programming
    Replies: 3
    Last Post: 24th October 2007, 16:47
  2. Having trouble clearing a QTreeWidget.
    By Nyphel in forum Qt Programming
    Replies: 28
    Last Post: 10th October 2007, 15:33
  3. how to add icons to QTreeWidget?
    By wei243 in forum Qt Programming
    Replies: 4
    Last Post: 21st September 2007, 08:34
  4. resizing a QTreeWidget
    By drhex in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2006, 22:32
  5. few questions related to QTreeWidget
    By prakash in forum Qt Programming
    Replies: 9
    Last Post: 10th March 2006, 07:32

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.