Discussion Board

Results 1 to 7 of 7
  1. #1
    Nokia Developer Champion danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    I'd like to have two rows of text, in two different fonts, on a single button. How might one go about this?

  2. #2
    Nokia Developer Champion rahulvala's Avatar
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,293
    Quote Originally Posted by danhicksbyron View Post
    I'd like to have two rows of text, in two different fonts, on a single button. How might one go about this?
    For that first you need need to increase the size of button and then you have to enter after one line...

    try this...
    best regards,

  3. #3
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    I think QPushButton doesn't support rich text formatting.

  4. #4
    Nokia Developer Champion danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    Quote Originally Posted by divanov View Post
    I think QPushButton doesn't support rich text formatting.
    I didn't ask if it could be done, I asked how you could do it.

    One way I can think of is to create a blank button with the appropriate size and color, position above that one or two labels with the desired text, and then position over that a transparent button whose "pressed" signal is routed to the "clicked" slot on the "real" button.

    But that seems kind of convoluted.

  5. #5
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    I think the idea is to subclass QPushButton to enable rich text formatting in the button text like QLabel does.

  6. #6
    Nokia Developer Champion danhicksbyron's Avatar
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209
    Quote Originally Posted by divanov View Post
    I think the idea is to subclass QPushButton to enable rich text formatting in the button text like QLabel does.
    Yeah, if I had a hundred of them to do. I only have maybe ten total. (Even then it would be easier to write a subclass that does it the way I describe vs cracking the text-writing rewrite of paint.)

  7. #7
    Nokia Developer Moderator divanov's Avatar
    Join Date
    Oct 2009
    Posts
    4,326
    QMaemo5ValueButton does almost the same what you want, you can modify its implementation:
    http://qt.gitorious.org/+qt-develope...aluebutton.cpp

Similar Threads

  1. make textbox in canvas
    By mahdi68 in forum Mobile Java General
    Replies: 7
    Last Post: 2009-09-20, 11:46
  2. formatting text in a listbox
    By ajaykapur in forum Symbian User Interface
    Replies: 9
    Last Post: 2007-10-18, 17:43
  3. Writing chinese text on emulator
    By TheLittleBird in forum Symbian
    Replies: 1
    Last Post: 2007-06-15, 11:41
  4. Rendering text in multiple languages
    By TheLittleBird in forum Symbian C++
    Replies: 0
    Last Post: 2007-06-05, 12:52
  5. OK Button Disappears on clearing text
    By jainybhai in forum Symbian C++
    Replies: 0
    Last Post: 2005-12-19, 16:12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved