broken QObject::connect in quickopen plugin
Andreas Pakulat
apaku at gmx.de
Thu Dec 11 09:09:07 UTC 2008
Hi,
Olivier Goffart just pointed this one out on IRC and I have a related
question:
void QuickOpenWidgetHandler::run() {
o.list->setModel( 0 );
m_dialog->show();
//This is a workaround for a problem in KStyle where the scroll-mode is
//overwritten with ScrollPerPixel during show()
//Usually all this stuff should be done BEFORE show() is called
o.list->setVerticalScrollMode(QAbstractItemView::ScrollPerItem);
m_model->setTreeView( o.list );
o.list->setModel( m_model );
connect( o.list->selectionModel(), SIGNAL(currentRowChanged( const
QModelIndex&, const QModelIndex& )), this, SLOT(currentCh
anged( const QModelIndex&, const QModelIndex& )) );
connect( o.list->selectionModel(), SIGNAL(selectionChanged( const
QModelIndex&, const QModelIndex& )), this, SLOT(currentCha
nged( const QModelIndex&, const QModelIndex& )) );
}
The second connect is wrong, selectionChanged doesn't provide model indexes
as parameters. IIRC its itemselection, which will need a separate slot.
I didn't fix this because I'm not sure what the inteded behaviour is when
multiple items are selected (does the view even support that?).
Which brings me to my question: Can we have the multiple selection in
quickopen back? I'm using that feature every once in a while in KDevelop3.
Andreas
--
It may or may not be worthwhile, but it still has to be done.
More information about the KDevelop-devel
mailing list