Results 1 to 8 of 8

Thread: alignment in listbox

  1. #1
    Join Date
    Jul 2010
    Posts
    17
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default alignment in listbox

    Hi friends,
    I m going to implement aligment in listbox.but der is no direct method do this.so how can i do,please anyone share some idea.
    thanks in advance
    Thanks
    sk

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: alignment in listbox

    Which version of Qt do you use? Do you mean a QListBox from Qt 3 which is a QListView now or do you talk about QCheckBox?

    For QListView/QListWidget see custom delegates in the documentation.

  3. #3
    Join Date
    Jul 2010
    Posts
    17
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Re: alignment in listbox

    Thanks for reply.here i m using QT 4.so here m making listbox by implementing QAbstractListModel .Here there is no alignment method.should i follow any other approach to acheive.
    Thanks
    sk

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: alignment in listbox

    If you use a listwidget, you have this option:
    http://doc.qt.nokia.com/4.6/qlistwid...tTextAlignment

  5. #5
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: alignment in listbox

    ...and in a not item based model it is Qt::TextAlignmentRole.

  6. #6
    Join Date
    Jul 2010
    Posts
    17
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Re: alignment in listbox

    Thanks for reply.let me go with ur suggestion.

  7. #7
    Join Date
    Jul 2010
    Posts
    17
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60 Maemo/MeeGo

    Default Re: alignment in listbox

    its sovled now thanks.but the prob is for limited items its ok.if there is huge items then for every item ,have to set the properties like alignment in QListWidgetItem.its tedious process.i think ,i m missing sth.So for this case,what should be.

  8. #8
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: alignment in listbox

    QListWidget is for small lists

    If you have hundreds of thousands of items, use a list view.

Similar Threads

  1. Replies: 0
    Last Post: 26th June 2010, 17:13
  2. Need Listbox with Columns - which component?
    By scintillion in forum Qt Programming
    Replies: 3
    Last Post: 8th April 2010, 04:44
  3. Listbox widget
    By awanish_jmi in forum Newbie
    Replies: 1
    Last Post: 25th July 2008, 05:41
  4. ListBox view
    By mithra in forum Newbie
    Replies: 6
    Last Post: 9th January 2007, 11:57
  5. Listbox Autoscroll is not happening?
    By mahe2310 in forum Qt Programming
    Replies: 4
    Last Post: 9th March 2006, 09:13

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.