MessageList::Core::ThemeDelegate

MessageList::Core::ThemeDelegate Class Referenceabstract

#include <themedelegate.h>

Inheritance diagram for MessageList::Core::ThemeDelegate:

Public Member Functions

 ThemeDelegate (QAbstractItemView *parent)
 
void generalFontChanged ()
 
const Theme::ColumnhitColumn () const
 
int hitColumnIndex () const
 
const Theme::ContentItemhitContentItem () const
 
QRect hitContentItemRect () const
 
bool hitContentItemRight () const
 
const QModelIndexhitIndex () const
 
ItemhitItem () const
 
QRect hitItemRect () const
 
const Theme::RowhitRow () const
 
int hitRowIndex () const
 
bool hitRowIsMessageRow () const
 
QRect hitRowRect () const
 
bool hitTest (const QPoint &viewportPoint, bool exact=true)
 
void setTheme (const Theme *theme)
 
QSize sizeHintForItemTypeAndColumn (Item::Type type, int column, const Item *item=nullptr) const
 
const Themetheme () const
 
- Public Member Functions inherited from QStyledItemDelegate
 QStyledItemDelegate (QObject *parent)
 
virtual QWidgetcreateEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const const override
 
virtual QString displayText (const QVariant &value, const QLocale &locale) const const
 
QItemEditorFactoryitemEditorFactory () const const
 
virtual void setEditorData (QWidget *editor, const QModelIndex &index) const const override
 
void setItemEditorFactory (QItemEditorFactory *factory)
 
virtual void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const const override
 
virtual void updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const const override
 
- Public Member Functions inherited from QAbstractItemDelegate
 QAbstractItemDelegate (QObject *parent)
 
void closeEditor (QWidget *editor, QAbstractItemDelegate::EndEditHint hint)
 
void commitData (QWidget *editor)
 
virtual void destroyEditor (QWidget *editor, const QModelIndex &index) const const
 
virtual bool helpEvent (QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index)
 
void sizeHintChanged (const QModelIndex &index)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Protected Member Functions

virtual ItemitemFromIndex (const QModelIndex &index) const =0
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
QSize sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const override
 
- Protected Member Functions inherited from QStyledItemDelegate
virtual bool editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override
 
virtual bool eventFilter (QObject *editor, QEvent *event) override
 
virtual void initStyleOption (QStyleOptionViewItem *option, const QModelIndex &index) const const
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Public Types inherited from QAbstractItemDelegate
enum  EndEditHint
 
- Properties inherited from QObject
 objectName
 
- Static Public Member Functions inherited from QAbstractItemDelegate
QString elidedText (const QFontMetrics &fontMetrics, int width, Qt::TextElideMode mode, const QString &text)
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QAbstractItemDelegate
 EditNextItem
 
 EditPreviousItem
 
 NoHint
 
 RevertModelCache
 
 SubmitModelCache
 
- Public Attributes inherited from QObject
typedef QObjectList
 

Detailed Description

The ThemeDelegate paints the message list view message and group items by using the supplied Theme.

Definition at line 29 of file themedelegate.h.

Member Function Documentation

void ThemeDelegate::generalFontChanged ( )

Called when the global fonts change (from systemsettings)

Definition at line 1689 of file themedelegate.cpp.

const Theme::Column * ThemeDelegate::hitColumn ( ) const

Returns the theme column that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function.

Definition at line 1565 of file themedelegate.cpp.

int ThemeDelegate::hitColumnIndex ( ) const

Returns the index of the theme column that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function. This is the same as hitIndex().column().

Definition at line 1570 of file themedelegate.cpp.

const Theme::ContentItem * ThemeDelegate::hitContentItem ( ) const

Returns the theme content item that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function. This function may also return a null content item when hitTest() returned true. This means that the item was globally hit but no content item was exactly hit (the user might have clicked inside a blank unused space instead).

Definition at line 1595 of file themedelegate.cpp.

QRect ThemeDelegate::hitContentItemRect ( ) const

Returns the bounding rect of the content item that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function. The result of this function is to be considered invalid also when hitContentItem() returns 0.

Definition at line 1605 of file themedelegate.cpp.

bool ThemeDelegate::hitContentItemRight ( ) const

Returns true if the hit theme content item was a right item and false otherwise.

The result of this function is valid only if hitContentItem() returns true.

Definition at line 1600 of file themedelegate.cpp.

const QModelIndex & ThemeDelegate::hitIndex ( ) const

Returns the model index that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function.

Definition at line 1550 of file themedelegate.cpp.

Item * ThemeDelegate::hitItem ( ) const

Returns the Item that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function.

Definition at line 1555 of file themedelegate.cpp.

QRect ThemeDelegate::hitItemRect ( ) const

Returns the visual rectangle of the item that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function. Please note that this rectangle refers to a specific item column (and not all of the columns).

Definition at line 1560 of file themedelegate.cpp.

const Theme::Row * ThemeDelegate::hitRow ( ) const

Returns the theme row that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function. This function may also return a null row when hitTest() returned true. This means that the item was globally hit but no row was exactly hit (the user probably hit the margin instead).

Definition at line 1575 of file themedelegate.cpp.

int ThemeDelegate::hitRowIndex ( ) const

Returns the index of the theme row that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitRow() returns a non null value.

Definition at line 1580 of file themedelegate.cpp.

bool ThemeDelegate::hitRowIsMessageRow ( ) const

Returns true if the hitRow() is a message row, false otherwise.

The result of this function has a meaning only if hitRow() returns a non zero result.

Definition at line 1590 of file themedelegate.cpp.

QRect ThemeDelegate::hitRowRect ( ) const

Returns the rectangle of the row that was reported as hit by the previous call to hitTest().

The result of this function is valid only if hitTest() returned true and only within the same calling function. The result of this function is also invalid if hitRow() returns 0.

Definition at line 1585 of file themedelegate.cpp.

bool ThemeDelegate::hitTest ( const QPoint viewportPoint,
bool  exact = true 
)

Performs a hit test on the specified viewport point.

Returns true if the point hit something and false otherwise. When the hit test is successful then the hitIndex(), hitItem(), hitColumn(), hitRow(), and hitContentItem() function will return information about the item that was effectively hit. If exact is set to true then hitTest() will return true only if the viewportPoint is exactly over an item. If exact is set to false then the hitTest() function will do its best to find the closest object to be actually "hit": this is useful, for example, in drag and drop operations.

Definition at line 1143 of file themedelegate.cpp.

virtual Item* MessageList::Core::ThemeDelegate::itemFromIndex ( const QModelIndex index) const
protectedpure virtual

Returns the Item for the specified model index.

Pure virtual: must be reimplemented by derived classes.

void ThemeDelegate::paint ( QPainter painter,
const QStyleOptionViewItem option,
const QModelIndex index 
) const
overrideprotectedvirtual

Reimplemented from QStyledItemDelegate.

Reimplemented from QStyledItemDelegate.

Definition at line 535 of file themedelegate.cpp.

QSize ThemeDelegate::sizeHint ( const QStyleOptionViewItem option,
const QModelIndex index 
) const
overrideprotectedvirtual

Reimplemented from QStyledItemDelegate.

Reimplemented from QStyledItemDelegate.

Definition at line 1660 of file themedelegate.cpp.

QSize ThemeDelegate::sizeHintForItemTypeAndColumn ( Item::Type  type,
int  column,
const Item item = nullptr 
) const

Returns a heuristic sizeHint() for the specified item type and column.

The hint is based on the contents of the theme (and not of any message or group header).

Definition at line 1610 of file themedelegate.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Aug 8 2020 23:11:30 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.