Adding Themes to a Qt program.
-
Okay, so I have a gradient background set on my Qt program. I use this code to set it.
@vlayout->addLayout(hlayout);
this->setLayout(vlayout);
QPalette thePalette = this->palette();
QLinearGradient gradient(0, 0, 0, 50);
gradient.setColorAt(0, QColor(0,0,0));
gradient.setColorAt(.25, QColor(60,255,0));gradient.setColorAt(1, Qt::white); QBrush brush(gradient); thePalette.setBrush(QPalette::Window, brush); setPalette(thePalette);@
I want to make a menu that is where like file, and view, and tools and stuff are on the top bar that says its name.(Not there on my program for some reason.?) I want to make it in the Edit menu you can select a theme and it automatically changes my code to fit that theme. But I have no idea how to do that.