[Qt-interest] Full Screen stretch widgets

Andreas Neuhauser andreas_neuhauser at web.de
Thu Aug 20 12:55:20 CEST 2009


Hi,

I am programming at the moment a QTabWidget application with a resolution of 800x600 pixels and some other parts (QFrame) inside it. I want to add a method, which enables the widget to be shown in full screen with all its parts when you double clicke the widget. The widgets inside should be stretched with the factor, which is needed for the right proportion. Therefore I implemented the mouseDoubleClickEvent of Qt in the following way.

 void mouseDoubleClickEvent(QMouseEvent *event)
 {
	if(isFullScreen())
 	{
 		showNormal();
	}
	else
	{
		showFullScreen();
 	}
}
 
But with  that method only the window gets full screen and not the widgets inside. The widgets stay the same size and in the upper left corner.
In the constructor I calculate the stretch factor, which is perhaps needed:

showFullScreen();
stretchFactor = height(); 	//float stretchFactor
stretchFactor /= 600;		//600 is height in normal view
showNormal();

Is there any better way to implement this function? Or do I have to use setGeometry() for every single widget?

Thank you for your answers,

Andreas


________________________________________________________________
Neu: WEB.DE Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate
für nur 19,99 Euro/mtl.!* http://produkte.web.de/go/02/





More information about the Qt-interest-old mailing list