KDEGames
kgamepopupitem.cpp
55 void TextItemWithOpacity::paint( QPainter* p, const QStyleOptionGraphicsItem *option, QWidget* widget )
61 //whether the given color is equal to the one already set. Just calling setDefaultTextColor without
62 //this check may result in an infinite loop of paintEvent -> setDefaultTextColor -> update -> paintEvent...
181 connect(d->m_textChildItem, &TextItemWithOpacity::linkActivated, this, &KGamePopupItem::linkActivated);
182 connect(d->m_textChildItem, &TextItemWithOpacity::linkHovered, this, &KGamePopupItem::onLinkHovered);
183 connect(d->m_textChildItem, &TextItemWithOpacity::mouseClicked, this, &KGamePopupItem::onTextItemClicked);
200 d->m_textChildItem->setTextColor( KStatefulBrush(KColorScheme::Tooltip, KColorScheme::NormalText) );
209 void KGamePopupItem::paint( QPainter* p, const QStyleOptionGraphicsItem *option, QWidget* widget )
229 p->drawPixmap( MARGIN, static_cast<int>(d->m_boundRect.height()/2) - d->m_iconPix.height()/2.0/d->m_iconPix.devicePixelRatio(),
275 qreal w = d->m_textChildItem->boundingRect().width()+MARGIN*2+d->m_iconPix.width()/iconDpr+SOME_SPACE;
300 roundRectPath.arcTo(0.0, h-(2*d->m_sharpness), 2*d->m_sharpness, 2*d->m_sharpness, 180.0, 90.0);
302 roundRectPath.arcTo(w-(2*d->m_sharpness), h-(2*d->m_sharpness), (2*d->m_sharpness), (2*d->m_sharpness), 270.0, 90.0);
332 int start = static_cast<int>(d->m_visibleSceneRect.top() - d->m_mappedBoundRect.height() - d->m_mapped_SHOW_OFFSET);
339 int end = static_cast<int>(d->m_visibleSceneRect.bottom() - d->m_mappedBoundRect.height() - d->m_mapped_SHOW_OFFSET);
361 setPos( d->m_visibleSceneRect.right()-d->m_mappedBoundRect.width()-d->m_mapped_SHOW_OFFSET, frame );
431 if( d->m_timeout != 0 && !d->m_timer.isActive() && d->m_timeLine.state() != QTimeLine::Running )
Q_OBJECTQ_OBJECT
void setZValue(qreal z)
void arcTo(const QRectF &rectangle, qreal startAngle, qreal sweepLength)
void setPen(const QColor &color)
HideType
Used to specify how to hide in forceHide() - instantly or animatedly.
Definition: kgamepopupitem.h:121
qreal devicePixelRatio() const const
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
Forward
palette
Q_EMITQ_EMIT
QRectF boundingRect() const const
void update(const QRectF &rect)
NormalText
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
void setOpacity(qreal opacity)
Q_SCRIPTABLE Q_NOREPLY void start()
QIcon fromTheme(const QString &name)
ItemIsFocusable
void setHideOnMouseClick(bool hide)
Sets whether to hide this popup item on mouse click.
Definition: kgamepopupitem.cpp:387
void paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *widget) override
Paints item.
Definition: kgamepopupitem.cpp:209
const QPen & pen() const const
void prepareGeometryChange()
void frameChanged(int frame)
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void setWidthF(qreal width)
ReplaceMode
Possible values for message showing mode in respect to a previous message.
Definition: kgamepopupitem.h:46
KIOCORE_EXPORT CopyJob * link(const QList< QUrl > &src, const QUrl &destDir, JobFlags flags=DefaultFlags)
void setAcceptHoverEvents(bool enabled)
QList< QGraphicsView * > views() const const
LinksAccessibleByMouse
void setPos(const QPointF &pos)
QGraphicsScene * scene() const const
parent
void timeout()
void drawPath(const QPainterPath &path)
ArrowCursor
void linkActivated(const QString &link)
Emitted when user clicks on a link in item.
void forceHide(HideType type=AnimatedHide)
Requests the item to be hidden immediately.
Definition: kgamepopupitem.cpp:449
void setFlag(QGraphicsItem::GraphicsItemFlag flag, bool enabled)
void show()
NormalBackground
Running
void setBrush(const QBrush &brush)
void setMessageIcon(const QPixmap &pix)
Sets custom pixmap to show instead of default icon on the left.
Definition: kgamepopupitem.cpp:437
Position
The possible places in the scene where a message can be shown.
Definition: kgamepopupitem.h:54
Q_SIGNALSQ_SIGNALS
void setOpacity(qreal opacity)
void linkHovered(const QString &link)
Emitted when user hovers a link in item.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
void closeSubpath()
void setBackgroundBrush(const QBrush &brush)
Sets brush used to paint item background By default system-default brush is used.
Definition: kgamepopupitem.cpp:478
qreal y() const const
void setSharpness(Sharpness sharpness)
Sets the popup angles sharpness.
Definition: kgamepopupitem.cpp:504
QPixmap pixmap(const QSize &size, QIcon::Mode mode, QIcon::State state) const const
Tooltip
Definition: kgamepopupitem.h:37
void moveTo(const QPointF &point)
void showMessage(const QString &text, Position pos, ReplaceMode mode=LeavePrevious)
Shows the message: item will appear at specified place of the scene using simple animation Item will ...
Definition: kgamepopupitem.cpp:234
void restore()
KGamePopupItem(QGraphicsItem *parent=nullptr)
Constructs a message item.
Definition: kgamepopupitem.cpp:171
QPointF pos() const const
void save()
bool isVisible() const const
Active
void setTextColor(const QColor &color)
Sets default color for unformatted text By default system-default color is used.
Definition: kgamepopupitem.cpp:483
qreal opacity() const const
QWidget * viewport() const const
void setMessageOpacity(qreal opacity)
Sets the message opacity from 0 (fully transparent) to 1 (fully opaque) For example 0....
Definition: kgamepopupitem.cpp:397
void hide()
void setMessageTimeout(int msec)
Sets the amount of time the item will stay visible on screen before it goes away.
Definition: kgamepopupitem.cpp:382
const QList< QKeySequence > & end()
black
QPointF mapToScene(const QPoint &point) const const
int width() const const
QRect contentsRect() const const
void finished()
void lineTo(const QPointF &endPoint)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon May 16 2022 04:17:34 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2022 The KDE developers.
Generated on Mon May 16 2022 04:17:34 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.