liblancelot
BasicWidget.cpp
Go to the documentation of this file.
203 QRectF widgetRect = QRectF(0, 0, size().width() - 2 * WIDGET_PADDING, size().height() - 2 * WIDGET_PADDING);
241 if ((!d->icon.isNull() || d->iconInSvg.isValid()) && !(d->title.isEmpty() && d->description.isEmpty()))
308 titleRect.setWidth(widgetRect.width() - ((!d->icon.isNull() || d->iconInSvg.isValid()) ? iconRect.width() + WIDGET_PADDING : 0));
312 titleRect.setWidth(widgetRect.width() - ((!d->icon.isNull() || d->iconInSvg.isValid()) ? iconRect.width() + WIDGET_PADDING : 0));
355 d->iconInSvg.paint(_painter, rect.left(), rect.top(), isHovered()?"active":"inactive"); //TODO: add disabled state
558 void BasicWidget::drawText(QPainter * painter, const QRectF & rectangle, int flags, const QString & txt, bool shortcutEnabled)
virtual void updateGeometry()
bool isHovered() const
Returns whether the mouse cursor is hovering the widget.
Definition: Widget.cpp:121
void setAlignment(Qt::Alignment alignment)
Sets alignment of this Lancelot::BasicWidget.
Definition: BasicWidget.cpp:496
int indexOf(QChar ch, int from, Qt::CaseSensitivity cs) const
QSize size() const
void setIconInSvg(const Plasma::Svg &svg)
Sets icon of this Lancelot::BasicWidget.
Definition: BasicWidget.cpp:437
bool isRightToLeft()
QString title() const
void fillRect(const QRectF &rectangle, const QBrush &brush)
void setCompositionMode(CompositionMode mode)
void setTitle(const QString &title)
Sets title of this Lancelot::BasicWidget.
Definition: BasicWidget.cpp:449
qreal alphaF() const
void setRenderHint(RenderHint hint, bool on)
void drawText(QPainter *painter, const QRectF &rectangle, int flags, const QString &text, bool shortcutEnabled)
Common implementation of text painting.
Definition: BasicWidget.cpp:558
void fill(const QColor &color)
void setParentItem(QGraphicsItem *newParent)
QRectF geometry() const
void setColorAt(qreal position, const QColor &color)
const QFont & font() const
qreal & rwidth()
QSizeF size() const
qreal rotation() const
int size() const
bool isValid() const
qreal top() const
int height() const
const ColorScheme * backgroundColor() const
Background color is one of the common properties, so a direct function that accesses it is provided...
Definition: Global.cpp:204
void setDescription(const QString &description)
Sets description of this Lancelot::BasicWidget.
Definition: BasicWidget.cpp:473
void rotate(qreal angle)
QString & remove(int position, int n)
typedef Alignment
void setInnerOrientation(Qt::Orientation orientation)
Sets the inner orientation of this Lancelot::BasicWidget.
Definition: BasicWidget.cpp:485
qreal left() const
void adjust(qreal dx1, qreal dy1, qreal dx2, qreal dy2)
void moveLeft(int x)
void update(const QRectF &rect)
void setHeight(qreal height)
QSizeF size() const
QFont font() const
qreal bottom() const
QColor color() const
void setFont(const QFont &font)
QPointF pos() const
void moveRight(qreal x)
void paintForeground(QPainter *painter)
Common implementation of icon/text/description rendering.
Definition: BasicWidget.cpp:177
QRectF boundingRect(const QRectF &rectangle, int flags, const QString &text)
void fillPath(const QPainterPath &path, const QBrush &brush)
void setPen(const QColor &color)
qreal valueF() const
void setWidth(qreal width)
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
QPointF topLeft() const
bool isEmpty() const
void paintBackground(QPainter *painter)
Paints the widget background using the widget's SVG.
Definition: Widget.cpp:158
void moveLeft(qreal x)
void drawText(const QPointF &position, const QString &text)
Qt::Orientation innerOrientation() const
Definition: BasicWidget.cpp:491
void moveTop(int y)
QSizeF boundedTo(const QSizeF &otherSize) const
void setIconSize(QSize size)
Sets icon size of this Lancelot::BasicWidget.
Definition: BasicWidget.cpp:413
qreal right() const
int width(const QString &text, int len) const
L_Override void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: BasicWidget.cpp:153
QIcon icon() const
bool isEnabled() const
bool hasProperty(const QString &property) const
Definition: Global.cpp:164
int width() const
qreal width() const
QSize iconSize() const
void setWidth(qreal width)
const QChar at(int position) const
QRectF rect() const
int height() const
L_Override QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const
Definition: Widget.cpp:217
BasicWidget(QIcon icon, QString title=QString(), QString description=QString(), QGraphicsItem *parent=0)
Creates a new Lancelot::BasicWidget.
Definition: BasicWidget.cpp:132
L_Override QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const
Definition: BasicWidget.cpp:507
QString left(int n) const
void setAlphaF(qreal alpha)
qreal height() const
qreal & rheight()
qreal height() const
void moveTop(qreal y)
QObject * parent() const
const ColorScheme * foregroundColor() const
Foreground color is one of the common properties, so a direct function that accesses it is provided...
Definition: Global.cpp:213
void setHeight(qreal height)
const QPen & pen() const
qreal width() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:43:01 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:43:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.