libkdegames
kgamepopupitem.cpp
Go to the documentation of this file.
61 void TextItemWithOpacity::paint( QPainter* p, const QStyleOptionGraphicsItem *option, QWidget* widget )
67 //whether the given color is equal to the one already set. Just calling setDefaultTextColor without
68 //this check may result in an infinite loop of paintEvent -> setDefaultTextColor -> update -> paintEvent...
201 d->m_textChildItem->setTextColor( KStatefulBrush(KColorScheme::Tooltip, KColorScheme::NormalText) );
208 void KGamePopupItem::paint( QPainter* p, const QStyleOptionGraphicsItem *option, QWidget* widget )
295 roundRectPath.arcTo(0.0, h-(2*d->m_sharpness), 2*d->m_sharpness, 2*d->m_sharpness, 180.0, 90.0);
297 roundRectPath.arcTo(w-(2*d->m_sharpness), h-(2*d->m_sharpness), (2*d->m_sharpness), (2*d->m_sharpness), 270.0, 90.0);
327 int start = static_cast<int>(d->m_visibleSceneRect.top() - d->m_boundRect.height() - SHOW_OFFSET);
334 int end = static_cast<int>(d->m_visibleSceneRect.bottom() - d->m_boundRect.height() - SHOW_OFFSET);
431 if( d->m_timeout != 0 && !d->m_timer.isActive() && d->m_timeLine.state() != QTimeLine::Running )
ReplaceMode
Possible values for message showing mode in respect to a previous message.
Definition: kgamepopupitem.h:54
void setOpacity(qreal opacity)
int width() const
void setTextColor(const QColor &color)
Sets default color for unformatted text By default system-default color is used.
Definition: kgamepopupitem.cpp:483
Definition: kgamepopupitem.h:62
void setFlag(GraphicsItemFlag flag, bool enabled)
QRect contentsRect() const
void closeSubpath()
QPointF mapToScene(const QPoint &point) const
QGraphicsTextItem(QGraphicsItem *parent)
virtual void paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *widget)
Paints item.
Definition: kgamepopupitem.cpp:208
bool isVisible() const
void save()
QGraphicsItem capable of showing short popup messages which do not interrupt the gameplay.
Definition: kgamepopupitem.h:45
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
QWidget * viewport() const
void moveTo(const QPointF &point)
void hide()
QGraphicsScene * scene() const
qreal opacity() const
void setMessageIcon(const QPixmap &pix)
Sets custom pixmap to show instead of default icon on the left.
Definition: kgamepopupitem.cpp:437
void update(const QRectF &rect)
void setMessageOpacity(qreal opacity)
Sets the message opacity from 0 (fully transparent) to 1 (fully opaque) For example 0...
Definition: kgamepopupitem.cpp:392
void linkHovered(const QString &link)
Emitted when user hovers a link in item.
KDEGAMES_EXPORT KAction * end(const QObject *recvr, const char *slot, QObject *parent)
End the current game, but do not quit the program.
Definition: kstandardgameaction.cpp:167
QPointF pos() const
void setPen(const QColor &color)
void lineTo(const QPointF &endPoint)
KGamePopupItem(QGraphicsItem *parent=0)
Constructs a message item.
Definition: kgamepopupitem.cpp:169
void setPos(const QPointF &pos)
QList< QGraphicsView * > views() const
void drawPixmap(const QRectF &target, const QPixmap &pixmap, const QRectF &source)
bool isEmpty() const
Position
The possible places in the scene where a message can be shown.
Definition: kgamepopupitem.h:62
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 setWidthF(qreal width)
Definition: kgamepopupitem.h:62
void setBrush(const QBrush &brush)
void setOpacity(qreal opacity)
Definition: kgamepopupitem.h:62
void prepareGeometryChange()
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
void setSharpness(Sharpness sharpness)
Sets the popup angles sharpness.
Definition: kgamepopupitem.cpp:504
void restore()
bool isVisible() const
QRectF boundingRect() const
Definition: kgamepopupitem.h:129
void setAcceptsHoverEvents(bool enabled)
void drawPath(const QPainterPath &path)
void setBackgroundBrush(const QBrush &brush)
Sets brush used to paint item backgound By default system-default brush is used.
Definition: kgamepopupitem.cpp:478
Definition: kgamepopupitem.h:62
void setMessageTimeout(int msec)
Sets the amount of time the item will stay visible on screen before it goes away. ...
Definition: kgamepopupitem.cpp:377
void setHideOnMouseClick(bool hide)
Sets whether to hide this popup item on mouse click.
Definition: kgamepopupitem.cpp:382
void forceHide(HideType type=AnimatedHide)
Requests the item to be hidden immediately.
Definition: kgamepopupitem.cpp:449
void show()
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void arcTo(const QRectF &rectangle, qreal startAngle, qreal sweepLength)
const QPen & pen() const
void setZValue(qreal z)
void linkActivated(const QString &link)
Emitted when user clicks on a link in item.
Definition: kgamepopupitem.h:129
HideType
Used to specify how to hide in forceHide() - instantly or animatedly.
Definition: kgamepopupitem.h:129
Definition: kgamepopupitem.h:62
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:42 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:18:42 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.