43 #ifndef QT_NO_WHATSTHIS 56 #include "../text/qtextdocumentlayout_p.h" 59 #ifndef QT_NO_ACCESSIBILITY 64 #ifndef SPI_GETDROPSHADOW 65 #define SPI_GETDROPSHADOW 0x1024 207 #ifdef QT_NO_TEXTHTMLPARSER 231 #if defined(Q_WS_WIN) 308 bool drawShadow =
true;
309 #if defined(Q_WS_WIN) 315 drawShadow = !shadow;
317 #elif defined(Q_WS_MAC) || defined(Q_WS_QWS) 340 for(i=7; i < h; i += 2)
342 for(i = w - i + h; i > 6; i -= 2)
344 for(; i > 0 ; i -= 2)
345 p.
drawLine(6, h + 6 - i, i + 5, h + 5);
400 static void notifyToplevels(
QEvent *e);
407 for (
int i = 0; i < toplevels.
count(); ++i) {
416 : leaveOnMouseRelease(false)
419 qApp->installEventFilter(
this);
434 #ifndef QT_NO_ACCESSIBILITY 445 button->setChecked(
false);
450 #ifndef QT_NO_ACCESSIBILITY 491 if (static_cast<QMouseEvent*>(e)->button() ==
Qt::RightButton || customWhatsThis)
501 }
else if (customWhatsThis) {
527 void actionTriggered();
532 #ifndef QT_NO_IMAGEFORMAT_XPM 538 #ifndef QT_NO_SHORTCUT 547 QWhatsThisPrivate::instance->
action =
this;
581 void QWhatsThis::remove(
QWidget *w)
600 void whatToggled(
bool b) {
603 QWhatsThisPrivate::instance->button =
this;
618 return new QWhatsThisButton(parent);
635 if (QWhatsThisPrivate::instance)
650 return (QWhatsThisPrivate::instance != 0);
671 if (text.
size() == 0)
689 #if defined(Q_WS_X11) && !defined(QT_NO_CURSOR) 697 int w = whatsThat->
width();
698 int h = whatsThat->
height();
706 pos = widget->mapToGlobal(
QPoint(0,0));
708 if (widget && w > widget->width() + 16)
709 x = pos.
x() + widget->width()/2 - w/2;
717 pos.
x() + widget->width())
724 if (widget && h > widget->height() + 16) {
725 y = pos.
y() + widget->height() + 2;
727 if (y + h + 10 > sy+screen.
height())
736 pos.
y() + widget->height())
742 whatsThat->
move(x, y);
756 leaveWhatsThisMode();
784 #include "qwhatsthis.moc" 786 #endif // QT_NO_WHATSTHIS
The QPainter class performs low-level painting on widgets and other paint devices.
static void updateAccessibility(QObject *, int who, Event reason)
Notifies accessibility clients about a change in object's accessibility information.
bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
The QKeyEvent class describes a key event.
void setShortcut(const QKeySequence &shortcut)
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
QSize toSize() const
Returns an integer based copy of this size.
void adjustSize()
Adjusts the document to a reasonable size.
void setClipRect(const QRectF &, Qt::ClipOperation op=Qt::ReplaceClip)
Enables clipping, and sets the clip region to the given rectangle using the given clip operation...
Q_GUI_EXPORT bool mightBeRichText(const QString &)
Returns true if the string text is likely to be rich text; otherwise returns false.
void keyPressEvent(QKeyEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive key press events f...
int width() const
Returns the width of the rectangle.
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
#define SPI_GETDROPSHADOW
Q_CORE_EXPORT void qDeleteInEventHandler(QObject *o)
long ASN1_INTEGER_get ASN1_INTEGER * a
int count(const T &t) const
Returns the number of occurrences of value in the list.
void drawLine(const QLineF &line)
Draws a line defined by line.
int height() const
Returns the height of the rectangle.
static const WinVersion WindowsVersion
the version of the Windows operating system on which the application is run (Windows only) ...
The QString class provides a Unicode character string.
static const char *const button_image[]
QString anchorAt(const QPointF &pos) const
Returns the reference of the anchor the given position, or an empty string if no anchor exists at tha...
QPalette palette
the default color that is used for the text, when no color is specified.
void showEvent(QShowEvent *e)
This event handler can be reimplemented in a subclass to receive widget show events which are passed ...
The QObject class is the base class of all Qt objects.
The QPen class defines how a QPainter should draw lines and outlines of shapes.
void mouseReleaseEvent(QMouseEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive mouse release even...
void drawPoint(const QPointF &pt)
Draws a single point at the given position using the current pen's color.
const QPoint & pos() const
Returns the position of the mouse cursor, relative to the widget that received the event...
static QFont font()
Returns the default application font.
static void changeOverrideCursor(const QCursor &)
Changes the currently active application override cursor to cursor.
QRect boundingRect(QChar) const
Returns the rectangle that is covered by ink if character ch were to be drawn at the origin of the co...
static QWidget * widgetAt(const QPoint &p)
Returns the widget at global screen position point, or 0 if there is no Qt widget there...
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately after the event occurred.
int key() const
Returns the code of the key that was pressed or released.
void setPlainText(const QString &text)
Replaces the entire contents of the document with the given plain text.
void drawText(const QPointF &p, const QString &s)
Draws the given text with the currently defined text direction, beginning at the given position...
#define QT_BEGIN_NAMESPACE
This macro expands to.
void setBrush(ColorRole cr, const QBrush &brush)
Sets the brush for the given color role to the specified brush for all groups in the palette...
void toggled(bool)
This signal is emitted whenever a checkable action changes its isChecked() status.
int size() const
Returns the number of characters in this string.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
void setTop(int pos)
Sets the top edge of the rectangle to the given y coordinate.
const T & at(int i) const
Returns the item at index position i in the list.
void adjust(int x1, int y1, int x2, int y2)
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
void setSize(const QSize &s)
Sets the size of the rectangle to the given size.
QWhatsThisAction(QObject *parent=0)
static QWhatsThat * instance
static bool inWhatsThisMode()
Returns true if the user interface is in "What's This?" mode; otherwise returns false.
QSizeF size
Returns the actual size of the document.
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
static void notifyToplevels(QEvent *e)
void setHtml(const QString &html)
Replaces the entire contents of the document with the given HTML-formatted text in the html string...
The QShowEvent class provides an event that is sent when a widget is shown.
void mousePressEvent(QMouseEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive mouse press events...
static void say(QWidget *, const QString &, int x=0, int y=0)
Qt::MouseButton button() const
Returns the button that caused the event.
static QWidgetList topLevelWidgets()
Returns a list of the top-level widgets (windows) in the application.
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
QPointer< QAction > action
virtual bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
The QMouseEvent class contains parameters that describe a mouse event.
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
static QWhatsThisPrivate * instance
void setDefaultFont(const QFont &font)
Sets the default font to use in the document layout.
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
void mouseMoveEvent(QMouseEvent *)
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
void setLeft(int pos)
Sets the left edge of the rectangle to the given x coordinate.
int y() const
Returns the y-coordinate of the rectangle's top edge.
void clear()
Clears the contents of the string and makes it empty.
int x() const
Returns the x-coordinate of the rectangle's left edge.
QObject * parent() const
Returns a pointer to the parent object.
The QWhatsThisClickedEvent class provides an event that can be used to handle hyperlinks in a "What's...
The QPoint class defines a point in the plane using integer precision.
QAbstractTextDocumentLayout * documentLayout() const
Returns the document layout for this document.
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
The QAbstractTextDocumentLayout::PaintContext class is a convenience class defining the parameters us...
void setPen(const QColor &color)
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
void setUndoRedoEnabled(bool enable)
QPointer< QWidget > widget
The QRect class defines a rectangle in the plane using integer precision.
void setIcon(const QIcon &icon)
void paintEvent(QPaintEvent *)
This event handler can be reimplemented in a subclass to receive paint events passed in event...
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
int y() const
Returns the y coordinate of this point.
The QPixmap class is an off-screen image representation that can be used as a paint device...
The QTextDocument class holds formatted text that can be viewed and edited using a QTextEdit...
const QBrush & toolTipText() const
Returns the tool tip text brush of the current color group.
static void setOverrideCursor(const QCursor &)
Use changeOverrideCursor(cursor) (if replace is true) or setOverrideCursor(cursor) (if replace is fal...
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device...
static QPixmap grabWindow(WId, int x=0, int y=0, int w=-1, int h=-1)
Creates and returns a pixmap constructed by grabbing the contents of the given window restricted by Q...
int x() const
Returns the x coordinate of this point.
static void restoreOverrideCursor()
Undoes the last setOverrideCursor().
static void showText(const QPoint &pos, const QString &text, QWidget *w=0)
Shows text as a "What's This?" window, at global position pos.
static void hideText()
If a "What's This?" window is showing, this destroys it.
The QPaintEvent class contains event parameters for paint events.
static QAction * createAction(QObject *parent=0)
Returns a ready-made QAction, used to invoke "What's This?" context help, with the given parent...
void translate(int dx, int dy)
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position...
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
const QPoint & globalPos() const
Returns the global position of the mouse cursor at the time of the event.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
QWhatsThat(const QString &txt, QWidget *parent, QWidget *showTextFor)
void triggered(bool checked=false)
This signal is emitted when an action is activated by the user; for example, when the user clicks a m...
The QAction class provides an abstract user interface action that can be inserted into widgets...
static void enterWhatsThisMode()
This function switches the user interface into "What's This?" mode.
static void leaveWhatsThisMode()
If the user interface is in "What's This?" mode, this function switches back to normal mode; otherwis...
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
int screen() const
Returns the number of the screen currently in use.
virtual void draw(QPainter *painter, const PaintContext &context)=0
Draws the layout with the given painter using the given context.
The QList class is a template class that provides lists.
The QHelpEvent class provides an event that is used to request helpful information about a particular...
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.