qDebug("Resize event ... ");
qDebug("Width: %d, Height: %d", sz.width(), sz.height());
if ( m_renderer
->elementExists
( QString ( "background" ) ) ) { qDebug ( "Rendering" );
} else {
qDebug ( "No background found" );
}
qDebug("Width: %d, Height: %d", hint.width(), hint.height());
QBrush br
( bg.
scaled(hint, Qt
::IgnoreAspectRatio, Qt
::SmoothTransformation) );
m_scene->setBackgroundBrush ( br );
}
void kMancalaBoard::resizeEvent ( QResizeEvent *event ) {
qDebug("Resize event ... ");
QSize sz(400, 300);
qDebug("Width: %d, Height: %d", sz.width(), sz.height());
QPixmap bg ( QSize(400, 200) );
QPainter bgPainter ( &bg );
if ( m_renderer->elementExists ( QString ( "background" ) ) ) {
qDebug ( "Rendering" );
m_renderer->render ( &bgPainter, QString ( "background" ), QRectF ( QPointF ( 0,0 ), sz ) );
} else {
qDebug ( "No background found" );
}
QSize hint = size();
qDebug("Width: %d, Height: %d", hint.width(), hint.height());
QBrush br ( bg.scaled(hint, Qt::IgnoreAspectRatio, Qt::SmoothTransformation) );
m_scene->setBackgroundBrush ( br );
QGraphicsView::resizeEvent ( event );
}
To copy to clipboard, switch view to plain text mode
Bookmarks