Well the GL Background isn't it:
#include <QtGui>
#include <QGLWidget>
{
protected:
{
glClearColor(1.0,0.0,0.0,1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
};
int main(int argc, char **argv){
CGLScene scene;
view.setScene(&scene);
f.setPointSize(36);
item->setFont(f);
QTransform trans;
trans.rotate(60, Qt::YAxis);
item->setTransform(trans);
item->setOpacity(0.7);
view.show();
return app.exec();
}
#include <QtGui>
#include <QGLWidget>
class CGLScene : public QGraphicsScene
{
protected:
void drawBackground(QPainter *painter, const QRectF &rect)
{
glClearColor(1.0,0.0,0.0,1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
};
int main(int argc, char **argv){
QApplication app(argc, argv);
QGraphicsView view;
CGLScene scene;
view.setScene(&scene);
view.setViewport(new QGLWidget);
QString txt = "Some text";
QGraphicsTextItem *item = scene.addText(txt);
QFont f;
f.setPointSize(36);
item->setFont(f);
item->setFlag(QGraphicsItem::ItemIsMovable);
item->setCacheMode(QGraphicsItem::ItemCoordinateCache);
QTransform trans;
trans.rotate(60, Qt::YAxis);
item->setTransform(trans);
item->setOpacity(0.7);
view.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Problem is, introducing the perspective would blow this up a lot. We would need the camera, the projecteditem etc.. I could integrate the TextItem into the ProjectionDemo I did some time ago.. But than it would be a lot of code for you to read..
Bookmarks