#include <klflibview.h>
Public Types | |
enum | ViewType { CategoryTreeView, ListTreeView, IconView } |
Public Slots | |
virtual bool | selectEntries (const QList< KLFLib::entryId > &idList) |
virtual bool | searchFind (const QString &queryString, bool forward=true) |
virtual bool | searchFindNext (bool forward) |
virtual void | searchAbort () |
virtual void | restore (uint restoreflags=KLFLib::RestoreLatexAndStyle) |
virtual void | showColumns (int propIdColumn, bool show) |
virtual void | sortBy (int propIdColumn, Qt::SortOrder sortorder) |
virtual void | slotSelectAll (bool expandItems=false) |
virtual void | slotRefresh () |
virtual void | slotRelayoutIcons () |
void | setPreviewSize (const QSize &size) |
void | setAutoBackgroundItems (bool on) |
void | setAutoBackgroundColor (const QColor &c) |
void | setIconViewFlow (QListView::Flow flow) |
Sets the icon view flow, see QListView::Flow. | |
void | setGroupSubCategories (bool yesOrNo) |
void | updateDisplay () |
Public Member Functions | |
KLFLibDefaultView (QWidget *parent, ViewType viewtype=CategoryTreeView) | |
virtual | ~KLFLibDefaultView () |
virtual QUrl | url () const |
virtual uint | compareUrlTo (const QUrl &other, uint interestFlags=0xFFFFFFFF) const |
QSize | previewSize () const |
bool | groupSubCategories () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *o, QEvent *e) |
virtual KLFLibEntryList | selectedEntries () const |
virtual QList< KLFLib::entryId > | selectedEntryIds () const |
ViewType | viewType () const |
virtual QList< QAction * > | addContextMenuActions (const QPoint &pos) |
virtual QVariantMap | saveGuiState () const |
virtual bool | restoreGuiState (const QVariantMap &state) |
virtual QModelIndex | currentVisibleIndex () const |
The first index that is currently visible in the current scrolling position. | |
bool | autoBackgroundItems () const |
QColor | autoBackgroundColor () const |
QListView::Flow | iconViewFlow () const |
virtual QStringList | getCategorySuggestions () |
virtual KLFSearchable * | searchable () |
Protected Types | |
enum | SelectAllFlags { ExpandItems = 0x01, NoSignals = 0x02 } |
Protected Slots | |
void | slotViewSelectionChanged (const QItemSelection &selected, const QItemSelection &deselected) |
virtual void | slotSelectAll (const QModelIndex &parent, uint selectFlags) |
void | slotViewItemClicked (const QModelIndex &index) |
void | slotEntryDoubleClicked (const QModelIndex &index) |
void | slotShowColumnSenderAction (bool showCol) |
void | slotResourceDataChanged (const QModelIndex &topLeft, const QModelIndex &botRight) |
void | slotPreviewSizeFromActionSender () |
void | slotPreviewSizeActionsRefreshChecked () |
Protected Member Functions | |
virtual void | updateResourceEngine () |
virtual void | updateResourceProp (int propId) |
virtual void | updateResourceData (const QString &subRes, int modifyType, const QList< KLFLib::entryId > &entryIdList) |
virtual void | updateResourceOwnData (const QList< KLFLib::entryId > &entryIdList) |
virtual void | showEvent (QShowEvent *event) |
KLF_DEBUG_DECLARE_REF_INSTANCE (QFileInfo(url().path()).fileName()+":"+(resourceEngine()?resourceEngine()->defaultSubResource():"[NULL]")+"|viewtype="+QString::number(pViewType)) | |
Properties | |
bool | autoBackgroundItems |
QColor | autoBackgroundColor |
QListView::Flow | iconViewFlow |
QSize | previewSize |
An implementation of the KLFAbstractLibView viwer to view library resource contents in so-called Category, List or Icon view modes.
Definition at line 753 of file klflibview.h.
enum KLFLibDefaultView::SelectAllFlags [protected] |
Definition at line 847 of file klflibview.h.
Definition at line 764 of file klflibview.h.
Definition at line 2982 of file klflibview.cpp.
References CategoryTreeView, KLFConfig::iconPreviewSizePercent, IconView, KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfconfig, klfDbg, KLFConfig::labelOutputFixedSize, KLFConfig::LibraryBrowser, KLFConfig::listPreviewSizePercent, ListTreeView, QAbstractItemView::setItemDelegate(), KLFLibViewDelegate::setPreviewSize(), KLFLibViewDelegate::setTheTreeView(), slotEntryDoubleClicked(), slotViewItemClicked(), KLFConfig::treePreviewSizePercent, and KLFConfig::UI.
KLFLibDefaultView::~KLFLibDefaultView | ( | ) | [virtual] |
Definition at line 3062 of file klflibview.cpp.
Reimplemented from KLFAbstractLibView.
Definition at line 3203 of file klflibview.cpp.
References CategoryTreeView, IconView, and ListTreeView.
QColor KLFLibDefaultView::autoBackgroundColor | ( | ) | const [inline] |
Definition at line 792 of file klflibview.h.
bool KLFLibDefaultView::autoBackgroundItems | ( | ) | const [inline] |
Definition at line 791 of file klflibview.h.
uint KLFLibDefaultView::compareUrlTo | ( | const QUrl & | other, |
uint | interestFlags = 0xFFFFFFFF |
||
) | const [virtual] |
Implements KLFAbstractLibView.
Definition at line 3074 of file klflibview.cpp.
References KLFLibResourceEngine::compareDefaultSubResourceEquals(), KLFLibResourceEngine::compareUrlTo(), KLFLibResourceEngine::FeatureSubResources, QUrl::hasQueryItem(), klfDbg, klfFmtCC, KlfUrlCompareBaseEqual, KlfUrlCompareEqual, KlfUrlCompareLessSpecific, KlfUrlCompareMoreSpecific, QUrl::queryItemValue(), KLFAbstractLibView::resourceEngine(), and KLFLibResourceEngine::supportedFeatureFlags().
QModelIndex KLFLibDefaultView::currentVisibleIndex | ( | ) | const [virtual] |
The first index that is currently visible in the current scrolling position.
Definition at line 3247 of file klflibview.cpp.
References CategoryTreeView, KLFLibDefViewCommon::curVisibleIndex(), IconView, KLF_ASSERT_NOT_NULL, and ListTreeView.
Referenced by searchFind().
bool KLFLibDefaultView::event | ( | QEvent * | e | ) | [virtual] |
Reimplemented from QWidget.
Definition at line 3146 of file klflibview.cpp.
Definition at line 3150 of file klflibview.cpp.
References QKeyEvent::key(), klfDbg, QList::size(), QAction::trigger(), and QEvent::type().
QStringList KLFLibDefaultView::getCategorySuggestions | ( | ) | [virtual] |
Implements KLFAbstractLibView.
Definition at line 3477 of file klflibview.cpp.
References KLFLibModel::categoryList().
bool KLFLibDefaultView::groupSubCategories | ( | ) | const [inline] |
Definition at line 773 of file klflibview.h.
QListView::Flow KLFLibDefaultView::iconViewFlow | ( | ) | const |
KLFLibDefaultView::KLF_DEBUG_DECLARE_REF_INSTANCE | ( | ) | [protected] |
QSize KLFLibDefaultView::previewSize | ( | ) | const [inline] |
Definition at line 771 of file klflibview.h.
Referenced by saveGuiState().
void KLFLibDefaultView::restore | ( | uint | restoreflags = KLFLib::RestoreLatexAndStyle | ) | [virtual, slot] |
Implements KLFAbstractLibView.
Definition at line 3527 of file klflibview.cpp.
References KLFLibModel::FullEntryItemRole, and KLFAbstractLibView::requestRestore().
bool KLFLibDefaultView::restoreGuiState | ( | const QVariantMap & | state | ) | [virtual] |
Implements KLFAbstractLibView.
Definition at line 3231 of file klflibview.cpp.
References CategoryTreeView, QTreeView::header(), IconView, KLF_ASSERT_NOT_NULL, ListTreeView, and setPreviewSize().
QVariantMap KLFLibDefaultView::saveGuiState | ( | ) | const [virtual] |
Implements KLFAbstractLibView.
Definition at line 3216 of file klflibview.cpp.
References CategoryTreeView, QTreeView::header(), IconView, KLF_ASSERT_NOT_NULL, ListTreeView, and previewSize().
virtual KLFSearchable* KLFLibDefaultView::searchable | ( | ) | [inline, virtual] |
Reimplemented from KLFAbstractLibView.
Definition at line 798 of file klflibview.h.
void KLFLibDefaultView::searchAbort | ( | ) | [virtual, slot] |
Implements KLFSearchable.
Definition at line 3737 of file klflibview.cpp.
References KLFLibModel::searchAbort(), KLFLibViewDelegate::setSearchIndex(), KLFLibViewDelegate::setSearchString(), and updateDisplay().
bool KLFLibDefaultView::searchFind | ( | const QString & | queryString, |
bool | forward = true |
||
) | [virtual, slot] |
Implements KLFSearchable.
Definition at line 3717 of file klflibview.cpp.
References currentVisibleIndex(), QModelIndex::isValid(), KLFLibModel::searchFind(), KLFLibViewDelegate::setSearchString(), and KLFLibModel::walkPrevIndex().
bool KLFLibDefaultView::searchFindNext | ( | bool | forward | ) | [virtual, slot] |
Implements KLFSearchable.
Definition at line 3730 of file klflibview.cpp.
References QModelIndex::isValid(), and KLFLibModel::searchFindNext().
KLFLibEntryList KLFLibDefaultView::selectedEntries | ( | ) | const [virtual] |
Implements KLFAbstractLibView.
Definition at line 3187 of file klflibview.cpp.
References KLFLibModel::EntryKind, KLFLibModel::FullEntryItemRole, KLFLibModel::ItemKindItemRole, klfDbg, KLFLibEntry::latex(), and KLFLibEntry::tags().
Referenced by slotSelectAll(), and slotViewSelectionChanged().
QList< KLFLib::entryId > KLFLibDefaultView::selectedEntryIds | ( | ) | const [virtual] |
Implements KLFAbstractLibView.
Definition at line 3174 of file klflibview.cpp.
References QList::contains(), KLFLibModel::entryIdForIndexList(), QAbstractItemView::selectionModel(), and QList::size().
bool KLFLibDefaultView::selectEntries | ( | const QList< KLFLib::entryId > & | idList | ) | [virtual, slot] |
Implements KLFAbstractLibView.
Definition at line 3506 of file klflibview.cpp.
References CategoryTreeView, KLFLibDefTreeView::ensureExpandedTo(), KLFLibModel::findEntryIdList(), klfDbg, and QAbstractItemView::selectionModel().
void KLFLibDefaultView::setAutoBackgroundColor | ( | const QColor & | c | ) | [inline, slot] |
Definition at line 825 of file klflibview.h.
void KLFLibDefaultView::setAutoBackgroundItems | ( | bool | on | ) | [inline, slot] |
Definition at line 824 of file klflibview.h.
void KLFLibDefaultView::setGroupSubCategories | ( | bool | yesOrNo | ) | [inline, slot] |
Definition at line 834 of file klflibview.h.
Referenced by KLFLibBrowserViewContainer::openView(), and updateResourceEngine().
void KLFLibDefaultView::setIconViewFlow | ( | QListView::Flow | flow | ) | [slot] |
Sets the icon view flow, see QListView::Flow.
Has no effect if our view type is not icon view.
Definition at line 3699 of file klflibview.cpp.
References IconView, and KLF_ASSERT_NOT_NULL.
void KLFLibDefaultView::setPreviewSize | ( | const QSize & | size | ) | [inline, slot] |
Definition at line 822 of file klflibview.h.
Referenced by restoreGuiState().
void KLFLibDefaultView::showColumns | ( | int | propIdColumn, |
bool | show | ||
) | [virtual, slot] |
Definition at line 3540 of file klflibview.cpp.
References KLFLibModel::columnForEntryPropertyId(), KLFAbstractLibView::resourceEngine(), and url().
void KLFLibDefaultView::showEvent | ( | QShowEvent * | event | ) | [protected, virtual] |
Reimplemented from QWidget.
Definition at line 3455 of file klflibview.cpp.
References KLFLibModel::setFetchBatchCount().
void KLFLibDefaultView::slotEntryDoubleClicked | ( | const QModelIndex & | index | ) | [protected, slot] |
Definition at line 3860 of file klflibview.cpp.
References QModelIndex::data(), KLFLibModel::EntryKind, KLFLibModel::FullEntryItemRole, KLFLibModel::ItemKindItemRole, KLFAbstractLibView::requestRestore(), KLFLib::RestoreLatex, and KLFLib::RestoreStyle.
Referenced by KLFLibDefaultView().
void KLFLibDefaultView::slotPreviewSizeActionsRefreshChecked | ( | ) | [protected, slot] |
Definition at line 3662 of file klflibview.cpp.
References QList::begin(), QAction::data(), QList::end(), KLF_ASSERT_NOT_NULL, KLF_DEBUG_BLOCK, KLF_FUNC_NAME, klfconfig, klfDbg, KLFConfig::labelOutputFixedSize, KLFLibViewDelegate::previewSize, QList::size(), KLFConfig::UI, and QSize::width().
Referenced by slotPreviewSizeFromActionSender(), and updateResourceEngine().
void KLFLibDefaultView::slotPreviewSizeFromActionSender | ( | ) | [protected, slot] |
Definition at line 3650 of file klflibview.cpp.
References QAction::data(), KLF_ASSERT_NOT_NULL, KLF_DEBUG_BLOCK, KLF_FUNC_NAME, klfconfig, KLFConfig::labelOutputFixedSize, QAbstractItemView::reset(), KLFLibViewDelegate::setPreviewSize(), slotPreviewSizeActionsRefreshChecked(), and KLFConfig::UI.
Referenced by updateResourceEngine().
void KLFLibDefaultView::slotRefresh | ( | ) | [virtual, slot] |
Definition at line 3644 of file klflibview.cpp.
References KLFLibModel::completeRefresh(), KLF_DEBUG_BLOCK, and KLF_FUNC_NAME.
Referenced by updateResourceEngine().
void KLFLibDefaultView::slotRelayoutIcons | ( | ) | [virtual, slot] |
Definition at line 3689 of file klflibview.cpp.
References KLFLibDefListView::forceRelayout(), and IconView.
Referenced by updateResourceEngine().
void KLFLibDefaultView::slotResourceDataChanged | ( | const QModelIndex & | topLeft, |
const QModelIndex & | botRight | ||
) | [protected, slot] |
Definition at line 3784 of file klflibview.cpp.
References KLFLibModel::entryIdForIndexList(), QItemSelectionRange::indexes(), and KLFAbstractLibView::resourceDataChanged().
Referenced by updateResourceEngine().
void KLFLibDefaultView::slotSelectAll | ( | const QModelIndex & | parent, |
uint | selectFlags | ||
) | [protected, virtual, slot] |
Selects all children of parent
(by default a QModelIndex(), so this function selects all items).
selectFlags is an OR'ed combination of SelectAllFlags. If ExpandItems is set then all items in the view are expanded (no effect if the view is not a tree view).
Definition at line 3575 of file klflibview.cpp.
References KLFAbstractLibView::entriesSelected(), NoSignals, selectedEntries(), QAbstractItemView::selectionModel(), KLFDelayedPleaseWaitPopup::setDelay(), KLFPleaseWaitPopup::setDisableUi(), QTime::start(), and updateDisplay().
void KLFLibDefaultView::slotSelectAll | ( | bool | expandItems = false | ) | [virtual, slot] |
Selects all items in the view, fetching all necessary items (this can be slow). If expandItems
is TRUE, then all items in this view (category labels) are expanded (no effect if this view is not a tree view).
Definition at line 3570 of file klflibview.cpp.
References ExpandItems, NoSignals, and updateDisplay().
Referenced by KLFLibDefTreeView::selectAll(), slotViewItemClicked(), and updateResourceEngine().
void KLFLibDefaultView::slotShowColumnSenderAction | ( | bool | showCol | ) | [protected, slot] |
Definition at line 3877 of file klflibview.cpp.
References QObject::property().
Referenced by updateResourceEngine().
void KLFLibDefaultView::slotViewItemClicked | ( | const QModelIndex & | index | ) | [protected, slot] |
Definition at line 3842 of file klflibview.cpp.
References QModelIndex::column(), KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, and slotSelectAll().
Referenced by KLFLibDefaultView().
void KLFLibDefaultView::slotViewSelectionChanged | ( | const QItemSelection & | selected, |
const QItemSelection & | deselected | ||
) | [protected, slot] |
Definition at line 3772 of file klflibview.cpp.
References KLFAbstractLibView::entriesSelected(), selectedEntries(), and updateDisplay().
Referenced by updateResourceEngine().
void KLFLibDefaultView::sortBy | ( | int | propIdColumn, |
Qt::SortOrder | sortorder | ||
) | [virtual, slot] |
Definition at line 3551 of file klflibview.cpp.
References KLFLibModel::columnCount(), KLFLibModel::columnForEntryPropertyId(), KLFAbstractLibView::resourceEngine(), QTreeView::sortByColumn(), and url().
void KLFLibDefaultView::updateDisplay | ( | ) | [slot] |
Definition at line 3711 of file klflibview.cpp.
References KLF_ASSERT_NOT_NULL, and QAbstractItemView::update().
Referenced by searchAbort(), slotSelectAll(), and slotViewSelectionChanged().
void KLFLibDefaultView::updateResourceData | ( | const QString & | subRes, |
int | modifyType, | ||
const QList< KLFLib::entryId > & | entryIdList | ||
) | [protected, virtual] |
Implements KLFAbstractLibView.
Definition at line 3426 of file klflibview.cpp.
References KLF_ASSERT_NOT_NULL, klfDbg, KLFAbstractLibView::resourceEngine(), KLFLibModel::updateData(), and updateResourceOwnData().
void KLFLibDefaultView::updateResourceEngine | ( | ) | [protected, virtual] |
Implements KLFAbstractLibView.
Definition at line 3273 of file klflibview.cpp.
References QMenu::addAction(), KLFLibEntry::Category, KLFLibModel::CategoryTree, CategoryTreeView, QList::clear(), QTreeView::columnWidth(), KLFLibEntry::DateTime, QTreeView::expand(), KLFLibModel::GroupSubCategories, KLFConfig::groupSubCategories, IconView, QTreeView::isColumnHidden(), KLF_DEBUG_ASSIGN_SAME_REF_INSTANCE, KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfconfig, klfDbg, klfFmtCC, KLFLibEntry::Latex, KLFConfig::LibraryBrowser, KLFLibModel::LinearList, ListTreeView, KLFAbstractLibView::operationStartReportingProgress(), KLFLibEntry::Preview, QTreeView::resizeColumnToContents(), KLFAbstractLibView::resourceEngine(), QAbstractItemView::selectionModel(), QTreeView::setColumnHidden(), QTreeView::setColumnWidth(), QAction::setData(), setGroupSubCategories(), QAction::setMenu(), QAbstractItemView::setModel(), KLFLibViewDelegate::setSelectionModel(), QList::size(), slotPreviewSizeActionsRefreshChecked(), slotPreviewSizeFromActionSender(), slotRefresh(), slotRelayoutIcons(), slotResourceDataChanged(), slotSelectAll(), slotShowColumnSenderAction(), slotViewSelectionChanged(), KLFLibEntry::Tags, updateResourceOwnData(), updateResourceProp(), and KLFAbstractLibView::wantMoreCategorySuggestions().
void KLFLibDefaultView::updateResourceOwnData | ( | const QList< KLFLib::entryId > & | entryIdList | ) | [protected, virtual] |
Definition at line 3438 of file klflibview.cpp.
References IconView, KLF_FUNC_NAME, and klfDbg.
Referenced by updateResourceData(), and updateResourceEngine().
void KLFLibDefaultView::updateResourceProp | ( | int | propId | ) | [protected, virtual] |
Implements KLFAbstractLibView.
Definition at line 3446 of file klflibview.cpp.
References KLF_ASSERT_NOT_NULL, klfDbg, and KLFAbstractLibView::resourceEngine().
Referenced by updateResourceEngine().
QUrl KLFLibDefaultView::url | ( | ) | const [virtual] |
Implements KLFAbstractLibView.
Definition at line 3066 of file klflibview.cpp.
References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and KLFLibModel::url().
Referenced by showColumns(), and sortBy().
ViewType KLFLibDefaultView::viewType | ( | ) | const [inline] |
Definition at line 781 of file klflibview.h.
QColor KLFLibDefaultView::autoBackgroundColor [read, write] |
Definition at line 756 of file klflibview.h.
bool KLFLibDefaultView::autoBackgroundItems [read, write] |
Definition at line 756 of file klflibview.h.
QListView::Flow KLFLibDefaultView::iconViewFlow [read, write] |
Definition at line 757 of file klflibview.h.
QSize KLFLibDefaultView::previewSize [read, write] |
Definition at line 759 of file klflibview.h.