Results 1 to 3 of 3

Thread: QAbstractButton::setIcon | Icon posiition

  1. #1
    Join Date
    Feb 2010
    Posts
    61
    Thanks
    18
    Qt products
    Qt4
    Platforms
    MacOS X

    Default QAbstractButton::setIcon | Icon posiition

    Hi,

    is there a way to place an icon in the right side of the text within a button ? If so how ?

    QAbstractButton::setIcon places an icon in the left side of the text and so far I haven't found any flag or setting to change that

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QAbstractButton::setIcon | Icon posiition

    You might try button->setLayoutDirection(Qt::RightToLeft). This is meant to change the layout direction when different languages are used, so employing it this way seems like a bit of a misuse, if it works at all.

  3. #3
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QAbstractButton::setIcon | Icon posiition

    It may also be possible - and more sane - to do this using style sheets. I'm not certain what the specific incantation would be, but this seems like a better bet than fiddling around with layout direction, which can be overridden by the UI style anyway.

Similar Threads

  1. Replies: 1
    Last Post: 3rd May 2010, 17:31
  2. Couple of questions: main window icon + toolbar icon
    By bpackard in forum Qt Programming
    Replies: 0
    Last Post: 20th March 2008, 19:03
  3. Best Practice - delete pointer QAbstractButton in QMessageBox
    By estanisgeyer in forum Qt Programming
    Replies: 1
    Last Post: 12th March 2008, 12:43
  4. QTreeWidget Crashing while setText,setFont,setIcon
    By santosh.kumar in forum Qt Programming
    Replies: 3
    Last Post: 19th February 2008, 11:36
  5. setIcon() - different QIcon states?
    By AaronMK in forum Qt Programming
    Replies: 1
    Last Post: 29th January 2008, 03:10

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.