Hmail01
17th July 2008, 22:11
Allright, I'll try it over here, because I get no response on the mailing list..
Anyway, I want to display some images from a sqlite database. Currently I'm doing the following, which works, but not as I want to:
QGraphicsScene *scene = new QGraphicsScene();
scene->addPixmap(QPixmap("/home/user/image/jpg"));
QGraphicsView *view = new QGraphicsView();
view->setBackgroundBrush(QBrush(Qt::black));
view->setScene(scene);
view->updateGeometry();
view->show();
view->showFullScreen();
About this, I have a couple of questions:
- Is this the right way to do? I have seen a lot of functions about displaying images, but I'm not sure which one to use.
- How do I scale the image, so that, when the image is too large for the screen, it will be resized?
- Currently, I get borders around the window. I tried setting flags with view->setWindowFlags(Qt::FramelessWindowHint), but that only removes the titlebar when I remove the view->showFullScreen().
I'm using Qt 4.4.0, by the way.
Thanks in advance!
Anyway, I want to display some images from a sqlite database. Currently I'm doing the following, which works, but not as I want to:
QGraphicsScene *scene = new QGraphicsScene();
scene->addPixmap(QPixmap("/home/user/image/jpg"));
QGraphicsView *view = new QGraphicsView();
view->setBackgroundBrush(QBrush(Qt::black));
view->setScene(scene);
view->updateGeometry();
view->show();
view->showFullScreen();
About this, I have a couple of questions:
- Is this the right way to do? I have seen a lot of functions about displaying images, but I'm not sure which one to use.
- How do I scale the image, so that, when the image is too large for the screen, it will be resized?
- Currently, I get borders around the window. I tried setting flags with view->setWindowFlags(Qt::FramelessWindowHint), but that only removes the titlebar when I remove the view->showFullScreen().
I'm using Qt 4.4.0, by the way.
Thanks in advance!