Results 1 to 3 of 3

Thread: making widget back from fullscreen

  1. #1
    Join Date
    Oct 2008
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Question making widget back from fullscreen

    Hi all, I have following problem.

    I have a widget (inherited QGraphicsView) that is somewhere inside central widget (in a groupbox with layout).
    I want to have a possibility showing it fullscreen and then back it to normal.

    Following code works great for going full screen:

    void QGraphicsInheritedClass::goFullScreen()
    {
    this->setWindowFlags(Qt::Window);
    this->setWindowState(Qt::WindowFullScreen);
    this->show();
    }

    but using following code for going back:

    void QGraphicsInheritedClass::goNormal()
    {
    this->setWindowState(Qt::WindowNoState);
    this->setWindowFlags(Qt::Widget);
    this->show();
    }

    destroys old geometries of parent widget (GroupBox is making bigger).
    I tried calling updateGeometry() but this doesnt solve that.
    Any idea how to solve that?

    edit: this is somehow related to zooming. When I dont zoom groupbox keeps it size.

    edit2: seems following code fixed my problem:

    void QGraphicsInheritedClass::goNormal()
    {
    this->setWindowState(Qt::WindowNoState);
    this->setWindowFlags(Qt::Widget);
    QGraphicsScene scene;
    QGraphicsScene * old = this->scene();
    this->setScene(&scene);
    this->show();
    this->setScene(old);
    }

    any better idea?
    Last edited by anoar; 21st September 2009 at 16:50.

  2. #2
    Join Date
    Dec 2008
    Location
    TaganrogNativelandChehov,Russia
    Posts
    64
    Thanks
    1
    Thanked 8 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: making widget back from fullscreen

    why not
    showNormal
    showFullScreen
    ?
    east or west home is best

  3. #3
    Join Date
    Oct 2008
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: making widget back from fullscreen

    because this widget was not a window

Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 07:06
  2. Drag widget example not making right
    By di_zou in forum Newbie
    Replies: 2
    Last Post: 16th September 2009, 11:14
  3. Validator: force keeping cursor back in widget
    By antarctic in forum Qt Programming
    Replies: 1
    Last Post: 8th June 2009, 14:15
  4. Resizing back the widget
    By gruszczy in forum Qt Programming
    Replies: 6
    Last Post: 23rd November 2008, 10:14
  5. Open FileDialog showing Back of the Widget in Mac
    By shyam prasad in forum Qt Programming
    Replies: 1
    Last Post: 19th April 2007, 06:33

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.