[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Help needed please with QTreeView
From:       Szombathelyi =?iso-8859-2?q?Gy=F6rgy?= <gyurco () freemail ! hu>
Date:       2006-09-25 19:38:09
Message-ID: 200609252138.09192.gyurco () freemail ! hu
[Download RAW message or body]

I digged deeper (scratching the surface only...) to the code, and I think you 
just updating some of the model aspects too frequently... See the attached 
(very ugly) patch, which makes the behavior a bit nicer.
P.S.: Only tree-style process view will available? (I miss the old flat view).

Bye,
György


2006. szeptember 24. 20.36 dátummal johnflux@gmail.com ezt írta:
> Hi,
>   I'm having a lot of problems with QTreeView and its friends.  I'm getting
> drawing bugs, sorting bugs, filtering bugs.. you name it.  I've been trying
> for months with this, and I know its just stupid mistakes somewhere.
>
>   Could someone with some experience help me with this please? The app is
> ksysguard in kdebase/workspace in trunk.  Help either here or even in
> person sice I'm at akademy.  Either is fine :-)
>
>   Thanks all,
>
> John

["nicerksg.diff" (text/x-diff)]

Index: ProcessController.cc
===================================================================
--- ProcessController.cc	(revision 588349)
+++ ProcessController.cc	(working copy)
@@ -277,6 +277,8 @@
 	sendRequest(sensors().at(0)->hostName(), "ps", Ps_Command);  //update the display \
afterwards  }
 
+static bool headerset = false;
+
 void
 ProcessController::answerReceived(int id, const QStringList& answer)
 {
@@ -308,18 +310,22 @@
 			sensorError(id, true);
 			return;
 		}
-		if(!mModel.setHeader(header, coltype)) {
+                
+                if ( !headerset ) {
+		  if(!mModel.setHeader(header, coltype)) {
 			sensorError(id,true);
 			return;
+		  }
+		  headerset=true;
 		}
 
-		mFilterModel.setFilterKeyColumn(0);
+//		mFilterModel.setFilterKeyColumn(0);
 		//When we loaded the settings, we set mInitialSort* to the column and direction to \
sort in/  //Since we have just added the columns no, we should set the sort now.
 		
-		mUi.treeView->sortByColumn(mInitialSortCol);
-		mFilterModel.sort(mInitialSortCol,(mInitialSortInc)?Qt::AscendingOrder:Qt::DescendingOrder);
                
-		kDebug() << "We have added the columns and now setting the sort by col " << \
mInitialSortCol << endl; +//		mUi.treeView->sortByColumn(mInitialSortCol);
+//		mFilterModel.sort(mInitialSortCol,(mInitialSortInc)?Qt::AscendingOrder:Qt::DescendingOrder);
 +//		kDebug() << "We have added the columns and now setting the sort by col " << \
mInitialSortCol << endl;  
 		kDebug() << "PS_INFO_COMMAND: We are now ready for ps.  " << \
QTime::currentTime().toString("hh:mm:ss.zzz") << endl;  mReadyForPs = true;



>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic