Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 7

Qt-interest Archive, March 2002
Disabling Grib from QMainWindow object


Message 1 in thread

Hi!

I want to disable the grib from a QMainWindow object like it is possible
with dialog windows:

this->setSizeGripEnabled ( false );

Is there any way to do this ?

Or is there a way to embed dialogs into widgets like it is possible
with QMainWindow objects (My quick test doing this failed, instead
of embedding it just popped up above the main window and blocked the
window).

Reason for this is that I create the layout in QT Designer and
need to integrate it into a splitter which I need to create by
hand because Designer does not support HBoxes (only Group Boxes
are supported).

Regards,

Reinhard Katzmann


Message 2 in thread

Why don't you just start with a QWidget as the parent of your layout 
instead of a toplevel widget? Or am I missing something?

/Mauritz
Underscore AB

Reinhard Katzmann wrote:

> Hi!
>
> I want to disable the grib from a QMainWindow object like it is possible
> with dialog windows:
>
> this->setSizeGripEnabled ( false );
>
> Is there any way to do this ?
>
> Or is there a way to embed dialogs into widgets like it is possible
> with QMainWindow objects (My quick test doing this failed, instead
> of embedding it just popped up above the main window and blocked the
> window).
>
> Reason for this is that I create the layout in QT Designer and
> need to integrate it into a splitter which I need to create by
> hand because Designer does not support HBoxes (only Group Boxes
> are supported).
>
> Regards,
>
> Reinhard Katzmann
>
> -- 
> List archive and information: http://qt-interest.trolltech.com


Message 3 in thread

> Hi!
> 
> I want to disable the grib from a QMainWindow object like it 
> is possible
> with dialog windows:
> 
> this->setSizeGripEnabled ( false );
> 
> Is there any way to do this ?

You could do:
	QObjectList *l = mw->statusBar()->queryList( "QSizeGrip" );
	QObjectListIt it(*l);
	QObject *obj;
	// There shoould be only one sizegrip....
	// But what the hell.... Lets loop anyway...
	while ( (obj = it.current()) != 0 ) {
		++it;
		delete obj; // hide will do also...
	}
	delete l; 	

where mw is the pointer to your QMainWindow.
It wont disable the abillty to resize of your window though, if thats
what your after. 
Setting maximumSize = minimumSize of you centralWidget and your 
QMainWindew might do the trick...


> Or is there a way to embed dialogs into widgets like it is possible
> with QMainWindow objects (My quick test doing this failed, instead
> of embedding it just popped up above the main window and blocked the
> window).

The QMainWindows central widget should usually not (never?) be an dialog.
Use a QWidget instead. Makes more sense....
Dialogs are after all just that, dialogs. 
 
> Reason for this is that I create the layout in QT Designer and
> need to integrate it into a splitter which I need to create by
> hand because Designer does not support HBoxes (only Group Boxes
> are supported).

Doesn't the "Lay out horizontally/vertically in splitter" thing in
the Designer do just that?

Regards...

-- 
 [ signature omitted ] 

Message 4 in thread

Hi!

I chose to use the QWidget instead of QMainWindow variant, I simply
did not see the possibility to create forms from QWidget.


 > where mw is the pointer to your QMainWindow.
 > It wont disable the abillty to resize of your window though, if thats
 > what your after.
 > Setting maximumSize = minimumSize of you centralWidget and your
 > QMainWindew might do the trick...

I once tried to "fixSize" a MainWindow this way, but it does not work,
it only works if you place a frame or h/vbox into the window and
fixSize that one.

It might work for normal QWidgets instead of QMainWindow, I have to
test that (if yes, I can remove on HBox :)

Thanks for the help,

Reinhard Katzmann


Message 5 in thread

I am currently using qt x11 commercial version 3.0.1  for developing and my
test platform has the qtlib.so.3.0.0 library
I realized i should maybe use the same library files, so i copied the
qtlib.so.3.0.1 file from my commercial folder to the test platform, and it
doesn't work!  once i point qtlib.so.3 to the new library, it gives me a
segmentation fault.
Does anyone know why??
If i put back the older qtlib.so.3.0.0  file, it works ok.


Message 6 in thread

I would have expected it to work OK.
Can you run under gdb and get a backtrace?
--
 [ signature omitted ] 

Message 7 in thread

Why not this:

#include <qstatusbar.h>
#include <qmainwindow.h>

mainWindow->statusBar()->setSizeGripEnabled(FALSE);

-- Paul.

> -----Original Message-----
> From: Eriksson Torbjörn [mailto:torbjorn.eriksson@aerotechtelub.se] 
> Sent: 19 March 2002 10:48
> To: qt-interest@trolltech.com
> Subject: SV: Disabling Grib from QMainWindow object
> 
> 
> > Hi!
> > 
> > I want to disable the grib from a QMainWindow object like it
> > is possible
> > with dialog windows:
> > 
> > this->setSizeGripEnabled ( false );
> > 
> > Is there any way to do this ?
> 
> You could do:
> 	QObjectList *l = mw->statusBar()->queryList( "QSizeGrip" );
> 	QObjectListIt it(*l);
> 	QObject *obj;
> 	// There shoould be only one sizegrip....
> 	// But what the hell.... Lets loop anyway...
> 	while ( (obj = it.current()) != 0 ) {
> 		++it;
> 		delete obj; // hide will do also...
> 	}
> 	delete l; 	
> 
> where mw is the pointer to your QMainWindow.
> It wont disable the abillty to resize of your window though, 
> if thats what your after. 
> Setting maximumSize = minimumSize of you centralWidget and your 
> QMainWindew might do the trick...
> 
> 
> > Or is there a way to embed dialogs into widgets like it is possible 
> > with QMainWindow objects (My quick test doing this failed, 
> instead of 
> > embedding it just popped up above the main window and blocked the 
> > window).
> 
> The QMainWindows central widget should usually not (never?) 
> be an dialog. Use a QWidget instead. Makes more sense.... 
> Dialogs are after all just that, dialogs. 
>  
> > Reason for this is that I create the layout in QT Designer 
> and need to 
> > integrate it into a splitter which I need to create by hand because 
> > Designer does not support HBoxes (only Group Boxes are supported).
> 
> Doesn't the "Lay out horizontally/vertically in splitter" 
> thing in the Designer do just that?
> 
> Regards...
> 
> -- 
> Torbjorn Eriksson
> torbjorn.eriksson@aerotechtelub.se 
> 
> --
> List archive and information: http://qt-interest.trolltech.com
>