Plasma
delegate.cpp
Go to the documentation of this file.
84 QRect DelegatePrivate::titleRect(const QStyleOptionViewItem &option, const QModelIndex &index) const
169 QRect Delegate::rectAfterTitle(const QStyleOptionViewItem &option, const QModelIndex &index) const
173 QRect emptyRect(0, textRect.top(), option.rect.width() - textRect.width() - DelegatePrivate::ITEM_LEFT_MARGIN - DelegatePrivate::ITEM_RIGHT_MARGIN - option.decorationSize.width() - DelegatePrivate::ICON_TEXT_MARGIN, textRect.height());
188 QRect Delegate::rectAfterSubTitle(const QStyleOptionViewItem &option, const QModelIndex &index) const
192 QRect emptyRect(0, textRect.top(), option.rect.width() - textRect.width() - DelegatePrivate::ITEM_LEFT_MARGIN - DelegatePrivate::ITEM_RIGHT_MARGIN - option.decorationSize.width() - DelegatePrivate::ICON_TEXT_MARGIN, textRect.height());
231 contentRect.adjusted(DelegatePrivate::ITEM_LEFT_MARGIN, DelegatePrivate::ITEM_TOP_MARGIN, -DelegatePrivate::ITEM_RIGHT_MARGIN, -DelegatePrivate::ITEM_BOTTOM_MARGIN));
232 decorationRect.moveTop(contentRect.top() + qMax(0, (contentRect.height() - decorationRect.height())) / 2);
255 const int delta = floor((qreal)(option.decorationSize.width() - DelegatePrivate::ACTION_ICON_SIZE) / 2.0);
335 const QColor gradientColor = KColorScheme(QPalette::Active).background(KColorScheme::NormalBackground).color();
426 gradient.setColorAt(((qreal)titleRect.width()/3.0) / (qreal)highlightRect.width(), backgroundColor2);
469 size.setHeight(qMax(option.decorationSize.height(), qMax(size.height(), metrics.height() + subMetrics.ascent()) + 3) + 4);
void setBottom(int y)
void setPointSize(int pointSize)
void setHeight(int height)
QSize size() const
QPoint topRight() const
bool end()
QRect rectAfterTitle(const QStyleOptionViewItem &option, const QModelIndex &index) const
Returns the empty area after the title.
Definition: delegate.cpp:169
void setCompositionMode(CompositionMode mode)
void setRenderHint(RenderHint hint, bool on)
void fill(const QColor &color)
int right() const
void setColorAt(qreal position, const QColor &color)
void translate(int dx, int dy)
void save()
void setRoleMapping(SpecificRoles role, int actual)
Maps an arbitrary role to a role belonging to SpecificRoles.
Definition: delegate.cpp:159
T value() const
the text color to be used by items resting on the background
Definition: theme.h:63
int height() const
void moveTopLeft(const QPoint &position)
void setBrush(const QBrush &brush)
typedef Alignment
void moveLeft(int x)
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: delegate.cpp:461
QRect alignedRect(Qt::LayoutDirection direction, QFlags< Qt::AlignmentFlag > alignment, const QSize &size, const QRect &rectangle)
void drawRect(const QRectF &rectangle)
bool isValid() const
void setFont(const QFont &font)
QPainterPath roundedRectangle(const QRectF &rect, qreal radius)
Returns a nicely rounded rectanglular path for painting.
Definition: paintutils.cpp:159
int toInt(bool *ok) const
int top() const
void setPen(const QColor &color)
void setTop(int y)
int left() const
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Definition: delegate.cpp:218
void setWidth(int width)
int row() const
void setBrush(const QBrush &brush)
void drawText(const QPointF &position, const QString &text)
QRect rectAfterSubTitle(const QStyleOptionViewItem &option, const QModelIndex &index) const
Returns the empty area after the subtitle.
Definition: delegate.cpp:188
void moveTop(int y)
QRect intersected(const QRect &rectangle) const
void paint(QPainter *painter, const QRect &rect, QFlags< Qt::AlignmentFlag > alignment, Mode mode, State state) const
Definition: delegate.h:60
QRect adjusted(int dx1, int dy1, int dx2, int dy2) const
void setFinalStop(const QPointF &stop)
void restore()
Definition: delegate.h:58
int width() const
const QAbstractItemModel * model() const
void setClipRect(const QRectF &rectangle, Qt::ClipOperation operation)
void drawPath(const QPainterPath &path)
QVariant data(int role) const
QModelIndex sibling(int row, int column) const
void setHeight(int height)
virtual int columnCount(const QModelIndex &parent) const =0
int height() const
int height() const
void adjust(int dx1, int dy1, int dx2, int dy2)
int bottom() const
QPoint topLeft() const
int column() const
void setStart(const QPointF &start)
void setAlphaF(qreal alpha)
bool isValid() const
Q_INVOKABLE QColor color(ColorRole role) const
Returns the text color to be used by items resting on the background.
Definition: theme.cpp:918
QRect emptyRect(const QStyleOptionViewItem &option, const QModelIndex &index) const
Returns the empty area after both the title and the subtitle.
Definition: delegate.cpp:207
void moveRight(int x)
QString toString() const
int pointSize() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.