[SOLVED] Could not parse stylesheet of object 0x8046944
-
how do i change the fonts of a qfiledialog? All the letters on my machine are really small.
i added this in the constructor of my main window.
'QFontDatabase fontDB;
fontDB.addApplicationFont(":/qt/lib/fonts/DejaVuSans.ttf");'i call this function when i click a button to open a file dialog box.
' QFileDialog fd;
fd.setStyleSheet("* {font-family: DejaVuSans;font-style: normal;font-size: 120pt;font-weight: bold;};");QString directory = fd.getExistingDirectory(this, tr("Find Files"), QDir::currentPath()); if (!directory.isEmpty()) { if (ui->lineEdit->text() == "-1") { } }'
i get a message saying Could not parse stylesheet of object 0x8046944
-
@rafael said:
"* {font-family: DejaVuSans;font-style: normal;font-size: 120pt;font-weight: bold;};"
Remove the last semicolon
fd.setStyleSheet("* {font-family: DejaVuSans;font-style: normal;font-size: 120pt;font-weight: bold;}");
BTW, of you need only to change the Font you can use
QWidget::setFont()
-
thanks that removed the message but it doesn't seem to apply the changes.
this is what my file dialog looks like.
-
i am running qnx6.6.0 on virtual box
i have a windows hostthat is my main window i managed to modify the text box and button
the button calls a filedialog box
i have tried with and without the stylesheet i get the same result.
-
@rafael said:
thanks the problem has been resolved.
style sheets have been applied correctly i just couldn't see it because i was using the wrong settings.
I entered the screen resolution instead of physical dimensions when i was configuring my setup.Ok,
in that case I suggest to mark the post as SOLVED