Re: Problem to setstylesheet
Are you ensuring that you are reading the file in as one long string before trying to set it? Normally the default.qss is blank so it probably would work in any case.
Example extracted from ref: http://doc.trolltech.com/4.3/widgets...ditor-cpp.html
Code:
void StyleSheetEditor
::loadStyleSheet(const QString &sheetName
) {
QFile file(":/qss/" + sheetName.
toLower() + ".qss");
file.
open(QFile::ReadOnly);
ui.styleTextEdit->setPlainText(styleSheet);
qApp->setStyleSheet(styleSheet);
ui.applyButton->setEnabled(false);
}
If you are using the qss from the resource (rcc), it might be helpful to ensure that you resource init it in your main as well ( Q_INIT_RESOURCE(resource name); ).
Just a couple of things that come to mind.
Re: Problem to setstylesheet
Quote:
Originally Posted by
Junior
Are you ensuring that you are reading the file in as one long string before trying to set it? Normally the default.qss is blank so it probably would work in any case.
Example extracted from ref:
http://doc.trolltech.com/4.3/widgets...ditor-cpp.html
Code:
void StyleSheetEditor
::loadStyleSheet(const QString &sheetName
) {
QFile file(":/qss/" + sheetName.
toLower() + ".qss");
file.
open(QFile::ReadOnly);
ui.styleTextEdit->setPlainText(styleSheet);
qApp->setStyleSheet(styleSheet);
ui.applyButton->setEnabled(false);
}
If you are using the qss from the resource (rcc), it might be helpful to ensure that you resource init it in your main as well ( Q_INIT_RESOURCE(
resource name); ).
Just a couple of things that come to mind.
I think Q_INIT_RESOURCE is not so necessary. i ve posted a query in forumand got replied. Its also working.
Re: Problem to setstylesheet
Hi All.
I m still facing same problem.
I ve a doubt. can i paint a specific area like follow.
pointer->LoadStyleSheet("pagefold.qss");
// Is it possible?
ui.m_specificArea ->setStyleSheet("QWidget#specificArea {background-color: blue}");
I ll thankful if any body let meknow.