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

KDEUI

KBreadcrumbSelectionModel Class Reference

Selects the parents of selected items to create breadcrumbs. More...

#include <kbreadcrumbselectionmodel.h>


Detailed Description

Selects the parents of selected items to create breadcrumbs.

For example, if the tree is

    - A
    - B
    - - C
    - - D
    - - - E
    - - - - F
  

and E is selected, the selection can contain

    - B
    - D
  

or

    - B
    - D
    - E
  

if isActualSelectionIncluded is true.

The depth of the selection may also be set. For example if the breadcrumbLength is 1:

    - D
    - E
  

And if breadcrumbLength is 2:

    - B
    - D
    - E
  

A KBreadcrumbsProxyModel with a breadcrumbLength of 0 and including the actual selection is the same as a KSelectionProxyModel in the KSelectionProxyModel::ExactSelection configuration.

    view1->setModel(rootModel);

    QItemSelectionModel *breadcrumbSelectionModel = new QItemSelectionModel(rootModel, this);

    KBreadcrumbSelectionModel *breadcrumbProxySelector = new KBreadcrumbSelectionModel(breadcrumbSelectionModel, rootModel, this);

    view1->setSelectionModel(breadcrumbProxySelector);

    KSelectionProxyModel *breadcrumbSelectionProxyModel = new KSelectionProxyModel( breadcrumbSelectionModel, this);
    breadcrumbSelectionProxyModel->setSourceModel( rootModel );
    breadcrumbSelectionProxyModel->setFilterBehavior( KSelectionProxyModel::ExactSelection );

    view2->setModel(breadcrumbSelectionProxyModel);
kbreadcrumbselectionmodel.png

KBreadcrumbSelectionModel in several configurations

This can work in two directions. One option is for a single selection in the KBreadcrumbSelectionModel to invoke the breadcrumb selection in its constructor argument.

The other is for a selection in the itemselectionmodel in the constructor argument to cause a breadcrumb selection in this.

Since:
4.5

Definition at line 30 of file kbreadcrumbselectionmodel.h.


The documentation for this class was generated from the following file:
  • kbreadcrumbselectionmodel.h

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.3
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal