• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kontact

  • sources
  • kde-4.14
  • kdepim
  • kontact
  • src
iconsidepane.cpp
Go to the documentation of this file.
1 /*
2  This file is part of KDE Kontact.
3 
4  Copyright (C) 2003 Cornelius Schumacher <schumacher@kde.org>
5  Copyright (C) 2008 Rafael Fernández López <ereslibre@kde.org>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; see the file COPYING. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 #include "iconsidepane.h"
24 #include "prefs.h"
25 using namespace Kontact;
26 
27 #include <KontactInterface/Core>
28 #include <KontactInterface/Plugin>
29 
30 #include <KAction>
31 #include <KIcon>
32 #include <KLocale>
33 #include <KStringHandler>
34 
35 #include <QDragEnterEvent>
36 #include <QDragMoveEvent>
37 #include <QDropEvent>
38 #include <QSortFilterProxyModel>
39 #include <QStringListModel>
40 #include <QStyledItemDelegate>
41 #include <QTimer>
42 
43 namespace Kontact {
44 
45 class SelectionModel : public QItemSelectionModel
46 {
47 public:
48  SelectionModel( QAbstractItemModel *model, QObject *parent )
49  : QItemSelectionModel( model, parent )
50  {
51  }
52 
53 public slots:
54  void clear()
55  {
56  // Don't allow the current selection to be cleared. QListView doesn't call to this method
57  // nowadays, but just to cover of future change of implementation, since QTreeView does call
58  // to this one when clearing the selection.
59  }
60 
61  void select( const QModelIndex &index, QItemSelectionModel::SelectionFlags command )
62  {
63  // Don't allow the current selection to be cleared
64  if ( !index.isValid() && ( command & QItemSelectionModel::Clear ) ) {
65  return;
66  }
67  QItemSelectionModel::select( index, command );
68  }
69 
70  void select( const QItemSelection &selection,
71  QItemSelectionModel::SelectionFlags command )
72  {
73  // Don't allow the current selection to be cleared
74  if ( !selection.count() && ( command & QItemSelectionModel::Clear ) ) {
75  return;
76  }
77  QItemSelectionModel::select( selection, command );
78  }
79 };
80 
81 class Model : public QStringListModel
82 {
83 public:
84  enum SpecialRoles {
85  PluginName = Qt::UserRole
86  };
87 
88  Model( Navigator *parentNavigator = 0 )
89  : QStringListModel( parentNavigator ), mNavigator(parentNavigator)
90  {
91  }
92 
93  void emitReset()
94  {
95  emit reset();
96  }
97 
98  void setPluginList( const QList<KontactInterface::Plugin*> &list ) {
99  pluginList = list;
100  }
101 
102  Qt::ItemFlags flags( const QModelIndex &index ) const
103  {
104  Qt::ItemFlags flags = QStringListModel::flags( index );
105 
106  flags &= ~Qt::ItemIsEditable;
107 
108  if ( index.isValid() ) {
109  if ( static_cast<KontactInterface::Plugin*>( index.internalPointer() )->disabled() ) {
110  flags &= ~Qt::ItemIsEnabled;
111  flags &= ~Qt::ItemIsSelectable;
112  flags &= ~Qt::ItemIsDropEnabled;
113  } else {
114  flags |= Qt::ItemIsDropEnabled;
115  }
116  } else {
117  flags &= ~Qt::ItemIsDropEnabled;
118  }
119 
120  return flags;
121  }
122 
123  QModelIndex index( int row, int column,
124  const QModelIndex &parent = QModelIndex() ) const
125  {
126  Q_UNUSED( parent );
127  if ( row < 0 || row >= pluginList.count() ) {
128  return QModelIndex();
129  }
130  return createIndex( row, column, pluginList[row] );
131  }
132 
133  QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const
134  {
135  if ( !index.isValid() || !index.internalPointer() ) {
136  return QVariant();
137  }
138 
139  if ( role == Qt::DisplayRole ) {
140  if ( !mNavigator->showText() ) {
141  return QVariant();
142  }
143  return static_cast<KontactInterface::Plugin*>( index.internalPointer() )->title();
144  } else if ( role == Qt::DecorationRole ) {
145  if ( !mNavigator->showIcons() ) {
146  return QVariant();
147  }
148  return KIcon( static_cast<KontactInterface::Plugin*>( index.internalPointer() )->icon() );
149  } else if ( role == Qt::TextAlignmentRole ) {
150  return Qt::AlignCenter;
151  } else if ( role == Qt::ToolTipRole ) {
152  if ( !mNavigator->showText() ) {
153  return static_cast<KontactInterface::Plugin*>( index.internalPointer() )->title();
154  }
155  return QVariant();
156  } else if ( role == PluginName ) {
157  return static_cast<KontactInterface::Plugin*>( index.internalPointer() )->identifier();
158  }
159  return QStringListModel::data( index, role );
160  }
161 
162 private:
163  QList<KontactInterface::Plugin*> pluginList;
164  Navigator *mNavigator;
165 };
166 
167 class SortFilterProxyModel
168  : public QSortFilterProxyModel
169 {
170 public:
171  SortFilterProxyModel( QObject *parent = 0 ): QSortFilterProxyModel( parent )
172  {
173  setDynamicSortFilter( true );
174  sort ( 0 );
175  }
176 protected:
177  bool lessThan( const QModelIndex &left, const QModelIndex &right ) const
178  {
179  KontactInterface::Plugin *leftPlugin =
180  static_cast<KontactInterface::Plugin*>( left.internalPointer() );
181  KontactInterface::Plugin *rightPlugin =
182  static_cast<KontactInterface::Plugin*>( right.internalPointer() );
183 
184  if ( leftPlugin->weight() == rightPlugin->weight() ) {
185  return KStringHandler::naturalCompare( leftPlugin->title(), rightPlugin->title() ) < 0;
186  }
187 
188  return leftPlugin->weight() < rightPlugin->weight();
189  }
190 };
191 
192 class Delegate : public QStyledItemDelegate
193 {
194 public:
195  Delegate( Navigator *parentNavigator = 0 )
196  : QStyledItemDelegate( parentNavigator ), mNavigator( parentNavigator )
197  {
198  }
199 
200  void paint( QPainter *painter, const QStyleOptionViewItem &option,
201  const QModelIndex &index ) const
202  {
203  if ( !index.isValid() || !index.internalPointer() ) {
204  return;
205  }
206 
207  QStyleOptionViewItemV4 optionCopy( *static_cast<const QStyleOptionViewItemV4*>( &option ) );
208  optionCopy.decorationPosition = QStyleOptionViewItem::Top;
209  optionCopy.decorationSize = QSize( mNavigator->iconSize(), mNavigator->iconSize() );
210  optionCopy.textElideMode = Qt::ElideNone;
211  QStyledItemDelegate::paint( painter, optionCopy, index );
212  }
213 
214  QSize sizeHint( const QStyleOptionViewItem &option, const QModelIndex &index ) const
215  {
216  if ( !index.isValid() || !index.internalPointer() ) {
217  return QSize();
218  }
219 
220  QStyleOptionViewItemV4 optionCopy( *static_cast<const QStyleOptionViewItemV4*>( &option ) );
221  optionCopy.decorationPosition = QStyleOptionViewItem::Top;
222  optionCopy.decorationSize =
223  mNavigator->showIcons() ? QSize( mNavigator->iconSize(), mNavigator->iconSize() ) : QSize();
224  optionCopy.textElideMode = Qt::ElideNone;
225  return QStyledItemDelegate::sizeHint( optionCopy, index );
226  }
227 
228 private:
229  Navigator *mNavigator;
230 };
231 
232 }
233 
234 Navigator::Navigator( SidePaneBase *parent )
235  : QListView( parent ), mSidePane( parent )
236 {
237  setViewport( new QWidget( this ) );
238 
239  setVerticalScrollMode( ScrollPerPixel );
240  setHorizontalScrollMode( ScrollPerPixel );
241 
242  mIconSize = Prefs::self()->sidePaneIconSize();
243  mShowIcons = Prefs::self()->sidePaneShowIcons();
244  mShowText = Prefs::self()->sidePaneShowText();
245 
246  QActionGroup *viewMode = new QActionGroup( this );
247 
248  mShowIconsAction = new KAction( i18nc( "@action:inmenu", "Show Icons Only" ), this );
249  mShowIconsAction->setCheckable( true );
250  mShowIconsAction->setActionGroup( viewMode );
251  mShowIconsAction->setChecked( !mShowText && mShowIcons );
252  mShowIconsAction->setHelpText(
253  i18nc( "@info:status",
254  "Show sidebar items with icons and without text" ) );
255  mShowIconsAction->setWhatsThis(
256  i18nc( "@info:whatsthis",
257  "Choose this option if you want the sidebar items to have icons without text." ) );
258  connect( mShowIconsAction, SIGNAL(triggered(bool)), this, SLOT(slotActionTriggered(bool)) );
259 
260  mShowTextAction = new KAction( i18nc( "@action:inmenu", "Show Text Only" ), this );
261  mShowTextAction->setCheckable( true );
262  mShowTextAction->setActionGroup( viewMode );
263  mShowTextAction->setChecked( mShowText && !mShowIcons );
264  mShowTextAction->setHelpText(
265  i18nc( "@info:status",
266  "Show sidebar items with text and without icons" ) );
267  mShowTextAction->setWhatsThis(
268  i18nc( "@info:whatsthis",
269  "Choose this option if you want the sidebar items to have text without icons." ) );
270  connect( mShowTextAction, SIGNAL(triggered(bool)), this, SLOT(slotActionTriggered(bool)) );
271 
272  mShowBothAction = new KAction( i18nc( "@action:inmenu", "Show Icons && Text" ), this );
273  mShowBothAction->setCheckable( true );
274  mShowBothAction->setActionGroup( viewMode );
275  mShowBothAction->setChecked( mShowText && mShowIcons );
276  mShowBothAction->setHelpText(
277  i18nc( "@info:status",
278  "Show sidebar items with icons and text" ) );
279  mShowBothAction->setWhatsThis(
280  i18nc( "@info:whatsthis",
281  "Choose this option if you want the sidebar items to have icons and text." ) );
282  connect( mShowBothAction, SIGNAL(triggered(bool)), this, SLOT(slotActionTriggered(bool)) );
283 
284  KAction *sep = new KAction( this );
285  sep->setSeparator( true );
286 
287  QActionGroup *iconSize = new QActionGroup( this );
288 
289  mBigIconsAction = new KAction( i18nc( "@action:inmenu", "Big Icons" ), this );
290  mBigIconsAction->setCheckable( true );
291  mBigIconsAction->setActionGroup( iconSize );
292  mBigIconsAction->setChecked( mIconSize == KIconLoader::SizeLarge );
293  mBigIconsAction->setHelpText(
294  i18nc( "@info:status",
295  "Show large size sidebar icons" ) );
296  mBigIconsAction->setWhatsThis(
297  i18nc( "@info:whatsthis",
298  "Choose this option if you want the sidebar icons to be extra big." ) );
299  connect( mBigIconsAction, SIGNAL(triggered(bool)), this, SLOT(slotActionTriggered(bool)) );
300 
301  mNormalIconsAction = new KAction( i18nc( "@action:inmenu", "Normal Icons" ), this );
302  mNormalIconsAction->setCheckable( true );
303  mNormalIconsAction->setActionGroup( iconSize );
304  mNormalIconsAction->setChecked( mIconSize == KIconLoader::SizeMedium );
305  mNormalIconsAction->setHelpText(
306  i18nc( "@info:status",
307  "Show normal size sidebar icons" ) );
308  mNormalIconsAction->setWhatsThis(
309  i18nc( "@info:whatsthis",
310  "Choose this option if you want the sidebar icons to be normal size." ) );
311  connect( mNormalIconsAction, SIGNAL(triggered(bool)), this, SLOT(slotActionTriggered(bool)) );
312 
313  mSmallIconsAction = new KAction( i18nc( "@action:inmenu", "Small Icons" ), this );
314  mSmallIconsAction->setCheckable( true );
315  mSmallIconsAction->setActionGroup( iconSize );
316  mSmallIconsAction->setChecked( mIconSize == KIconLoader::SizeSmallMedium );
317  mSmallIconsAction->setHelpText(
318  i18nc( "@info:status",
319  "Show small size sidebar icons" ) );
320  mSmallIconsAction->setWhatsThis(
321  i18nc( "@info:whatsthis",
322  "Choose this option if you want the sidebar icons to be extra small." ) );
323  connect( mSmallIconsAction, SIGNAL(triggered(bool)), this, SLOT(slotActionTriggered(bool)) );
324 
325  QList<QAction*> actionList;
326  actionList << mShowIconsAction << mShowTextAction << mShowBothAction << sep
327  << mBigIconsAction << mNormalIconsAction << mSmallIconsAction;
328 
329  insertActions( 0, actionList );
330 
331  setContextMenuPolicy( Qt::ActionsContextMenu );
332  setViewMode( ListMode );
333  setItemDelegate( new Delegate( this ) );
334  mModel = new Model( this );
335  SortFilterProxyModel *sortFilterProxyModel = new SortFilterProxyModel;
336  sortFilterProxyModel->setSourceModel( mModel );
337  setModel( sortFilterProxyModel );
338  setSelectionModel( new SelectionModel( sortFilterProxyModel, this ) );
339 
340  setDragDropMode( DropOnly );
341  viewport()->setAcceptDrops( true );
342  setDropIndicatorShown( true );
343 
344  connect( selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)),
345  this, SLOT(slotCurrentChanged(QModelIndex)) );
346 }
347 
348 void Navigator::updatePlugins( QList<KontactInterface::Plugin*> plugins_ )
349 {
350  QString currentPlugin;
351  if ( currentIndex().isValid() ) {
352  currentPlugin = currentIndex().model()->data( currentIndex(), Model::PluginName ).toString();
353  }
354 
355  QList<KontactInterface::Plugin*> pluginsToShow;
356  foreach ( KontactInterface::Plugin *plugin, plugins_ ) {
357  if ( plugin->showInSideBar() ) {
358  pluginsToShow << plugin;
359  }
360  }
361 
362  mModel->setPluginList( pluginsToShow );
363 
364  mModel->removeRows( 0, mModel->rowCount() );
365  mModel->insertRows( 0, pluginsToShow.count() );
366 
367  // Restore the previous selected index, if any
368  if ( !currentPlugin.isEmpty() ) {
369  setCurrentPlugin( currentPlugin );
370  }
371 }
372 
373 void Navigator::setCurrentPlugin( const QString &plugin )
374 {
375  const int numberOfRows( model()->rowCount() );
376  for ( int i = 0; i < numberOfRows; ++i ) {
377  const QModelIndex index = model()->index( i, 0 );
378  const QString pluginName = model()->data( index, Model::PluginName ).toString();
379 
380  if ( plugin == pluginName ) {
381  selectionModel()->setCurrentIndex( index, QItemSelectionModel::SelectCurrent );
382  break;
383  }
384  }
385 }
386 
387 QSize Navigator::sizeHint() const
388 {
389  //### TODO: We can cache this value, so this reply is faster. Since here we won't
390  // have too many elements, it is not that important. When caching this value
391  // make sure it is updated correctly when new rows have been added or
392  // removed. (ereslibre)
393 
394  int maxWidth = 0;
395  const int numberOfRows( model()->rowCount() );
396  for ( int i = 0; i < numberOfRows; ++i ) {
397  const QModelIndex index = model()->index( i, 0 );
398  maxWidth = qMax( maxWidth, sizeHintForIndex( index ).width() );
399  }
400 
401  int viewHeight = QListView::sizeHint().height();
402 
403  return QSize( maxWidth + rect().width() - contentsRect().width(), viewHeight );
404 }
405 
406 void Navigator::dragEnterEvent( QDragEnterEvent *event )
407 {
408  if ( event->proposedAction() == Qt::IgnoreAction ) {
409  return;
410  }
411  event->acceptProposedAction();
412 }
413 
414 void Navigator::dragMoveEvent( QDragMoveEvent *event )
415 {
416  if ( event->proposedAction() == Qt::IgnoreAction ) {
417  return;
418  }
419 
420  const QModelIndex dropIndex = indexAt( event->pos() );
421 
422  if ( !dropIndex.isValid() ||
423  !( dropIndex.model()->flags( dropIndex ) & Qt::ItemIsEnabled ) ) {
424  event->setAccepted( false );
425  return;
426  } else {
427  const QModelIndex sourceIndex =
428  static_cast<const QSortFilterProxyModel*>( model() )->mapToSource( dropIndex );
429  KontactInterface::Plugin *plugin =
430  static_cast<KontactInterface::Plugin*>( sourceIndex.internalPointer() );
431  if ( !plugin->canDecodeMimeData( event->mimeData() ) ) {
432  event->setAccepted( false );
433  return;
434  }
435  }
436 
437  event->acceptProposedAction();
438 }
439 
440 void Navigator::dropEvent( QDropEvent *event )
441 {
442  if ( event->proposedAction() == Qt::IgnoreAction ) {
443  return;
444  }
445 
446  const QModelIndex dropIndex = indexAt( event->pos() );
447 
448  if ( !dropIndex.isValid() ) {
449  return;
450  } else {
451  const QModelIndex sourceIndex =
452  static_cast<const QSortFilterProxyModel*>( model() )->mapToSource( dropIndex );
453  KontactInterface::Plugin *plugin =
454  static_cast<KontactInterface::Plugin*>( sourceIndex.internalPointer() );
455  plugin->processDropEvent( event );
456  }
457 }
458 
459 void Navigator::showEvent( QShowEvent *event )
460 {
461  parentWidget()->setMaximumWidth( sizeHint().width() );
462  parentWidget()->setMinimumWidth( sizeHint().width() );
463 
464  QListView::showEvent( event );
465 }
466 
467 void Navigator::slotCurrentChanged( const QModelIndex &current )
468 {
469  if ( !current.isValid() || !current.internalPointer() ||
470  !( current.model()->flags( current ) & Qt::ItemIsEnabled ) ) {
471  return;
472  }
473 
474  QModelIndex source =
475  static_cast<const QSortFilterProxyModel*>( current.model() )->mapToSource( current );
476 
477  emit pluginActivated( static_cast<KontactInterface::Plugin*>( source.internalPointer() ) );
478 }
479 
480 void Navigator::slotActionTriggered( bool checked )
481 {
482  QObject *object = sender();
483 
484  if ( object == mShowIconsAction ) {
485  mShowIcons = checked;
486  mShowText = !checked;
487  } else if ( object == mShowTextAction ) {
488  mShowIcons = !checked;
489  mShowText = checked;
490  } else if ( object == mShowBothAction ) {
491  mShowIcons = checked;
492  mShowText = checked;
493  } else if ( object == mBigIconsAction ) {
494  mIconSize = KIconLoader::SizeLarge;
495  } else if ( object == mNormalIconsAction ) {
496  mIconSize = KIconLoader::SizeMedium;
497  } else if ( object == mSmallIconsAction ) {
498  mIconSize = KIconLoader::SizeSmallMedium;
499  }
500 
501  Prefs::self()->setSidePaneIconSize( mIconSize );
502  Prefs::self()->setSidePaneShowIcons( mShowIcons );
503  Prefs::self()->setSidePaneShowText( mShowText );
504 
505  mModel->emitReset();
506 
507  QTimer::singleShot( 0, this, SLOT(updateNavigatorSize()) );
508 }
509 
510 void Navigator::updateNavigatorSize()
511 {
512  parentWidget()->setMaximumWidth( sizeHint().width() );
513  parentWidget()->setMinimumWidth( sizeHint().width() );
514 }
515 
516 IconSidePane::IconSidePane( KontactInterface::Core *core, QWidget *parent )
517  : SidePaneBase( core, parent )
518 {
519  mNavigator = new Navigator( this );
520  mNavigator->setFocusPolicy( Qt::NoFocus );
521  connect( mNavigator, SIGNAL(pluginActivated(KontactInterface::Plugin*)),
522  SIGNAL(pluginSelected(KontactInterface::Plugin*)) );
523 }
524 
525 IconSidePane::~IconSidePane()
526 {
527 }
528 
529 void IconSidePane::setCurrentPlugin( const QString &plugin )
530 {
531  mNavigator->setCurrentPlugin( plugin );
532 }
533 
534 void IconSidePane::updatePlugins()
535 {
536  mNavigator->updatePlugins( core()->pluginList() );
537 }
538 
539 void IconSidePane::resizeEvent( QResizeEvent *event )
540 {
541  Q_UNUSED( event );
542  setMaximumWidth( mNavigator->sizeHint().width() );
543  setMinimumWidth( mNavigator->sizeHint().width() );
544 }
545 
546 
547 // vim: sw=2 sts=2 et tw=80
Kontact::Navigator::showEvent
virtual void showEvent(QShowEvent *event)
Definition: iconsidepane.cpp:459
Kontact::Navigator::iconSize
int iconSize() const
Definition: iconsidepane.h:52
QModelIndex
QAbstractItemView::setSelectionModel
virtual void setSelectionModel(QItemSelectionModel *selectionModel)
QResizeEvent
QWidget
Kontact::IconSidePane::IconSidePane
IconSidePane(KontactInterface::Core *core, QWidget *parent)
Definition: iconsidepane.cpp:516
QListView::viewMode
ViewMode viewMode() const
QAbstractItemModel::index
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const =0
QSize::width
int width() const
QDropEvent::mimeData
const QMimeData * mimeData() const
QActionGroup
QSortFilterProxyModel::sort
virtual void sort(int column, Qt::SortOrder order)
Kontact::IconSidePane::setCurrentPlugin
void setCurrentPlugin(const QString &plugin)
Definition: iconsidepane.cpp:529
Kontact::Navigator::dragMoveEvent
virtual void dragMoveEvent(QDragMoveEvent *event)
Definition: iconsidepane.cpp:414
QAbstractItemView::selectionModel
QItemSelectionModel * selectionModel() const
QWidget::contentsRect
QRect contentsRect() const
QDropEvent::proposedAction
Qt::DropAction proposedAction() const
QDragMoveEvent
QWidget::setFocusPolicy
void setFocusPolicy(Qt::FocusPolicy policy)
QObject::sender
QObject * sender() const
QStringListModel::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const
QAbstractItemView::setModel
virtual void setModel(QAbstractItemModel *model)
QWidget::setMinimumWidth
void setMinimumWidth(int minw)
QDropEvent::pos
const QPoint & pos() const
QAbstractItemView::setDragDropMode
void setDragDropMode(DragDropMode behavior)
Kontact::SidePaneBase::pluginSelected
void pluginSelected(KontactInterface::Plugin *)
QAbstractScrollArea::viewport
QWidget * viewport() const
Kontact::IconSidePane::resizeEvent
void resizeEvent(QResizeEvent *event)
Definition: iconsidepane.cpp:539
QAbstractItemView::setVerticalScrollMode
void setVerticalScrollMode(ScrollMode mode)
QSortFilterProxyModel::parent
virtual QModelIndex parent(const QModelIndex &child) const
Kontact::Navigator::pluginActivated
void pluginActivated(KontactInterface::Plugin *plugin)
QAbstractScrollArea::sizeHint
virtual QSize sizeHint() const
QListView
QWidget::width
int width() const
QAbstractItemModel::reset
void reset()
QModelIndex::isValid
bool isValid() const
QWidget::showEvent
virtual void showEvent(QShowEvent *event)
QList::count
int count(const T &value) const
QStringListModel::data
virtual QVariant data(const QModelIndex &index, int role) const
Kontact::IconSidePane::~IconSidePane
~IconSidePane()
Definition: iconsidepane.cpp:525
QStyleOptionViewItem
QShowEvent
QObject
QStyledItemDelegate::paint
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
QDropEvent
Kontact::Navigator::dropEvent
virtual void dropEvent(QDropEvent *event)
Definition: iconsidepane.cpp:440
QPainter
QItemSelectionModel::select
virtual void select(const QModelIndex &index, QFlags< QItemSelectionModel::SelectionFlag > command)
QString::isEmpty
bool isEmpty() const
QAbstractItemView::setItemDelegate
void setItemDelegate(QAbstractItemDelegate *delegate)
QStyledItemDelegate::sizeHint
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
QSortFilterProxyModel::setDynamicSortFilter
void setDynamicSortFilter(bool enable)
QModelIndex::internalPointer
void * internalPointer() const
QAbstractItemModel::data
virtual QVariant data(const QModelIndex &index, int role) const =0
QString
Kontact::SidePaneBase
Definition: sidepanebase.h:35
QList< KontactInterface::Plugin * >
QAbstractItemView::sizeHintForIndex
QSize sizeHintForIndex(const QModelIndex &index) const
Kontact::Navigator::setCurrentPlugin
void setCurrentPlugin(const QString &plugin)
Definition: iconsidepane.cpp:373
QStringListModel
QWidget::rect
QRect rect() const
QWidget::setAcceptDrops
void setAcceptDrops(bool on)
QAbstractItemModel::createIndex
QModelIndex createIndex(int row, int column, void *ptr) const
Kontact::Navigator
Definition: iconsidepane.h:42
Kontact::IconSidePane::updatePlugins
virtual void updatePlugins()
Definition: iconsidepane.cpp:534
QSize
Kontact::Navigator::sizeHint
virtual QSize sizeHint() const
Definition: iconsidepane.cpp:387
QWidget::insertActions
void insertActions(QAction *before, QList< QAction * > actions)
QSortFilterProxyModel
QWidget::setContextMenuPolicy
void setContextMenuPolicy(Qt::ContextMenuPolicy policy)
QItemSelection
QListView::indexAt
virtual QModelIndex indexAt(const QPoint &p) const
QWidget::setMaximumWidth
void setMaximumWidth(int maxw)
QModelIndex::model
const QAbstractItemModel * model() const
Kontact::Navigator::Navigator
Navigator(SidePaneBase *parent=0)
Definition: iconsidepane.cpp:234
QDragEnterEvent
QWidget::parentWidget
QWidget * parentWidget() const
QAbstractScrollArea::setViewport
void setViewport(QWidget *widget)
QWidget::QWidget
QWidget(QWidget *parent, QFlags< Qt::WindowType > f)
QSize::height
int height() const
QAbstractItemModel
QAbstractItemModel::flags
virtual Qt::ItemFlags flags(const QModelIndex &index) const
QItemSelectionModel::setCurrentIndex
void setCurrentIndex(const QModelIndex &index, QFlags< QItemSelectionModel::SelectionFlag > command)
Kontact::Navigator::updatePlugins
void updatePlugins(QList< KontactInterface::Plugin * > plugins)
Definition: iconsidepane.cpp:348
QStyleOptionViewItemV4
iconsidepane.h
QAbstractItemView::model
QAbstractItemModel * model() const
QAbstractItemView::currentIndex
QModelIndex currentIndex() const
Kontact::SidePaneBase::core
KontactInterface::Core * core() const
Definition: sidepanebase.cpp:37
QItemSelectionModel
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QItemSelectionModel::SelectionFlags
typedef SelectionFlags
QVariant::toString
QString toString() const
QListView::currentChanged
virtual void currentChanged(const QModelIndex &current, const QModelIndex &previous)
Kontact::Navigator::dragEnterEvent
virtual void dragEnterEvent(QDragEnterEvent *event)
Definition: iconsidepane.cpp:406
QAbstractItemView::setDropIndicatorShown
void setDropIndicatorShown(bool enable)
QTimer::singleShot
singleShot
QVariant
QAbstractItemView::setHorizontalScrollMode
void setHorizontalScrollMode(ScrollMode mode)
QStyledItemDelegate
Qt::ItemFlags
typedef ItemFlags
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kontact

Skip menu "kontact"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal