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

List:       kde-devel
Subject:    Weired QTreeView problem
From:       Thomas Thrainer <tom_t () gmx ! at>
Date:       2008-05-20 15:35:36
Message-ID: 200805201735.36393.tom_t () gmx ! at
[Download RAW message or body]

Hello

I stumbled over a quite weired problem. The attached test program creates a 
standard model and a QTreeView. The view is set sortable, and the column 
headers should be moveable by default.

This simple test program works nicely with the Qt 4.4 libraries installed from 
recent Ubuntu packages when run in a KDE 3.5.9 session.

But when I run the same program, linked against the same libraries, in a KDE4 
session, I can't sort the columns any more. Moving column headers still 
works. The weired thing is, that when I disable the ability to move column 
headers, sorting works again.

BTW, I have compiled and linked KDE4 also against the same Qt 4.4 version from 
the Ubuntu packages.

Any clue anybody?

Thanks,
Thomas

["main.cpp" (text/x-c++src)]

#include <QtGui>

int main(int argc, char **argv)
{
    QApplication app(argc, argv);
	
	QStandardItemModel* model = new QStandardItemModel( 5, 5);
    for ( int toprow = 0; toprow < 5; ++toprow ) {
        for ( int topcol = 0; topcol < 5; ++topcol ) {
            model->setData( model->index( toprow, topcol ), QString( \
"(%1,%2)").arg(toprow).arg(topcol) );  }
     }

	QTreeView tree;
	tree.setSortingEnabled(true);
    
    //uncomment this, and sorting works again
    //tree.header()->setMovable(false);
    
	tree.setModel(model);
	tree.show();

    return app.exec();
}



>> 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