4 Attachment(s)
Setting style sheet of ui in main window class from dialog class
I want to set style sheet of ui in main window class form a dilog class which opens another ui.
Here is my sample code
Attachment 9920Attachment 9921Attachment 9922Attachment 9923
Re: Setting style sheet of ui in main window class from dialog class
You don't say what your problem is, so I am guessing: move the signal/slot connect before the call to exec()
Code:
Dialog *d = new Dialog;
connect(d,
SIGNAL(update
(QString)),
this,
SLOT(Set_style_Sheet
(QString)));
d->exec();
Btw, creating a dialog with new and not deleting it results in memory loss.
Cheers,
_
Re: Setting style sheet of ui in main window class from dialog class
My problem was that i was unable to change the color form the dialog class, thanks your suggestion helped me, now i want that the changed style sheet to be loaded next time when i execute program can you suggest me a way to do so
Re: Setting style sheet of ui in main window class from dialog class
Save it on change or program exit and load and apply on program startup?
Using QSettings maybe?
Cheers,
_
Re: Setting style sheet of ui in main window class from dialog class
I want to save it on change and the new setting to be reflected at the same time also when the program is reloaded it should run with the changed setting
Re: Setting style sheet of ui in main window class from dialog class
Then you save it on change and load it on startup.
You can do the saving in the Set_style_Sheet slot. You can do the loading in the window's constructor.
Cheers,
_