[Kst] branches/work/kst/portto4/kst/src/libkstapp

Peter Kümmel syntheticpp at gmx.net
Sun Feb 13 19:18:32 CET 2011


SVN commit 1220295 by kuemmel:

make headers of datamanger resizeable 

 M  +9 -1      datamanager.cpp  
 M  +3 -0      datamanager.h  
 M  +2 -4      viewprimitivedialog.cpp  


--- branches/work/kst/portto4/kst/src/libkstapp/datamanager.cpp #1220294:1220295
@@ -64,7 +64,6 @@
   _contextMenu = new QMenu(this);
 
   connect(_purge, SIGNAL(clicked()), this, SLOT(purge()));
-
 }
 
 DataManager::~DataManager() {
@@ -73,6 +72,15 @@
   // ought to delete all of our actions before we exit)
 }
 
+
+void DataManager::showEvent(QShowEvent*)
+{
+  _session->header()->setResizeMode(QHeaderView::ResizeToContents);
+  QApplication::processEvents();
+  _session->header()->setResizeMode(QHeaderView::Interactive);
+}
+
+
 void DataManager::showContextMenu(const QPoint &position) {
   QList<QAction *> actions;
   if (_session->indexAt(position).isValid()) {
--- branches/work/kst/portto4/kst/src/libkstapp/datamanager.h #1220294:1220295
@@ -76,6 +76,9 @@
     ObjectPtr _currentObject;
     QShortcut *_deleteShortcut;
     QMenu *_contextMenu;
+
+    void showEvent(QShowEvent* event);
+
 };
 
 }
--- branches/work/kst/portto4/kst/src/libkstapp/viewprimitivedialog.cpp #1220294:1220295
@@ -48,13 +48,11 @@
   deleteModel();
   _model = createModel(_doc->objectStore());
   _tree->setModel(_model);
+
   _tree->header()->setResizeMode(QHeaderView::ResizeToContents);
   QApplication::processEvents();
-  if(_tree->header() && _tree->header()->count() > 1) {
-    _tree->header()->setResizeMode(0, QHeaderView::Interactive);
-    _tree->header()->setResizeMode(1, QHeaderView::Interactive);
+  _tree->header()->setResizeMode(QHeaderView::Interactive);
   }
-}
 
 
 


More information about the Kst mailing list