Results 1 to 5 of 5

Thread: How to align list items to the center?

  1. #1
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default How to align list items to the center?

    Hi,

    Is there any way to put the list items in the middle of the row that they exist?

    Regards

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to align list items to the center?

    see,
    for widgets
    void QListWidgetItem::setTextAlignment ( int alignment )
    void QTableWidgetItem::setTextAlignment ( int alignment )
    void QTreeWidgetItem::setTextAlignment ( int column, int alignment )
    for standard item model
    void QStandardItem::setTextAlignment ( Qt::Alignment alignment )
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

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

    Default Re: How to align list items to the center?

    See QListWidgetItem::setTextAlignment().

    PS. Please search the forums before asking questions. This question has been asked before.
    J-P Nurmi

  4. #4
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: How to align list items to the center?

    Hi,

    Sorry about the rules. But, I actually want to ask is there a way to do it from the designer? Thanks.

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

    Default Re: How to align list items to the center?

    Quote Originally Posted by zgulser View Post
    But, I actually want to ask is there a way to do it from the designer?
    In Qt Designer 4.5 there is.
    J-P Nurmi

Similar Threads

  1. Replies: 1
    Last Post: 15th January 2009, 10:34
  2. multiple selection of list view items
    By samirg in forum Qt Programming
    Replies: 2
    Last Post: 30th October 2007, 19:05
  3. Problem related to porting from QT3 to QT4 in list items
    By rohitjun in forum Qt Programming
    Replies: 5
    Last Post: 1st June 2007, 09:05
  4. Replies: 3
    Last Post: 10th April 2006, 19:04
  5. Q3listbox center items
    By sreedhar in forum Qt Programming
    Replies: 3
    Last Post: 24th February 2006, 11:21

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.