humm ... i don't think i explained myself well.
Imagine this situation:
#include <QApplication>
#include "Dialog_1.h"
#include "Dialog_2.h"
int main(int argc, char *argv[]){
//apply stylesheet at application level
app.setStyleSheet("QLineEdit { background-color: red }");
Dialog_1 *dialog1 = new Dialog_1;
Dialog_2 *dialog2 = new Dialog_2;
dialog1->show();
dialog2->show();
return app.exec();
}
#include <QApplication>
#include "Dialog_1.h"
#include "Dialog_2.h"
int main(int argc, char *argv[]){
QApplication app(argc, argv);
//apply stylesheet at application level
app.setStyleSheet("QLineEdit { background-color: red }");
Dialog_1 *dialog1 = new Dialog_1;
Dialog_2 *dialog2 = new Dialog_2;
dialog1->show();
dialog2->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Both dialogs will show the color red on all lineedits, right?
Now imagine that dialog 2 is meant to be an exception, and i can not edit main.cpp.
Where in the .h, .ui or .cpp do i apply the overriding stylesheet?
Hope this makes any sense
Bookmarks