12#include "kdganttlegend_p.h"
16#include <QApplication>
102 if (
model() ==
nullptr)
144 opt.itemRect =
opt.rect.adjusted(dx, 0, dx, 0);
145 opt.boundingRect = r;
147 if (!
opt.text.isNull())
154 const int rowCount =
d->proxyModel.rowCount(index);
155 for (
int row = 0; row < rowCount; ++row) {
169 if (
model() ==
nullptr)
173 if (index.
model() !=
nullptr) {
185 const int rowCount =
d->proxyModel.rowCount(index);
186 for (
int row = 0; row < rowCount; ++row) {
Class used to render gantt items in a KDGantt::GraphicsView.
void setModel(QAbstractItemModel *model) override
virtual void modelDataChanged()
Triggers repainting of the legend.
~Legend() override
Destructor.
QSize minimumSizeHint() const override
virtual StyleOptionGanttItem getStyleOption(const QModelIndex &index) const
Creates a StyleOptionGanttItem with all style options filled in except the target rectangles.
QModelIndex indexAt(const QPoint &point) const override
void paintEvent(QPaintEvent *event) override
QSize sizeHint() const override
Legend(QWidget *parent=nullptr)
Constructor.
virtual QSize measureItem(const QModelIndex &index, bool recursive=true) const
Calculates the needed space for the legend item at index and, if recursive is true,...
QRect visualRect(const QModelIndex &index) const override
virtual QRect drawItem(QPainter *painter, const QModelIndex &index, const QPoint &pos=QPoint()) const
Draws the legend item at index and all of it's children recursively at pos onto painter.
QStyleOption subclass for gantt items.
void columnsRemoved(const QModelIndex &parent, int first, int last)
virtual QVariant data(const QModelIndex &index, int role) const const=0
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles)
void rowsRemoved(const QModelIndex &parent, int first, int last)
virtual bool event(QEvent *event) override
QAbstractItemDelegate * itemDelegate() const const
QAbstractItemModel * model() const const
QModelIndex rootIndex() const const
void setItemDelegate(QAbstractItemDelegate *delegate)
virtual void setModel(QAbstractItemModel *model)
void setFrameStyle(int style)
bool isValid() const const
const QAbstractItemModel * model() const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
T qobject_cast(QObject *object)
void fillRect(const QRectF &rectangle, const QBrush &brush)
bool isEmpty() const const
int toInt(bool *ok) const const
QString toString() const const