#include <klflibview.h>
Classes | |
struct | PaintPrivate |
Public Slots | |
void | setPreviewSize (const QSize &psize) |
Public Member Functions | |
KLFLibViewDelegate (QObject *parent) | |
virtual | ~KLFLibViewDelegate () |
QSize | previewSize () const |
virtual QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const |
virtual bool | editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) |
virtual void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const |
virtual void | setEditorData (QWidget *editor, const QModelIndex &index) const |
virtual void | setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const |
virtual QSize | sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const |
virtual void | updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const |
virtual void | setSearchString (const QString &s) |
virtual void | setSearchIndex (const QModelIndex &index) |
virtual void | setSelectionModel (QItemSelectionModel *sm) |
virtual void | setTheTreeView (QTreeView *theTreeView) |
virtual bool | autoBackgroundItems () const |
virtual void | setAutoBackgroundItems (bool autoBgItems) |
virtual QColor | autoBackgroundColor () const |
virtual void | setAutoBackgroundColor (const QColor &autoBgColor) |
![]() | |
QAbstractItemDelegate (QObject *parent=0) | |
closeEditor (QWidget *editor, QAbstractItemDelegate::EndEditHint hint=NoHint) | |
commitData (QWidget *editor) | |
createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) | |
editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) | |
helpEvent (QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index) | |
paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) | |
setEditorData (QWidget *editor, const QModelIndex &index) | |
setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) | |
sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) | |
updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) | |
createIndex (int row, int column, int id) | |
Protected Types | |
enum | { PTF_HighlightSearch = 0x0001, PTF_HighlightSearchCurrent = 0x0002, PTF_SelUnderline = 0x0004, PTF_ForceRichTextRender = 0x0008, PTF_FontLarge = 0x0010, PTF_FontTT = 0x0020 } |
Protected Member Functions | |
virtual void | paintEntry (PaintPrivate *p, const QModelIndex &index) const |
virtual void | paintCategoryLabel (PaintPrivate *p, const QModelIndex &index) const |
virtual void | paintText (PaintPrivate *p, const QString &text, uint flags=PTF_HighlightSearch) const |
virtual bool | indexHasSelectedDescendant (const QModelIndex &parent) const |
virtual bool | selectionIntersectsIndexChildren (const QItemSelection &selection, const QModelIndex &parent) const |
virtual bool | func_indexHasSelectedDescendant (const QModelIndex &parent, const QTime &timer, int timeLimitMs) const |
Properties | |
QSize | previewSize |
Friends | |
QDebug & | operator<< (QDebug &, const ColorRegion &) |
Definition at line 649 of file klflibview.h.
|
protected |
Enumerator | |
---|---|
PTF_HighlightSearch | |
PTF_HighlightSearchCurrent | |
PTF_SelUnderline | |
PTF_ForceRichTextRender | |
PTF_FontLarge | |
PTF_FontTT |
Definition at line 708 of file klflibview.h.
KLFLibViewDelegate::KLFLibViewDelegate | ( | QObject * | parent | ) |
Create a view delegate for displaying a KLFLibModel.
parent | the (QObject-)parent of this object. |
Definition at line 2475 of file klflibview.cpp.
|
virtual |
Definition at line 2481 of file klflibview.cpp.
|
inlinevirtual |
Definition at line 689 of file klflibview.h.
|
inlinevirtual |
Definition at line 687 of file klflibview.h.
|
virtual |
Definition at line 2485 of file klflibview.cpp.
|
virtual |
Definition at line 2491 of file klflibview.cpp.
|
protectedvirtual |
implements the core of indexHasSelectedDescendant. use that instead.
Definition at line 2939 of file klflibview.cpp.
References QTime::elapsed(), QAbstractItemModel::hasChildren(), QAbstractItemModel::index(), QModelIndex::isValid(), KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfDbg, QModelIndex::model(), QAbstractItemModel::rowCount(), QItemSelectionModel::selection(), and selectionIntersectsIndexChildren().
Referenced by indexHasSelectedDescendant().
|
protectedvirtual |
Definition at line 2912 of file klflibview.cpp.
References func_indexHasSelectedDescendant(), QModelIndex::isValid(), KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfDbg, and QTime::start().
Referenced by paintCategoryLabel().
|
virtual |
Definition at line 2517 of file klflibview.cpp.
References KLFLibViewDelegate::PaintPrivate::background, QStyleOptionFocusRect::backgroundColor(), KLFLibModel::CategoryLabelKind, QModelIndex::data(), QStyle::drawPrimitive(), KLFLibModel::EntryKind, QPainter::fillRect(), KLFLibViewDelegate::PaintPrivate::innerRectImage, KLFLibViewDelegate::PaintPrivate::innerRectText, KLFLibViewDelegate::PaintPrivate::isselected, QColor::isValid(), KLFLibModel::ItemKindItemRole, KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfDbg, QModelIndex::model(), KLFLibViewDelegate::PaintPrivate::option, KLFLibViewDelegate::PaintPrivate::p, paintCategoryLabel(), paintEntry(), QPainter::pen(), KLFLibModel::resource(), QPainter::restore(), QPainter::save(), QPainter::setPen(), QApplication::style(), and QWidget::style().
|
protectedvirtual |
Definition at line 2673 of file klflibview.cpp.
References KLFLibModel::CategoryLabelItemRole, QModelIndex::column(), QModelIndex::data(), QPainter::fillRect(), indexHasSelectedDescendant(), QTreeView::isExpanded(), KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, KLFLibViewDelegate::PaintPrivate::option, KLFLibViewDelegate::PaintPrivate::p, paintText(), QModelIndex::parent(), QPainter::pen(), PTF_HighlightSearch, PTF_HighlightSearchCurrent, PTF_SelUnderline, QModelIndex::row(), and QPainter::setPen().
Referenced by paint().
|
protectedvirtual |
Definition at line 2581 of file klflibview.cpp.
References KLFLibViewDelegate::PaintPrivate::background, KLFLibEntry::Category, QBrush::color(), QModelIndex::data(), KLFLibEntry::DateTime, QPainter::drawImage(), KLFLibModel::EntryContentsTypeItemRole, KLFLibModel::entryItemRole(), QPainter::fillRect(), KLFConfig::glowEffect, KLFConfig::glowEffectColor, KLFConfig::glowEffectRadius, QRect::height(), image_is_distinguishable(), KLFLibViewDelegate::PaintPrivate::innerRectImage, KLFLibViewDelegate::PaintPrivate::isselected, KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfconfig, klfDbg, klfDrawGlowedImage(), QList::last(), KLFLibEntry::Latex, QList::mid(), KLFLibViewDelegate::PaintPrivate::p, paintText(), QModelIndex::parent(), KLFLibEntry::Preview, PTF_FontLarge, PTF_FontTT, PTF_HighlightSearch, PTF_HighlightSearchCurrent, QPainter::restore(), QModelIndex::row(), QPainter::save(), QImage::scaled(), QRect::size(), QList::size(), KLFLibEntry::Tags, QRect::topLeft(), QLocale::toString(), QPainter::translate(), transparentify_image(), and KLFConfig::UI.
Referenced by paint().
|
protectedvirtual |
Definition at line 2712 of file klflibview.cpp.
References QList::append(), QRect::bottom(), QRectF::bottom(), QRect::bottomLeft(), QTextDocument::drawContents(), QPainter::drawLine(), QPainter::drawText(), QPainter::fillRect(), QStyleOptionViewItem::font(), QRect::height(), QSizeF::height(), QRectF::height(), QSize::height(), QString::indexOf(), KLFLibViewDelegate::PaintPrivate::innerRectText, QTextCursor::insertText(), QString::isEmpty(), KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfconfig, klfDbg, QRectF::left(), QString::length(), QString::mid(), KLFLibViewDelegate::PaintPrivate::option, KLFLibViewDelegate::PaintPrivate::p, KLFConfig::preambleEditFont, PTF_FontLarge, PTF_FontTT, PTF_ForceRichTextRender, PTF_HighlightSearch, PTF_HighlightSearchCurrent, PTF_SelUnderline, QList::removeAt(), QPainter::restore(), QPainter::save(), QColor::setAlpha(), QPainter::setClipRect(), QPainter::setFont(), QTextCharFormat::setFontItalic(), QTextCharFormat::setFontWeight(), QRectF::setLeft(), QPainter::setPen(), QFont::setPointSize(), QSizeF::setWidth(), QFontMetrics::size(), QList::size(), QTextDocument::toHtml(), QRectF::topLeft(), QRect::topLeft(), QPainter::translate(), KLFConfig::UI, QSizeF::width(), QRect::width(), QRectF::width(), and QSize::width().
Referenced by paintCategoryLabel(), and paintEntry().
|
inline |
Definition at line 661 of file klflibview.h.
|
protectedvirtual |
Definition at line 2924 of file klflibview.cpp.
References KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, and klfDbg.
Referenced by func_indexHasSelectedDescendant().
|
inlinevirtual |
Definition at line 690 of file klflibview.h.
|
inlinevirtual |
Definition at line 688 of file klflibview.h.
|
virtual |
Definition at line 2859 of file klflibview.cpp.
|
virtual |
Definition at line 2862 of file klflibview.cpp.
|
inlineslot |
Definition at line 693 of file klflibview.h.
Referenced by KLFLibDefaultView::KLFLibDefaultView(), and KLFLibDefaultView::slotPreviewSizeFromActionSender().
|
inlinevirtual |
Definition at line 675 of file klflibview.h.
Referenced by KLFLibDefaultView::searchAbort().
|
inlinevirtual |
Definition at line 674 of file klflibview.h.
Referenced by KLFLibDefaultView::searchAbort(), and KLFLibDefaultView::searchFind().
|
inlinevirtual |
Definition at line 676 of file klflibview.h.
Referenced by KLFLibDefaultView::updateResourceEngine().
|
inlinevirtual |
If the delegate paints items in a QTreeView, then pass a pointer to it here to display nice selection markings under non-expanded tree items. Pass NULL
to unset any previously set QTreeView pointer.
By default, the internal tree view pointer is set to NULL.
Definition at line 682 of file klflibview.h.
Referenced by KLFLibDefaultView::KLFLibDefaultView().
|
virtual |
Definition at line 2866 of file klflibview.cpp.
References KLFLibEntry::Category, KLFLibModel::CategoryLabelItemRole, KLFLibModel::CategoryLabelKind, QModelIndex::data(), KLFLibEntry::DateTime, KLFLibModel::EntryContentsTypeItemRole, KLFLibModel::entryItemRole(), KLFLibModel::EntryKind, QStyleOptionViewItem::font(), QSize::height(), KLFLibModel::ItemKindItemRole, KLF_DEBUG_TIME_BLOCK, KLF_FUNC_NAME, klfDbg, KLFLibEntry::Latex, KLFLibEntry::Preview, KLFLibEntry::PreviewSize, QSize::scale(), QFontMetrics::size(), KLFLibEntry::Tags, QLocale::toString(), and QSize::width().
|
virtual |
Definition at line 2905 of file klflibview.cpp.
|
friend |
Definition at line 373 of file klflibview.cpp.
|
readwrite |
Definition at line 653 of file klflibview.h.
Referenced by KLFLibDefaultView::slotPreviewSizeActionsRefreshChecked().