Results 1 to 3 of 3

Thread: decoration position and alignment

  1. #1
    Join Date
    Jun 2011
    Posts
    56
    Thanks
    7
    Qt products
    Qt4

    Default decoration position and alignment

    QStyleOptionViewItem has 2 members:

    Qt::Alignment decorationAlignment
    Position decorationPosition

    but setting them does not seem to produce any results. Have you ever played with them?

  2. #2
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: decoration position and alignment

    Which value are you setting in Qt::Alignment. The default value is Qt::AlignLeft.

    Could you please send your code so that we can figure out that what is the problem?

  3. #3
    Join Date
    Jun 2011
    Posts
    56
    Thanks
    7
    Qt products
    Qt4

    Default Re: decoration position and alignment

    The problem is setting
    Qt Code:
    1. option.decorationAlignment = style.decorationAlign;
    2. option.decorationPosition = style.decorationPosition;
    To copy to clipboard, switch view to plain text mode 
    inside
    Qt Code:
    1. void MyDelegate::paint(QPainter* painter,
    2. QStyleOptionViewItem const& option, QModelIndex const& index) const
    To copy to clipboard, switch view to plain text mode 
    produces no results.

Similar Threads

  1. Line Decoration in QListView
    By fruzzo in forum Qt Programming
    Replies: 2
    Last Post: 15th September 2011, 15:56
  2. Custom Window Decoration?
    By BadKnees in forum Qt Programming
    Replies: 5
    Last Post: 28th April 2011, 19:49
  3. QTreeView decoration events
    By xwhatsit in forum Qt Programming
    Replies: 0
    Last Post: 10th September 2010, 09:10
  4. QTreeWidgetItem decoration
    By ^NyAw^ in forum Qt Programming
    Replies: 6
    Last Post: 27th October 2009, 16:01
  5. Mdi Window decoration
    By kalpa in forum Qt Programming
    Replies: 1
    Last Post: 7th May 2007, 10:19

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.