6 #include <QPainterPath>
7 #include <QFontMetrics>
12 : mHover(false), mBubble(
QRectF(-50,-15,sBubbleWidth,35)), mText(txt), mNode(nd), mContext(ctx)
48 if (!mContext)
return;
52 void CommentSpeechBubble::paintText(
QPainter *painter,
int maxWidth)
57 while ((fm.horizontalAdvance(txt) + 2 * sTextMargin) > maxWidth &&
n > 1)
60 txt = mText.
left(
n) +
"…";
77 int txtWidth = rBubble.
width();
101 paintText(painter,txtWidth);
Logical container for modules, gates, and nets.
void showComments(const Node &nd)
The Node class object represents a module or a gate.
option(PL_GUI "PL_GUI" ON) if(PL_GUI OR BUILD_ALL_PLUGINS) cmake_minimum_required(VERSION 3.1.0) if(APPLE AND CMAKE_HOST_APPLE AND NOT Qt5_DIR) set(Qt5_DIR "/usr/local/opt/qt@5/lib/cmake") endif(APPLE AND CMAKE_HOST_APPLE AND NOT Qt5_DIR) find_package(Qt5 COMPONENTS Core REQUIRED) find_package(Qt5 COMPONENTS Widgets REQUIRED) if(Qt5Widgets_FOUND) message(VERBOSE "Qt5Widgets_INCLUDE_DIRS
int horizontalAdvance(const QString &text, int len) const const
void setAcceptHoverEvents(bool enabled)
void update(const QRectF &rect)
void drawLines(const QLineF *lines, int lineCount)
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule)
void drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, Qt::SizeMode mode)
void drawText(const QPointF &position, const QString &text)
const QFont & font() const const
void setBrush(const QBrush &brush)
void setPen(const QColor &color)
void addRect(const QRectF &rectangle)
qreal right() const const
void setHeight(qreal height)
void setWidth(qreal width)
qreal width() const const
QString left(int n) const const
void append(const T &value)