42 # include <private/qcore_mac_p.h> 56 #include <private/qeffects_p.h> 59 #include <private/qstylesheetstyle_p.h> 63 # include <private/qcore_mac_p.h> 64 #include <private/qt_cocoa_helpers_mac_p.h> 150 #ifndef QT_NO_STYLE_STYLESHEET 172 #ifndef QT_NO_STYLE_STYLESHEET 188 qApp->installEventFilter(
this);
197 int time = 10000 + 40 *
qMax(0,
text().length()-100);
204 #ifndef QT_NO_STYLE_STYLESHEET 277 qWarning(
"QToolTip::setTipRect: Cannot pass null widget if rect is set");
290 #if defined(Q_WS_MAC) && !defined(QT_NO_EFFECTS) 314 Qt::KeyboardModifiers mody =
static_cast<QKeyEvent *
>(e)->modifiers();
355 #ifndef QT_NO_STYLE_STYLESHEET 369 #endif //QT_NO_STYLE_STYLESHEET 379 if(qt_mac_app_fullscreen)
395 if (p.
x() + this->
width() > screen.
x() + screen.
width())
399 if (p.
y() < screen.
y())
401 if (p.
x() + this->
width() > screen.
x() + screen.
width())
403 if (p.
x() < screen.
x())
412 if (QTipLabel::instance->
text() != text)
445 if (QTipLabel::instance && QTipLabel::instance->
isVisible()){
447 QTipLabel::instance->
hideTip();
450 else if (!QTipLabel::instance->
fadingOut){
456 if (QTipLabel::instance->
tipChanged(localPos, text, w)){
457 QTipLabel::instance->
reuseTip(text);
459 QTipLabel::instance->
placeTip(pos, w);
474 QTipLabel::instance->
placeTip(pos, w);
478 #if !defined(QT_NO_EFFECTS) && !defined(Q_WS_MAC) 484 QTipLabel::instance->
show();
486 QTipLabel::instance->
show();
529 return (QTipLabel::instance != 0 && QTipLabel::instance->
isVisible());
543 if (QTipLabel::instance)
544 return QTipLabel::instance->
text();
559 return *tooltip_palette();
589 if (QTipLabel::instance)
642 #include "qtooltip.moc" 643 #endif // QT_NO_TOOLTIP The QVariant class acts like a union for the most common Qt data types.
QLabel(QWidget *parent=0, Qt::WindowFlags f=0)
Constructs an empty label.
void paintEvent(QPaintEvent *e)
This event handler can be reimplemented in a subclass to receive paint events passed in event...
void styleSheetParentDestroyed()
The QKeyEvent class describes a key event.
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
The QFontMetrics class provides font metrics information.
#define QT_END_NAMESPACE
This macro expands to.
void setWordWrap(bool on)
QWidget * styleSheetParent
void hideTipImmediately()
void setTipRect(QWidget *w, const QRect &r)
int descent() const
Returns the descent of the font.
void setText(const QString &)
static QTipLabel * instance
void mouseMoveEvent(QMouseEvent *e)
This event handler, for event event, can be reimplemented in a subclass to receive mouse move events ...
#define Q_WS_WIN
Defined on Windows.
bool setProperty(const char *name, const QVariant &value)
Sets the value of the object's name property to value.
Q_GUI_EXPORT bool mightBeRichText(const QString &)
Returns true if the string text is likely to be rich text; otherwise returns false.
bool isActive() const
Returns true if the timer is running and has not been stopped; otherwise returns false.
int width() const
Returns the width of the rectangle.
QTipLabel(const QString &text, QWidget *w)
int & ry()
Returns a reference to the y coordinate of this point.
QSize sizeHint() const
em>Reimplemented Function
void init(const QWidget *w)
Use initFrom(widget) instead.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int height() const
Returns the height of the rectangle.
The QString class provides a Unicode character string.
void mouseMoveEvent(QMouseEvent *ev)
em>Reimplemented Function
The QObject class is the base class of all Qt objects.
bool tipChanged(const QPoint &pos, const QString &text, QObject *o)
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
void setObjectName(const QString &name)
static QFont font()
Returns the default application font.
int ascent() const
Returns the ascent of the font.
void restartExpireTimer()
#define QT_BEGIN_NAMESPACE
This macro expands to.
void destroyed(QObject *=0)
This signal is emitted immediately before the object obj is destroyed, and can not be blocked...
void drawPrimitive(QStyle::PrimitiveElement pe, const QStyleOption &opt)
Use the widget's style to draw a primitive element pe specified by QStyleOption option.
void qScrollEffect(QWidget *w, QEffects::DirFlags orient, int time)
Scroll widget w in time ms.
The QStyleOption class stores the parameters used by QStyle functions.
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.
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
The QResizeEvent class contains event parameters for resize events.
const char * styleHint(const QFontDef &request)
Q_CORE_EXPORT void qWarning(const char *,...)
int & rx()
Returns a reference to the x coordinate of this point.
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
The QStyleOptionFrame class is used to describe the parameters for drawing a frame.
bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
static QVariant fromValue(const T &value)
Returns a QVariant containing a copy of value.
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...
void stop()
Stops the timer.
The QMouseEvent class contains parameters that describe a mouse event.
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
The QStyleHintReturnMask class provides style hints that return a QRegion.
void setY(int y)
Sets the y coordinate of this point to the given y coordinate.
static bool isEffectEnabled(Qt::UIEffect)
Returns true if effect is enabled; otherwise returns false.
The QTimerEvent class contains parameters that describe a timer event.
The QFont class specifies a font used for drawing text.
int y() const
Returns the y-coordinate of the rectangle's top edge.
void reuseTip(const QString &text)
int x() const
Returns the x-coordinate of the rectangle's left edge.
bool qt_mac_app_fullscreen
void timerEvent(QTimerEvent *e)
This event handler can be reimplemented in a subclass to receive timer events for the object...
The QPoint class defines a point in the plane using integer precision.
void setFrameStyle(int)
Sets the frame style to style.
int & rheight()
Returns a reference to the height.
The QRect class defines a rectangle in the plane using integer precision.
int timerId() const
Returns the timer's ID.
void resizeEvent(QResizeEvent *e)
This event handler can be reimplemented in a subclass to receive widget resize events which are passe...
The QLabel widget provides a text or image display.
int y() const
Returns the y coordinate of this point.
void paintEvent(QPaintEvent *)
This event handler can be reimplemented in a subclass to receive paint events passed in event...
The QStylePainter class is a convenience class for drawing QStyle elements inside a widget...
The QBasicTimer class provides timer events for objects.
The QSize class defines the size of a two-dimensional object using integer point precision.
int x() const
Returns the x coordinate of this point.
QRegion region
the region for style hints that return a QRegion
The QPaintEvent class contains event parameters for paint events.
static void setFont(const QFont &, const char *className=0)
Changes the default application font to font.
void qFadeEffect(QWidget *w, int time)
Fade in widget w in time ms.
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.
void setX(int x)
Sets the x coordinate of this point to the given x coordinate.
static int getTipScreen(const QPoint &pos, QWidget *w)
void setAlignment(Qt::Alignment)
Without this function, a call to e.
void deleteLater()
Schedules this object for deletion.
void start(int msec, QObject *obj)
Starts (or restarts) the timer with a msec milliseconds timeout.
void placeTip(const QPoint &pos, QWidget *w)
void macWindowFade(void *window, float durationSeconds)
The QPalette class contains color groups for each widget state.