Results 1 to 5 of 5

Thread: Odd behaviour with showFullScreen

  1. #1
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Post Odd behaviour with showFullScreen

    I've got a widget that gets displayed by calling QWidget->showFullScreen(). This works fine for this widget, it takes up the whole screen and has no border. I then have another widget that calls the same... the new widget is borderless (which is proper), but only takes up a small portion of the screen and I can see the previous widget under the new widget.

    The layout for the new widget should tell it to expand to fill up the screen, but this appears to be failing. I then have yet another widget that tries to go full-screen on top of the previous widgets, and that suffers the same symptoms. Is there a limit to telling widgets to go full-screen?

    I'm writing an app that is supposed to really be the only application a machine will run, under an ultra-simple window manager (or perhaps directly under X).

    I'm using Qt 4.2.3 under X11R7
    Life without passion is death in disguise

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Odd behaviour with showFullScreen

    Could we see some code?

  3. #3
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Odd behaviour with showFullScreen

    Quote Originally Posted by wysota View Post
    Could we see some code?
    Sure. Sorry it's been a while, I've been squashing more important bugs in the mean-time.

    First, I took a couple of snapshots showing what's going on. The first shows the full-screen app (pretty simple menu with push-buttons), the second shows what happens when you put a full-screen widget on top of a full-screen widget. Any way around this?

    The code is pretty simple. What I'm doing is I have a "menu plugin" that gets loaded which carries a QWidget-based class (some are inheritted from QGLWidget, some from just QWidget). I then call the menu's showFullScreen() function. The code for this section:
    Qt Code:
    1. evilcpcMenu * m = lPluginMenu[0];
    2. QWidget * menu = m->getWidget();
    3. ...
    4. // ... lots of stuff where things are being generated and connected
    5. if(!m->addItems(mis))
    6. { // This section adds items to the menu. Seems to work fine
    7. qDebug("%s:%s(%d) - Failed to add a menu item to menu '%s': %s", __FILE__, __FUNCTION__, __LINE__ - 2, lPluginMenu[0]->getName().toAscii().constData(), m->errorString().toAscii().constData());
    8. }
    9. ...
    10. // Connecting all plugins signals to all plugins slots via mneumonics
    11. // and QMetaObject (reflection)
    12. menu->showFullScreen();
    To copy to clipboard, switch view to plain text mode 
    This works fine. Then when the menu activates a push-button, that plugin gets called and does the following:
    Qt Code:
    1. void evilcpcMenuItemCdObject::onActivate()
    2. {
    3. if(!w)
    4. {
    5. w = new evilcpcMenuItemCdWidget(qobject_cast<QWidget *>(parent()));
    6. }
    7. w->showFullScreen();
    8. }
    To copy to clipboard, switch view to plain text mode 
    Now this works also, but the background is transparent, the layout only seems to cover the top-left corner, and... well... it's ugly. Any ideas?
    Attached Images Attached Images
    Life without passion is death in disguise

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Odd behaviour with showFullScreen

    Is the "small" widget created with the "big" widget as its parent? It shouldn't have a parent or it should be wrapped in a QDialog. Otherwise the parent will always shine through the child.

  5. The following user says thank you to wysota for this useful post:

    KShots (17th August 2007)

  6. #5
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Red face Re: Odd behaviour with showFullScreen

    Hmm... I'll try it without a parent. That's what the qobject_cast<>() was doing earlier was making sure that it did have the big widget as a parent. Thanks.

    EDIT: Bingo, that's exactly what I wanted Thanks!!
    Last edited by KShots; 17th August 2007 at 13:16.
    Life without passion is death in disguise

Similar Threads

  1. Disable default tab behaviour for a QGraphicsItem
    By nmather in forum Qt Programming
    Replies: 3
    Last Post: 13th December 2017, 10:30
  2. QAbstractItemView selection behaviour issue
    By Caius Aérobus in forum Qt Programming
    Replies: 4
    Last Post: 1st May 2007, 16:33
  3. Replies: 3
    Last Post: 12th October 2006, 21:48
  4. Different behaviour on different distributions
    By Kumula in forum Qt Programming
    Replies: 17
    Last Post: 6th March 2006, 23:58
  5. [Qt 4.1] Strange behaviour with QTableView
    By fane in forum Qt Programming
    Replies: 1
    Last Post: 23rd January 2006, 06:17

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.