PDA

View Full Version : setStyleSheet



CodeFreak
11th August 2018, 19:10
Hi,
if I want to set a font-family:

setStyleSheet("QLineEdit { font-family: "Times New Roman"; font-size: 14px; height: 120px; width: 30px; }");
Double quotations which inserted to define font-family, cause problem.
I know that if I exchange them to single quotation code will be executed well.
But is there anyway to define all stylesheet codes in a block and call them as needed, or any alternative solution?
I'm beginner.

d_stranz
13th August 2018, 16:29
It's basic C / C++: if you want to insert quotation marks into a string literal, you have to escape them "\"".