Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23

Thread: problem with Font changing

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: problem with Font changing

    Quote Originally Posted by aamer4yu View Post
    Why dont u just set the stylesheet to the label u want ??

    my_label->setStyleSheet("font:Arial ; font-size: 12px");
    Thanx aamer. I tried like so, still same problem.
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  2. #2
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: problem with Font changing

    Hi All
    Now the font is changed. I did like below
    ui.m_label->setStyleSheet("QLabel#m_label1 {background-color: white;"
    "color : black; border: 2px solid black;"
    "font:Arial ; font-size: 20px}");

    But the problem is that two images are coming. one in default font and another in Arial font. So the text is not visible properly. What ll i do to solve this?
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  3. #3
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: problem with Font changing

    try with


    ui.setupUi(this);
    QString styleSheet = "QLabel{font: bold italic "Arial"; font-size:16}";
    ui.centralwidget->setStyleSheet(styleSheet);

    and you can also paste QLabel{font: bold italic "Arial"; font-size:16} in qt designer (styleSheet property of main widget) - tested it, works.

    Try to use styleSheet as is and if it will work adjust it to you need - then you'll be sure that problem is with approach or with stylesheet itself.
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

Similar Threads

  1. Replies: 1
    Last Post: 25th December 2007, 10:35
  2. QMainWindow: problem changing centralWidget
    By Caius Aérobus in forum Qt Programming
    Replies: 6
    Last Post: 4th October 2007, 13:00
  3. changing QLabel font size(label created on the graphicsView)
    By maverick_pol in forum Qt Programming
    Replies: 11
    Last Post: 17th August 2007, 08:36
  4. Font Problem Porting from Windows to Linux
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 13th July 2007, 10:25
  5. Font Problem
    By prakash in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2006, 16:53

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.