Hi,
I have qtembedded 4.4.1. My physical tft size is 800 x 480. I am creating a QGraphicsScene with a background and images ontop of it, no window borders. My background picture image .jpg is 800x480. When I display the background image the window is resized to 796 * 476. So what I see is a very small outline around my picture ( 4 pixel width around). I will try to make the code brief. Here is what I am doing.
mainwindow class
class MainWindow : public QGraphicsView [...]
MainWindow::MainWindow(void)
setFixedSize(800,480);
setWindowFlags(Qt::FramelessWindowHint);
[...]
void MainWindow::drawBackground(QPainter *painter, const QRectF &rect)
{
qDebug() << "exposed rect" << rect;
QImage image = QImage("images/mainbackground.jpg");
painter->drawImage(rect,image);
}
void MainWindow::resizeEvent(QResizeEvent *event)
{
QGraphicsView::resizeEvent(event);
fitInView(mainWindowScene->sceneRect(), Qt::KeepAspectRatio);
qDebug() << "newsize" << event->size();
qDebug() << "oldsize" << event->oldSize();
}
My debugging shows this.. So, the qgraphicsview object is resizing the background when it is displayed. I don't know why it is doing this.
newsize QSize(796, 460)
oldsize QSize(-1, -1)
newsize QSize(796, 476)
oldsize QSize(796, 460)
Bookmarks