PDA

View Full Version : Odd behaviour with showFullScreen



KShots
3rd May 2007, 00:24
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

wysota
3rd May 2007, 15:42
Could we see some code?

KShots
17th August 2007, 10:27
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:
evilcpcMenu * m = lPluginMenu[0];
QWidget * menu = m->getWidget();
...
// ... lots of stuff where things are being generated and connected
if(!m->addItems(mis))
{ // This section adds items to the menu. Seems to work fine
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());
}
...
// Connecting all plugins signals to all plugins slots via mneumonics
// and QMetaObject (reflection)
menu->showFullScreen();This works fine. Then when the menu activates a push-button, that plugin gets called and does the following:
void evilcpcMenuItemCdObject::onActivate()
{
if(!w)
{
w = new evilcpcMenuItemCdWidget(qobject_cast<QWidget *>(parent()));
}
w->showFullScreen();
}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?

wysota
17th August 2007, 12:46
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.

KShots
17th August 2007, 13:12
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!!:D