KGantt::GraphicsScene
#include <kganttgraphicsscene.h>

Signals | |
void | clicked (const QModelIndex &index) |
void | entered (const QModelIndex &index) |
void | gridChanged () |
void | pressed (const QModelIndex &index) |
void | qrealClicked (const QModelIndex &index) |
Public Slots | |
void | setConstraintModel (KGantt::ConstraintModel *) |
void | setModel (QAbstractItemModel *) |
void | setReadOnly (bool) |
void | setRootIndex (const QModelIndex &idx) |
void | setSelectionModel (QItemSelectionModel *selectionmodel) |
void | setSummaryHandlingModel (QAbstractProxyModel *) |
Public Member Functions | |
GraphicsScene (QObject *parent=nullptr) | |
void | clearItems () |
ConstraintModel * | constraintModel () const |
GraphicsItem * | createItem (ItemType type) const |
void | deleteSubtree (const QModelIndex &) |
GraphicsItem * | dragSource () const |
ConstraintGraphicsItem * | findConstraintItem (const Constraint &) const |
QList< ConstraintGraphicsItem * > | findConstraintItems (const QModelIndex &idx) const |
GraphicsItem * | findItem (const QModelIndex &) const |
GraphicsItem * | findItem (const QPersistentModelIndex &) const |
const AbstractGrid * | getGrid () const |
AbstractGrid * | grid () const |
void | insertItem (const QPersistentModelIndex &, GraphicsItem *) |
bool | isReadOnly () const |
void | itemClicked (const QModelIndex &) |
ItemDelegate * | itemDelegate () const |
void | itemDoubleClicked (const QModelIndex &) |
void | itemEntered (const QModelIndex &) |
void | itemPressed (const QModelIndex &idx, QGraphicsSceneMouseEvent *event) |
QAbstractItemModel * | model () const |
void | print (QPainter *painter, const QRectF &target=QRectF(), bool drawRowLabels=true, bool drawColumnLabels=true) |
void | print (QPainter *painter, qreal start, qreal end, const QRectF &target=QRectF(), bool drawRowLabels=true, bool drawColumnLabels=true) |
void | print (QPrinter *printer, bool drawRowLabels=true, bool drawColumnLabels=true) |
void | print (QPrinter *printer, qreal start, qreal end, bool drawRowLabels=true, bool drawColumnLabels=true) |
void | printDiagram (QPrinter *printer, const PrintingContext &context) |
void | removeItem (const QModelIndex &) |
void | removeItem (QGraphicsItem *item) |
QModelIndex | rootIndex () const |
AbstractRowController * | rowController () const |
QItemSelectionModel * | selectionModel () const |
void | setDragSource (GraphicsItem *item) |
void | setGrid (AbstractGrid *grid) |
void | setItemDelegate (ItemDelegate *) |
void | setRowController (AbstractRowController *rc) |
QAbstractProxyModel * | summaryHandlingModel () const |
AbstractGrid * | takeGrid () |
void | updateItems () |
void | updateRow (const QModelIndex &idx) |
![]() | |
QGraphicsScene (const QRectF &sceneRect, QObject *parent) | |
QGraphicsScene (QObject *parent) | |
QGraphicsScene (qreal x, qreal y, qreal width, qreal height, QObject *parent) | |
QGraphicsItem * | activePanel () const const |
QGraphicsWidget * | activeWindow () const const |
QGraphicsEllipseItem * | addEllipse (const QRectF &rect, const QPen &pen, const QBrush &brush) |
QGraphicsEllipseItem * | addEllipse (qreal x, qreal y, qreal w, qreal h, const QPen &pen, const QBrush &brush) |
void | addItem (QGraphicsItem *item) |
QGraphicsLineItem * | addLine (const QLineF &line, const QPen &pen) |
QGraphicsLineItem * | addLine (qreal x1, qreal y1, qreal x2, qreal y2, const QPen &pen) |
QGraphicsPathItem * | addPath (const QPainterPath &path, const QPen &pen, const QBrush &brush) |
QGraphicsPixmapItem * | addPixmap (const QPixmap &pixmap) |
QGraphicsPolygonItem * | addPolygon (const QPolygonF &polygon, const QPen &pen, const QBrush &brush) |
QGraphicsRectItem * | addRect (const QRectF &rect, const QPen &pen, const QBrush &brush) |
QGraphicsRectItem * | addRect (qreal x, qreal y, qreal w, qreal h, const QPen &pen, const QBrush &brush) |
QGraphicsSimpleTextItem * | addSimpleText (const QString &text, const QFont &font) |
QGraphicsTextItem * | addText (const QString &text, const QFont &font) |
QGraphicsProxyWidget * | addWidget (QWidget *widget, Qt::WindowFlags wFlags) |
void | advance () |
QBrush | backgroundBrush () const const |
int | bspTreeDepth () const const |
void | changed (const QList< QRectF > ®ion) |
void | clear () |
void | clearFocus () |
void | clearSelection () |
QList< QGraphicsItem * > | collidingItems (const QGraphicsItem *item, Qt::ItemSelectionMode mode) const const |
QGraphicsItemGroup * | createItemGroup (const QList< QGraphicsItem * > &items) |
void | destroyItemGroup (QGraphicsItemGroup *group) |
QGraphicsItem * | focusItem () const const |
void | focusItemChanged (QGraphicsItem *newFocusItem, QGraphicsItem *oldFocusItem, Qt::FocusReason reason) |
bool | focusOnTouch () const const |
QFont | font () const const |
QBrush | foregroundBrush () const const |
bool | hasFocus () const const |
qreal | height () const const |
virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const const |
void | invalidate (const QRectF &rect, QGraphicsScene::SceneLayers layers) |
void | invalidate (qreal x, qreal y, qreal w, qreal h, QGraphicsScene::SceneLayers layers) |
bool | isActive () const const |
bool | isSortCacheEnabled () const const |
QGraphicsItem * | itemAt (const QPointF &position) const const |
QGraphicsItem * | itemAt (const QPointF &position, const QTransform &deviceTransform) const const |
QGraphicsItem * | itemAt (qreal x, qreal y) const const |
QGraphicsItem * | itemAt (qreal x, qreal y, const QTransform &deviceTransform) const const |
QGraphicsScene::ItemIndexMethod | itemIndexMethod () const const |
QList< QGraphicsItem * > | items (const QPainterPath &path, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const const |
QList< QGraphicsItem * > | items (const QPointF &pos, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const const |
QList< QGraphicsItem * > | items (const QPolygonF &polygon, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const const |
QList< QGraphicsItem * > | items (const QRectF &rect, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const const |
QList< QGraphicsItem * > | items (qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode) const const |
QList< QGraphicsItem * > | items (qreal x, qreal y, qreal w, qreal h, Qt::ItemSelectionMode mode, Qt::SortOrder order, const QTransform &deviceTransform) const const |
QList< QGraphicsItem * > | items (Qt::SortOrder order) const const |
QRectF | itemsBoundingRect () const const |
qreal | minimumRenderSize () const const |
QGraphicsItem * | mouseGrabberItem () const const |
QPalette | palette () const const |
void | removeItem (QGraphicsItem *item) |
void | render (QPainter *painter, const QRectF &target, const QRectF &source, Qt::AspectRatioMode aspectRatioMode) |
QRectF | sceneRect () const const |
void | sceneRectChanged (const QRectF &rect) |
QList< QGraphicsItem * > | selectedItems () const const |
QPainterPath | selectionArea () const const |
void | selectionChanged () |
bool | sendEvent (QGraphicsItem *item, QEvent *event) |
void | setActivePanel (QGraphicsItem *item) |
void | setActiveWindow (QGraphicsWidget *widget) |
void | setBackgroundBrush (const QBrush &brush) |
void | setBspTreeDepth (int depth) |
void | setFocus (Qt::FocusReason focusReason) |
void | setFocusItem (QGraphicsItem *item, Qt::FocusReason focusReason) |
void | setFocusOnTouch (bool enabled) |
void | setFont (const QFont &font) |
void | setForegroundBrush (const QBrush &brush) |
void | setItemIndexMethod (QGraphicsScene::ItemIndexMethod method) |
void | setMinimumRenderSize (qreal minSize) |
void | setPalette (const QPalette &palette) |
void | setSceneRect (const QRectF &rect) |
void | setSceneRect (qreal x, qreal y, qreal w, qreal h) |
void | setSelectionArea (const QPainterPath &path, const QTransform &deviceTransform) |
void | setSelectionArea (const QPainterPath &path, Qt::ItemSelectionMode mode, const QTransform &deviceTransform) |
void | setSelectionArea (const QPainterPath &path, Qt::ItemSelectionOperation selectionOperation, Qt::ItemSelectionMode mode, const QTransform &deviceTransform) |
void | setSortCacheEnabled (bool enabled) |
void | setStickyFocus (bool enabled) |
void | setStyle (QStyle *style) |
bool | stickyFocus () const const |
QStyle * | style () const const |
void | update (const QRectF &rect) |
void | update (qreal x, qreal y, qreal w, qreal h) |
QList< QGraphicsView * > | views () const const |
qreal | width () const const |
![]() | |
QObject (QObject *parent) | |
bool | blockSignals (bool block) |
const QObjectList & | children () 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< QByteArray > | dynamicPropertyNames () const const |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, 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 |
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 QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () 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 | |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
T | qobject_cast (const QObject *object) |
T | 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 | 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) |
QThread * | thread () const const |
Static Public Member Functions | |
static QModelIndex | dataIndex (const QModelIndex &idx) |
static QModelIndex | mainIndex (const QModelIndex &idx) |
![]() | |
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) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions | |
void | drawBackground (QPainter *painter, const QRectF &rect) override |
void | drawForeground (QPainter *painter, const QRectF &rect) override |
void | helpEvent (QGraphicsSceneHelpEvent *helpEvent) override |
![]() | |
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *contextMenuEvent) |
virtual void | dragEnterEvent (QGraphicsSceneDragDropEvent *event) |
virtual void | dragLeaveEvent (QGraphicsSceneDragDropEvent *event) |
virtual void | dragMoveEvent (QGraphicsSceneDragDropEvent *event) |
virtual void | drawItems (QPainter *painter, int numItems, QGraphicsItem *[] items, const QStyleOptionGraphicsItem[] options, QWidget *widget) |
virtual void | dropEvent (QGraphicsSceneDragDropEvent *event) |
virtual bool | event (QEvent *event) override |
virtual bool | eventFilter (QObject *watched, QEvent *event) override |
virtual void | focusInEvent (QFocusEvent *focusEvent) |
bool | focusNextPrevChild (bool next) |
virtual void | focusOutEvent (QFocusEvent *focusEvent) |
virtual void | inputMethodEvent (QInputMethodEvent *event) |
virtual void | keyPressEvent (QKeyEvent *keyEvent) |
virtual void | keyReleaseEvent (QKeyEvent *keyEvent) |
virtual void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *mouseEvent) |
virtual void | mouseMoveEvent (QGraphicsSceneMouseEvent *mouseEvent) |
virtual void | mousePressEvent (QGraphicsSceneMouseEvent *mouseEvent) |
virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *mouseEvent) |
virtual void | wheelEvent (QGraphicsSceneWheelEvent *wheelEvent) |
![]() | |
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 |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Additional Inherited Members | |
![]() | |
enum | ItemIndexMethod |
enum | SceneLayer |
![]() | |
backgroundBrush | |
bspTreeDepth | |
focusOnTouch | |
font | |
foregroundBrush | |
itemIndexMethod | |
minimumRenderSize | |
palette | |
sceneRect | |
sortCacheEnabled | |
stickyFocus | |
![]() | |
objectName | |
![]() | |
AllLayers | |
BackgroundLayer | |
BspTreeIndex | |
ForegroundLayer | |
ItemLayer | |
NoIndex | |
typedef | SceneLayers |
![]() | |
typedef | QObjectList |
Detailed Description
Definition at line 43 of file kganttgraphicsscene.h.
Member Function Documentation
◆ createItem()
GraphicsItem * GraphicsScene::createItem | ( | ItemType | type | ) | const |
Creates a new item of type type.
Definition at line 395 of file kganttgraphicsscene.cpp.
◆ dataIndex()
|
static |
Returns the index pointing to the last column in the same row as idx. This can be thought of as in "inverse" of mainIndex()
Definition at line 380 of file kganttgraphicsscene.cpp.
◆ getGrid()
const AbstractGrid * GraphicsScene::getGrid | ( | ) | const |
- Returns
- the current grid.
Definition at line 346 of file kganttgraphicsscene.cpp.
◆ grid()
AbstractGrid * GraphicsScene::grid | ( | ) | const |
- Returns
- the grid set with setGrid(). Note: Returns nullptr if no grid has been set.
Definition at line 340 of file kganttgraphicsscene.cpp.
◆ print() [1/4]
void GraphicsScene::print | ( | QPainter * | painter, |
const QRectF & | target = QRectF() , |
||
bool | drawRowLabels = true , |
||
bool | drawColumnLabels = true |
||
) |
Render the GanttView inside the rectangle target using the painter painter. If drawRowLabels is true (the default), each row will have it's label printed on the left side. If drawColumnLabels is true (the default), each column will have it's label printed at the top side.
Definition at line 755 of file kganttgraphicsscene.cpp.
◆ print() [2/4]
void GraphicsScene::print | ( | QPainter * | painter, |
qreal | start, | ||
qreal | end, | ||
const QRectF & | target = QRectF() , |
||
bool | drawRowLabels = true , |
||
bool | drawColumnLabels = true |
||
) |
Render the GanttView inside the rectangle target using the painter painter. If drawRowLabels is true (the default), each row will have it's label printed on the left side. If drawColumnLabels is true (the default), each column will have it's label printed at the top side.
To print a certain range of a chart with a DateTimeGrid, use qreal DateTimeGrid::mapFromDateTime( const QDateTime& dt) const to figure out the values for start and end.
Definition at line 766 of file kganttgraphicsscene.cpp.
◆ print() [3/4]
void GraphicsScene::print | ( | QPrinter * | printer, |
bool | drawRowLabels = true , |
||
bool | drawColumnLabels = true |
||
) |
Print the Gantt chart using printer. If drawRowLabels is true (the default), each row will have it's label printed on the left side. If drawColumnLabels is true (the default), each column will have it's label printed at the top side.
This version of print() will print multiple pages.
Definition at line 723 of file kganttgraphicsscene.cpp.
◆ print() [4/4]
void GraphicsScene::print | ( | QPrinter * | printer, |
qreal | start, | ||
qreal | end, | ||
bool | drawRowLabels = true , |
||
bool | drawColumnLabels = true |
||
) |
Print part of the Gantt chart from start to end using printer. If drawRowLabels is true (the default), each row will have it's label printed on the left side. If drawColumnLabels is true (the default), each column will have it's label printed at the top side.
This version of print() will print multiple pages.
To print a certain range of a chart with a DateTimeGrid, use qreal DateTimeGrid::mapFromDateTime( const QDateTime& dt) const to figure out the values for start and end.
Definition at line 738 of file kganttgraphicsscene.cpp.
◆ printDiagram()
void GraphicsScene::printDiagram | ( | QPrinter * | printer, |
const PrintingContext & | context | ||
) |
Print the Gantt chart on the printer in accordance with the PrintingContext context
- See also
- PrintingContext
- Since
- 2.8.0
Definition at line 777 of file kganttgraphicsscene.cpp.
◆ setGrid()
void GraphicsScene::setGrid | ( | AbstractGrid * | grid | ) |
Set the grid to grid
.
The current grid (if set) is deleted. If grid
is nullptr, the scene reverts to use the default_grid
Definition at line 325 of file kganttgraphicsscene.cpp.
◆ takeGrid()
AbstractGrid * GraphicsScene::takeGrid | ( | ) |
- Returns
- the grid set with setGrid() Note: Returns nullptr if no grid has been set. The scene reverts to use the default_grid.
Definition at line 313 of file kganttgraphicsscene.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Mar 23 2023 04:01:28 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.