Gavin Harper
10th April 2011, 12:36
I am using a QGraphicsScene to implement a mobile Splash Screen and I would like to use a dark background. The issue is that I cannot seem to change the font to anything but black.
This is my main():
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MediaLibrary mLib;
// Splash Screen
QGraphicsScene scene;
QLinearGradient lGrad(QPointF(100, 100), QPointF(200, 200));
lGrad.setColorAt(0, Qt::black);
lGrad.setColorAt(1, Qt::darkBlue);
scene.setBackgroundBrush(lGrad);
scene.addText("Media Library", QFont("Times", 30));
QGraphicsView view(&scene);
view.show();
QTimer::singleShot(2000, &view, SLOT(close()));
QTimer::singleShot(2000, &mLib, SLOT(show()));
return app.exec();
}
What would be the best practise for changing the font colour?
Thank you
This is my main():
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
MediaLibrary mLib;
// Splash Screen
QGraphicsScene scene;
QLinearGradient lGrad(QPointF(100, 100), QPointF(200, 200));
lGrad.setColorAt(0, Qt::black);
lGrad.setColorAt(1, Qt::darkBlue);
scene.setBackgroundBrush(lGrad);
scene.addText("Media Library", QFont("Times", 30));
QGraphicsView view(&scene);
view.show();
QTimer::singleShot(2000, &view, SLOT(close()));
QTimer::singleShot(2000, &mLib, SLOT(show()));
return app.exec();
}
What would be the best practise for changing the font colour?
Thank you