Results 1 to 6 of 6

Thread: QTreeView Alignment

Hybrid View

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

    Default Re: QTreeView Alignment

    Quote Originally Posted by wysota View Post
    Or you can do it on the model level - simply set appropriate values for Qt::TextAlignmentRole.
    Indeed, I forgot there was such role.

    Quote Originally Posted by cydside View Post
    Sorry wysota, where do i have to set the Qt::TextAlignmentRole in a QSqlTableModel?
    thanks
    Subclass QSqlTableModel and reimplement data() to return desired alignment for Qt::TextAlignmentRole, otherwise call base class implementation.
    J-P Nurmi

  2. #2
    Join Date
    Jun 2008
    Location
    Rome, Italy
    Posts
    95
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    19
    Thanked 2 Times in 2 Posts

    Default Re: QTreeView Alignment

    Thanks jpn and wysota your hints are very precious!

Similar Threads

  1. QTreeView repaint
    By graeme in forum Qt Programming
    Replies: 17
    Last Post: 13th March 2012, 14:27
  2. QDirModel and QTreeView cut and paste
    By Micawber in forum Qt Programming
    Replies: 4
    Last Post: 28th May 2008, 21:16
  3. QTreeView help
    By bepaald in forum Qt Programming
    Replies: 1
    Last Post: 15th August 2007, 22:22
  4. QTreeView: Holding a line on screen
    By gri in forum Qt Programming
    Replies: 1
    Last Post: 7th August 2007, 12:42
  5. background image in QTreeView
    By momesana in forum Qt Programming
    Replies: 2
    Last Post: 11th January 2007, 07:25

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.