[Qt-interest] problems changing application font when stylesheet is set

Sarvesh Saran Sarvesh.Saran at synopsys.com
Thu Jul 15 16:17:57 CEST 2010


Hi,

I have set my application style sheet:

//in main.cpp

QApplication a(argc, argv);

MyMainWindow w;

a.setStyleSheet("**here tree widget and group box is styled**");

//so far so good.

Now in my mainwindow ,  I have a font dialog to change the application's font size:

void MyMainWindow::on_action_Font_triggered()
{
QFont font = QFontDialog::getFont(
                 &ok, QFont(default_family,default_size), this);
    if(ok) {
        qApp->setFont(font);  //this statement seems to have no affect on the application..the font is not changed
}

I'm not sure how to change an applications font whose style sheet has been specified already..

Kindly help me out here.

Thanks,
Sarvesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100715/cebfc4d6/attachment.html 


More information about the Qt-interest-old mailing list