void MetaListViewWidget::initialize(QAbstractItemModel *model, const KConfigGroup & group) { m_listView->setModel(model); if ( group.isValid() ) { setMetaBarPosition( readEntry(group, "metaBarPosition", Right) ); setListViewMode( readEntry(group, "listViewMode", QListView::ListMode) ); m_splitter->restoreState( group.readEntry("splitterState", QByteArray()) ); m_configGroup = group; } else { setMetaBarPosition(Right); setListViewMode(QListView::ListMode); } //### Disabled feature; this should not be user-configurable. depends on the model. setMultipleSelectionEnabled(false); QItemSelectionModel *selModel = m_listView->selectionModel(); connect(selModel, SIGNAL(selectionChanged(QItemSelection, QItemSelection )), SIGNAL(selectionChanged(QItemSelection)) ); connect(m_listView, SIGNAL(customContextMenuRequested(QPoint)), SLOT(slotContextMenuRequested(QPoint)) ); loadGlobalPreferences(); connect(qtwineApp, SIGNAL(preferencesChanged()), this, SLOT(loadGlobalPreferences()) ); }
//============================================================================== DragAndDropDemoSource() : ListBox ("d+d source", 0) { // tells the ListBox that this object supplies the info about its rows. setModel (this); setMultipleSelectionEnabled (true); }
//============================================================================== MidiDeviceListBox (const String& name, MainContentComponent& contentComponent, bool isInputDeviceList) : ListBox (name, this), parent (contentComponent), isInput (isInputDeviceList) { setOutlineThickness (1); setMultipleSelectionEnabled (true); setClickingTogglesRowSelection (true); }