Results 1 to 5 of 5

Thread: How get max size text in a QPushButton (Qt embedded linux 4.3.0)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2011
    Posts
    13
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default How get max size text in a QPushButton (Qt embedded linux 4.3.0)

    Hello!

    I'm trying to put a 200px text in a QPushButton, in Ubuntu X11 there isn't problem but when i crooscompile to linux embedded text is small. I'm using Qt 4.3.0.

    Anyone know how to solve the problem?

    I have tryied 2 ways, with next code, but not working :

    way 1:

    QPushButton temperature;
    Qt Code:
    1. temperature.setFlat(true);
    2. temperature.setText("300 degrees");
    3. temperature.setMaximumSize(QSize(291, 16777215));
    4. temperature.setStyleSheet("border: 0; background-color: transparent; font: 200px; font-family: Ubuntu");
    To copy to clipboard, switch view to plain text mode 

    way 2:
    Qt Code:
    1. QFont font;
    2. font.setFamily(QString::fromUtf8("Ubuntu"));
    3. font.setPointSize(200);
    4. font.setBold(true);
    5.  
    6. QPushButton temperature;
    7. temperature.setFlat(true);
    8. temperature.setText("300 degrees");
    9. temperature.setMaximumSize(QSize(291, 16777215));
    10. temperature.setFont(font);
    To copy to clipboard, switch view to plain text mode 
    Last edited by high_flyer; 26th July 2011 at 11:31. Reason: code tags

Similar Threads

  1. difference between source in Qt for X11/Linux Qt for Embedded Linux
    By sanjeet in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 7th June 2011, 02:58
  2. Replies: 0
    Last Post: 8th November 2010, 21:17
  3. Caching of QPushButton embedded in QGraphicsScene
    By matthias_ in forum Qt Programming
    Replies: 3
    Last Post: 1st October 2010, 19:31
  4. Multiple apps using Qt/Embedded+Qtopia on Embedded Linux
    By drahardja in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 17th February 2008, 21:46

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.