[SOLVED] Could not parse stylesheet of object 0x8046944
-
wrote on 26 Mar 2015, 09:14 last edited by rafael
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
-
wrote on 26 Mar 2015, 09:19 last edited by mcosta
@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()
-
wrote on 26 Mar 2015, 09:24 last edited by
thanks that removed the message but it doesn't seem to apply the changes.
this is what my file dialog looks like.
-
wrote on 26 Mar 2015, 09:29 last edited by
Which platform??
try to remove the style-sheet and pos a new image
-
wrote on 26 Mar 2015, 09:40 last edited by rafael
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.
-
wrote on 27 Mar 2015, 00:37 last edited by
Hi,
sorry I have no experience on QNX.
Could you please post your code? I don't think is relevant but try to remove the QFontDatabase part -
wrote on 27 Mar 2015, 08:35 last edited by
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. -
wrote on 27 Mar 2015, 08:56 last edited by
@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
-
wrote on 27 Mar 2015, 10:32 last edited by
how do i do that?
-
wrote on 27 Mar 2015, 10:34 last edited by mcosta
You should have a tool box with that option
mmmm, seems available only for admins!!
So you could add a prefix [SOLVED] to the title
8/10