KGantt::ItemDelegate

Search for usage in LXR

#include <KGanttItemDelegate>

Inheritance diagram for KGantt::ItemDelegate:

Public Types

enum  InteractionState {
  State_None = 0 , State_Move , State_ExtendLeft , State_ExtendRight ,
  State_DragConstraint
}
 
- Public Types inherited from QAbstractItemDelegate
enum  EndEditHint
 
- Public Types inherited from QObject
typedef  QObjectList
 

Public Member Functions

 ItemDelegate (QObject *parent=nullptr)
 
 ~ItemDelegate () override
 
virtual QRectF constraintBoundingRect (const QPointF &start, const QPointF &end, const Constraint &constraint) const
 
QBrush defaultBrush (ItemType type) const
 
QPen defaultPen (ItemType type) const
 
virtual InteractionState interactionStateFor (const QPointF &pos, const StyleOptionGanttItem &opt, const QModelIndex &idx) const
 
virtual Span itemBoundingSpan (const StyleOptionGanttItem &opt, const QModelIndex &idx) const
 
virtual void paintConstraintItem (QPainter *p, const QStyleOptionGraphicsItem &opt, const QPointF &start, const QPointF &end, const Constraint &constraint)
 
virtual void paintGanttItem (QPainter *p, const StyleOptionGanttItem &opt, const QModelIndex &idx)
 
void setDefaultBrush (ItemType type, const QBrush &brush)
 
void setDefaultPen (ItemType type, const QPen &pen)
 
virtual QString toolTip (const QModelIndex &idx) const
 
- Public Member Functions inherited from QItemDelegate
 QItemDelegate (QObject *parent)
 
virtual QWidgetcreateEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const const override
 
bool hasClipping () const const
 
QItemEditorFactoryitemEditorFactory () const const
 
virtual void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const const override
 
void setClipping (bool clip)
 
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 QSize sizeHint (const QStyleOptionViewItem &option, 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)
 
QBindable< QStringbindableObjectName ()
 
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 () const const
 
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 QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
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_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 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
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Protected Member Functions

QPolygonF finishFinishArrow (const QPointF &start, const QPointF &end) const
 
QPolygonF finishFinishLine (const QPointF &start, const QPointF &end) const
 
QPolygonF finishStartArrow (const QPointF &start, const QPointF &end) const
 
QPolygonF finishStartLine (const QPointF &start, const QPointF &end) const
 
void paintFinishFinishConstraint (QPainter *p, const QStyleOptionGraphicsItem &opt, const QPointF &start, const QPointF &end, const Constraint &constraint)
 
void paintFinishStartConstraint (QPainter *p, const QStyleOptionGraphicsItem &opt, const QPointF &start, const QPointF &end, const Constraint &constraint)
 
void paintStartFinishConstraint (QPainter *p, const QStyleOptionGraphicsItem &opt, const QPointF &start, const QPointF &end, const Constraint &constraint)
 
void paintStartStartConstraint (QPainter *p, const QStyleOptionGraphicsItem &opt, const QPointF &start, const QPointF &end, const Constraint &constraint)
 
QPolygonF startFinishArrow (const QPointF &start, const QPointF &end) const
 
QPolygonF startFinishLine (const QPointF &start, const QPointF &end) const
 
QPolygonF startStartArrow (const QPointF &start, const QPointF &end) const
 
QPolygonF startStartLine (const QPointF &start, const QPointF &end) const
 
- Protected Member Functions inherited from QItemDelegate
void drawBackground (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const const
 
virtual void drawCheck (QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, Qt::CheckState state) const const
 
virtual void drawDecoration (QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QPixmap &pixmap) const const
 
virtual void drawDisplay (QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QString &text) const const
 
virtual void drawFocus (QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect) const const
 
virtual bool editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override
 
virtual bool eventFilter (QObject *editor, QEvent *event) override
 
- 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

- Properties inherited from QItemDelegate
 clipping
 
- Properties inherited from QObject
 objectName
 
- 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 *context, Functor functor, 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)
 
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, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
- Public Attributes inherited from QAbstractItemDelegate
 EditNextItem
 
 EditPreviousItem
 
 NoHint
 
 RevertModelCache
 
 SubmitModelCache
 

Detailed Description

Class used to render gantt items in a KGantt::GraphicsView.

Member Enumeration Documentation

◆ InteractionState

enum KGantt::ItemDelegate::InteractionState

Definition at line 38 of file kganttitemdelegate.h.

Constructor & Destructor Documentation

◆ ItemDelegate()

ItemDelegate::ItemDelegate ( QObject * parent = nullptr)
explicit

Constructor. Creates an ItemDelegate with parent parent

Definition at line 95 of file kganttitemdelegate.cpp.

◆ ~ItemDelegate()

ItemDelegate::~ItemDelegate ( )
override

Destructor

Definition at line 101 of file kganttitemdelegate.cpp.

Member Function Documentation

◆ constraintBoundingRect()

QRectF ItemDelegate::constraintBoundingRect ( const QPointF & start,
const QPointF & end,
const Constraint & constraint ) const
virtual
Returns
The bounding rectangle for the graphics used to represent a constraint between points start and end (typically an arrow)

Definition at line 342 of file kganttitemdelegate.cpp.

◆ defaultBrush()

QBrush ItemDelegate::defaultBrush ( ItemType type) const
Returns
The default brush for item type type
Todo
Move this to GraphicsView to make delegate stateless.

Definition at line 115 of file kganttitemdelegate.cpp.

◆ defaultPen()

QPen ItemDelegate::defaultPen ( ItemType type) const
Returns
The default pen for item type type
Todo
Move this to GraphicsView to make delegate stateless.

Definition at line 127 of file kganttitemdelegate.cpp.

◆ finishFinishArrow()

QPolygonF ItemDelegate::finishFinishArrow ( const QPointF & start,
const QPointF & end ) const
protected

Definition at line 465 of file kganttitemdelegate.cpp.

◆ finishFinishLine()

QPolygonF ItemDelegate::finishFinishLine ( const QPointF & start,
const QPointF & end ) const
protected

Definition at line 443 of file kganttitemdelegate.cpp.

◆ finishStartArrow()

QPolygonF ItemDelegate::finishStartArrow ( const QPointF & start,
const QPointF & end ) const
protected

Definition at line 419 of file kganttitemdelegate.cpp.

◆ finishStartLine()

QPolygonF ItemDelegate::finishStartLine ( const QPointF & start,
const QPointF & end ) const
protected

Definition at line 397 of file kganttitemdelegate.cpp.

◆ interactionStateFor()

ItemDelegate::InteractionState ItemDelegate::interactionStateFor ( const QPointF & pos,
const StyleOptionGanttItem & opt,
const QModelIndex & idx ) const
virtual
Returns
The interaction state for position pos on item idx when rendered with options opt. This is used to tell the view about how the item should react to mouse click/drag.

Override to implement new items or interactions.

Definition at line 181 of file kganttitemdelegate.cpp.

◆ itemBoundingSpan()

Span ItemDelegate::itemBoundingSpan ( const StyleOptionGanttItem & opt,
const QModelIndex & idx ) const
virtual
Returns
The bounding Span for the item identified by idx when rendered with options opt. This is often the same as the span given by the AbstractGrid for idx, but it might be larger in case there are additional texts or decorations on the item.

Override this to implement new itemtypes or to change the look of the existing ones.

Definition at line 148 of file kganttitemdelegate.cpp.

◆ paintConstraintItem()

void ItemDelegate::paintConstraintItem ( QPainter * p,
const QStyleOptionGraphicsItem & opt,
const QPointF & start,
const QPointF & end,
const Constraint & constraint )
virtual

Paints the constraint between points start and end using painter and opt.

Todo
Review opt's type

Definition at line 364 of file kganttitemdelegate.cpp.

◆ paintFinishFinishConstraint()

void ItemDelegate::paintFinishFinishConstraint ( QPainter * p,
const QStyleOptionGraphicsItem & opt,
const QPointF & start,
const QPointF & end,
const Constraint & constraint )
protected

Definition at line 430 of file kganttitemdelegate.cpp.

◆ paintFinishStartConstraint()

void ItemDelegate::paintFinishStartConstraint ( QPainter * p,
const QStyleOptionGraphicsItem & opt,
const QPointF & start,
const QPointF & end,
const Constraint & constraint )
protected

Definition at line 384 of file kganttitemdelegate.cpp.

◆ paintGanttItem()

void ItemDelegate::paintGanttItem ( QPainter * p,
const StyleOptionGanttItem & opt,
const QModelIndex & idx )
virtual

Paints the gantt item idx using painter and opt

Definition at line 215 of file kganttitemdelegate.cpp.

◆ paintStartFinishConstraint()

void ItemDelegate::paintStartFinishConstraint ( QPainter * p,
const QStyleOptionGraphicsItem & opt,
const QPointF & start,
const QPointF & end,
const Constraint & constraint )
protected

Definition at line 522 of file kganttitemdelegate.cpp.

◆ paintStartStartConstraint()

void ItemDelegate::paintStartStartConstraint ( QPainter * p,
const QStyleOptionGraphicsItem & opt,
const QPointF & start,
const QPointF & end,
const Constraint & constraint )
protected

Definition at line 476 of file kganttitemdelegate.cpp.

◆ setDefaultBrush()

void ItemDelegate::setDefaultBrush ( ItemType type,
const QBrush & brush )

Sets the default brush used for items of type type to brush. The default brush is used in the case when the model does not provide an explicit brush.

Todo
Move this to GraphicsView to make delegate stateless.

Definition at line 109 of file kganttitemdelegate.cpp.

◆ setDefaultPen()

void ItemDelegate::setDefaultPen ( ItemType type,
const QPen & pen )

Sets the default pen used for items of type type to pen. The default pen is used in the case when the model does not provide an explicit pen.

Todo
Move this to GraphicsView to make delegate stateless.

Definition at line 121 of file kganttitemdelegate.cpp.

◆ startFinishArrow()

QPolygonF ItemDelegate::startFinishArrow ( const QPointF & start,
const QPointF & end ) const
protected

Definition at line 559 of file kganttitemdelegate.cpp.

◆ startFinishLine()

QPolygonF ItemDelegate::startFinishLine ( const QPointF & start,
const QPointF & end ) const
protected

Definition at line 535 of file kganttitemdelegate.cpp.

◆ startStartArrow()

QPolygonF ItemDelegate::startStartArrow ( const QPointF & start,
const QPointF & end ) const
protected

Definition at line 511 of file kganttitemdelegate.cpp.

◆ startStartLine()

QPolygonF ItemDelegate::startStartLine ( const QPointF & start,
const QPointF & end ) const
protected

Definition at line 490 of file kganttitemdelegate.cpp.

◆ toolTip()

QString ItemDelegate::toolTip ( const QModelIndex & idx) const
virtual
Returns
The tooltip for index idx

Definition at line 133 of file kganttitemdelegate.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:02:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.