[Qt-interest] placing widget in the GUI, weird behaviour of QTDesigner....

Andreas Diehl Andreas_Diehl at abs.org
Thu Apr 16 10:29:40 CEST 2009


Hello.
Try using a separate QDockWidget for your TreeView. Something like:
 
QDockWidget* treeDockWdg = new QDockWidget("Treeview", myMainWindow);
treeDockWdg->setWidget(myTreeView);
treeDockWdg->setAllowedAreas(Qt::LeftDockWidgetArea |
RightDockWidgetArea); //for example
myMainWindow->addDockWidget(Qt::LeftDockWidgetArea, treeDockWdg);
 
Thus you'll get your intended behaviour and even more flexibility in
resizing, replacing and showing/hiding your treeview without more work.
 
Regards,
    Andreas
 
 



________________________________

	Von: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] Im Auftrag von Giancarlo
Amati
	Gesendet: Donnerstag, 16. April 2009 10:05
	An: qt-interest at trolltech.com
	Betreff: [Qt-interest] placing widget in the GUI,weird behaviour
of QTDesigner....
	
	
	Good morning guys,
	
	I'm trying to design my GUI, I want to add a TreeView widget on
the left side of my main window. 
	My main window already has a centralWidget QVtk which is the
widget for my 3Drendering. Now,
	as soon as I drop the treeview widget in the main area, it
happens like in picture qtreeview1.jpg that is
	the overall area of the window is taken by the treewidget. now,
I compile my project and run the exe file, and I get 
	that the GUI looks like in the ptreeView2.jpg. So, the qtreeview
is like part of the centrawidget or soemthing, it expands and shriks in
accordance with the mainwindow size (behanviour that I don't like),
so....I just want to add a treeview widget on the left side of the
mainwindow.
	What's wrong with what' I'm doing?
	
	Kind regards.
	Giancarlo
	
	
________________________________

	25 GB di spazio gratuito su Internet! Prova SkyDrive
<http://clk.atdmt.com/GBL/go/140630366/direct/01/>
--
Mit freundlichen Gru?en
Andreas Diehl 
 
-------------------------- ABS -------------------------
ABS Systemberatung OHG          Tel: +49 (0)7053/9290-03
Hauffstr. 9                     Fax: +49 (0)7053/9290-
D-75385 Bad Teinach-Zavelstein        http://www.abs.org
Registergericht Calw HRA 1031
[mailto:Andreas_Diehl at abs.org]
 
----- Loesungen fuer den Maschinen- und Anlagenbau -----
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090416/5af14766/attachment.html 


More information about the Qt-interest-old mailing list