×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Jun 2009
    Posts
    37

    How to set 2 styles for Button text and button description in QT

    hi All,
    I need to set two styles (2 different colors and font sizes) on Qt QCommandLinkButton.
    pls tell me if any one know the solution for this issue.

    thankz
    ~wishwa.

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to set 2 styles for Button text and button description in QT

    Do you mean you want text and description in different colors?

  3. #3
    Registered User
    Join Date
    Jun 2009
    Posts
    37

    Re: How to set 2 styles for Button text and button description in QT

    yes...
    I need text and description in different colors and two sizes.

    ~wishwa

  4. #4
    Registered User
    Join Date
    Jun 2009
    Posts
    37

    Re: How to set 2 styles for Button text and button description in QT

    hi Daniil,
    When I tried with text and description on QT creator shows 2 different sizes but when I install it in to N900 it will show as same font size.

    thanks
    ~Wishwa

  5. #5
    Registered User
    Join Date
    Jun 2009
    Posts
    37

    Re: How to set 2 styles for Button text and button description in QT

    hi All,
    If any one can help me on this....

    cheers
    ~wishwa

  6. #6
    Nokia Developer Champion
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: How to set 2 styles for Button text and button description in QT

    We've handled this by overlaying labels over the button & putting the text in the labels. Then you overlay a transparent button over the labels and link it's signal to the original button.

    Ugly, but it works.

  7. #7
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to set 2 styles for Button text and button description in QT

    Unfortunately the font size is hardcoded.
    http://qt.gitorious.org/+qt-develope...on.cpp#line138
    You can subclass QCommandLinkButton and reimplement paintEvent().
    With icon it's a bit easier as you can use QAbstractButton::setIcon()
    http://doc.trolltech.com/4.6/qabstra...html#icon-prop

  8. #8
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: How to set 2 styles for Button text and button description in QT


  9. #9
    Registered User
    Join Date
    Jun 2009
    Posts
    37

    Re: How to set 2 styles for Button text and button description in QT

    hi Daniil,
    thanks for ur kind help...
    i ll refer ur example and try to over come my problem
    thanks
    ~Wishwa

Similar Threads

  1. [moved] Q: How to change toolbar button text
    By bartbiemond in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-10-22, 14:37
  2. Replies: 0
    Last Post: 2009-04-20, 07:21
  3. Replies: 0
    Last Post: 2004-11-24, 18:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •