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
dialog.cppdialog.hmainwindow.cppmainwindow.h
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
dialog.cppdialog.hmainwindow.cppmainwindow.h
You don't say what your problem is, so I am guessing: move the signal/slot connect before the call to exec()
Qt Code:
Dialog *d = new Dialog; d->exec();To copy to clipboard, switch view to plain text mode
Btw, creating a dialog with new and not deleting it results in memory loss.
Cheers,
_
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
Save it on change or program exit and load and apply on program startup?
Using QSettings maybe?
Cheers,
_
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
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,
_
Bookmarks