[Uml-devel] kdesdk/umbrello/umbrello

Sebastian Stein seb.kde at hpfsc.de
Wed Jun 30 07:46:15 UTC 2004


CVS commit by sstein: 

patch by Achim Spangler: work around for a Qt-bug causing a very high X11 memory usage

CCMAIL: Achim.Spangler at mnet-online.de


  M +17 -0     umlview.cpp   1.146


--- kdesdk/umbrello/umbrello/umlview.cpp  #1.145:1.146
@@ -90,4 +90,10 @@
 #include "toolbarstatefactory.h"
 
+
+// control the manual DoubleBuffering of QCanvas
+// with a define, so that this memory X11 effect can
+// be tested more easily
+#define MANUAL_CONTROL_DOUBLE_BUFFERING
+
 // static members
 const int UMLView::defaultCanvasSize = 1300;
@@ -366,4 +372,10 @@ void UMLView::slotToolBarChanged(int c)
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 void UMLView::showEvent(QShowEvent* /*se*/) {
+
+        #ifdef MANUAL_CONTROL_DOUBLE_BUFFERING
+        kdWarning() << "Show Event for " << getName() << endl;
+        canvas()->setDoubleBuffering( true );
+        #endif
+
         UMLApp* theApp = UMLApp::app();
         WorkToolBar* tb = theApp->getWorkToolBar();
@@ -382,4 +394,9 @@ void UMLView::hideEvent(QHideEvent* /*he
         disconnect(this,SIGNAL(sigResetToolBar()), tb, SLOT(slotResetToolBar()));
         disconnect(m_pDoc, SIGNAL(sigObjectCreated(UMLObject *)), this, SLOT(slotObjectCreated(UMLObject *)));
+
+        #ifdef MANUAL_CONTROL_DOUBLE_BUFFERING
+        kdWarning() << "Hide Event for " << getName() << endl;
+        canvas()->setDoubleBuffering( false );
+        #endif
 }
 ////////////////////////////////////////////////////////////////////////////////////////////////////






More information about the umbrello-devel mailing list