PDA

View Full Version : showFullScreen minimizes my window.



wagmare
13th September 2012, 07:27
Hi friends,

im showing a QGraphicsView in full screen mode using
showFullScreen

like this ,,


int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Widget w;
w.show();
w.showFullScreen();
return a.exec();
}

the window is appearing in full sceen but minimized at first time when i start it for the first time ... when i start the application it is in the panel minimized and not poping up ..
im using resize event in the GraphicsView ...

Please help me ... thanks in advance ..

ChrisW67
13th September 2012, 08:47
You are using resizeEvent() to do what?

wagmare
13th September 2012, 11:58
You are using resizeEvent() to do what?

sorry .. i thought of mentioning it with .. yes im using resize event in graphicsView


QGraphicsView::resizeEvent(event);
fitInView(scene()->sceneRect(), Qt::KeepAspectRatio);


AND thanks for reply !!

ChrisW67
13th September 2012, 22:21
... and are you passing the event to the parent class so that normal resizing can be completed? One line in isolation is insufficient for us to know.

wagmare
14th September 2012, 07:19
Thanks for the reply!!


... and are you passing the event to the parent class so that normal resizing can be completed? One line in isolation is insufficient for us to know.

no im not doing any thing other than that .. the graphicsView is my arch parent and im reimplementing the resize Event like this only ..
im showing this GraphicsView widget only ...


void
Widget::resizeEvent(QResizeEvent *event)
{
QGraphicsView::resizeEvent(event);
fitInView(scene()->sceneRect(), Qt::KeepAspectRatio);

}

if u want more in the code

my scene representation ...

QGraphicsScene *scene = new QGraphicsScene(this);
scene->setBackgroundBrush(QColor(80, 18, 60));
scene->setItemIndexMethod(QGraphicsScene::NoIndex);
scene->addItem(startButton);

scene->setSceneRect(QRectF(0, 0, 1200, 1000) );

my view settings ..

setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff) ;
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOf f);
setMinimumSize(50, 50);
setViewportUpdateMode(FullViewportUpdate);
setCacheMode(CacheBackground);
setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing);


more than that it crashed when i try to use showFullScreen() function in the graphicsView constructor itself!!