Convert features.whatsthis to QT_[REQUIRE_]CONFIG
Move feature definition to gui/configure.json Change-Id: I00b35c0e259d0a695d84a9bf6803eba74d41465a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
fa7626713b
commit
150ee7f4f1
@ -1020,6 +1020,12 @@
|
||||
"section": "Utilities",
|
||||
"condition": "!config.integrity",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"whatsthis": {
|
||||
"label": "QWhatsThis",
|
||||
"purpose": "Supports displaying \"What's this\" help.",
|
||||
"section": "Widget Support",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -95,7 +95,7 @@ public:
|
||||
inline void setStatusTip(const QString &statusTip);
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
inline QString whatsThis() const {
|
||||
return qvariant_cast<QString>(data(Qt::WhatsThisRole));
|
||||
}
|
||||
@ -272,7 +272,7 @@ inline void QStandardItem::setStatusTip(const QString &astatusTip)
|
||||
{ setData(astatusTip, Qt::StatusTipRole); }
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
inline void QStandardItem::setWhatsThis(const QString &awhatsThis)
|
||||
{ setData(awhatsThis, Qt::WhatsThisRole); }
|
||||
#endif
|
||||
|
@ -3325,7 +3325,7 @@ QStatusTipEvent::~QStatusTipEvent()
|
||||
|
||||
#endif // QT_NO_STATUSTIP
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
|
||||
/*!
|
||||
\class QWhatsThisClickedEvent
|
||||
@ -3362,7 +3362,7 @@ QWhatsThisClickedEvent::~QWhatsThisClickedEvent()
|
||||
This?" text.
|
||||
*/
|
||||
|
||||
#endif // QT_NO_WHATSTHIS
|
||||
#endif // QT_CONFIG(whatsthis)
|
||||
|
||||
#ifndef QT_NO_ACTION
|
||||
|
||||
|
@ -699,7 +699,7 @@ private:
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
class Q_GUI_EXPORT QWhatsThisClickedEvent : public QEvent
|
||||
{
|
||||
public:
|
||||
|
@ -860,7 +860,7 @@ void QWindowSystemInterface::handleContextMenuEvent(QWindow *window, bool mouseT
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
void QWindowSystemInterface::handleEnterWhatsThisEvent()
|
||||
{
|
||||
QWindowSystemInterfacePrivate::WindowSystemEvent *e =
|
||||
|
@ -236,7 +236,7 @@ public:
|
||||
const QPoint &pos, const QPoint &globalPos,
|
||||
Qt::KeyboardModifiers modifiers);
|
||||
#endif
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
static void handleEnterWhatsThisEvent();
|
||||
#endif
|
||||
|
||||
|
@ -51,7 +51,9 @@
|
||||
#include <qstyle.h>
|
||||
#include <qstyleoption.h>
|
||||
#include <qtooltip.h>
|
||||
#if QT_CONFIG(whatsthis)
|
||||
#include <qwhatsthis.h>
|
||||
#endif
|
||||
#include <qtreeview.h>
|
||||
#include <private/qtabbar_p.h>
|
||||
#include <QAbstractScrollArea>
|
||||
|
@ -48,7 +48,9 @@
|
||||
#include "qlabel.h"
|
||||
#endif
|
||||
#include "qtooltip.h"
|
||||
#if QT_CONFIG(whatsthis)
|
||||
#include "qwhatsthis.h"
|
||||
#endif
|
||||
#include "qwidget.h"
|
||||
#include "qdebug.h"
|
||||
#include <qmath.h>
|
||||
@ -436,7 +438,7 @@ QString QAccessibleWidget::text(QAccessible::Text t) const
|
||||
#endif
|
||||
break;
|
||||
case QAccessible::Help:
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
str = widget()->whatsThis();
|
||||
#endif
|
||||
break;
|
||||
|
@ -432,13 +432,6 @@
|
||||
"section": "Widgets",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"whatsthis": {
|
||||
"label": "QWhatsThis",
|
||||
"purpose": "Supports displaying \"What's this\" help.",
|
||||
"section": "Widgets",
|
||||
"condition": "features.toolbutton",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"sizegrip": {
|
||||
"label": "QSizeGrip",
|
||||
"purpose": "Provides corner-grips for resizing top-level windows.",
|
||||
|
@ -46,7 +46,9 @@
|
||||
#include "qapplication.h"
|
||||
#include "qlayout.h"
|
||||
#include "qsizegrip.h"
|
||||
#if QT_CONFIG(whatsthis)
|
||||
#include "qwhatsthis.h"
|
||||
#endif
|
||||
#include "qmenu.h"
|
||||
#include "qcursor.h"
|
||||
#include "qmessagebox.h"
|
||||
@ -607,7 +609,7 @@ bool QDialog::eventFilter(QObject *o, QEvent *e)
|
||||
/*! \reimp */
|
||||
void QDialog::contextMenuEvent(QContextMenuEvent *e)
|
||||
{
|
||||
#if defined(QT_NO_WHATSTHIS) || defined(QT_NO_MENU)
|
||||
#if !QT_CONFIG(whatsthis) || defined(QT_NO_MENU)
|
||||
Q_UNUSED(e);
|
||||
#else
|
||||
QWidget *w = childAt(e->pos());
|
||||
@ -672,7 +674,7 @@ void QDialog::keyPressEvent(QKeyEvent *e)
|
||||
/*! \reimp */
|
||||
void QDialog::closeEvent(QCloseEvent *e)
|
||||
{
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
if (isModal() && QWhatsThis::inWhatsThisMode())
|
||||
QWhatsThis::leaveWhatsThisMode();
|
||||
#endif
|
||||
|
@ -43,7 +43,9 @@
|
||||
#include <qabstractitemmodel.h>
|
||||
#include <qabstractitemview.h>
|
||||
#include <qfontmetrics.h>
|
||||
#if QT_CONFIG(whatsthis)
|
||||
#include <qwhatsthis.h>
|
||||
#endif
|
||||
#include <qtooltip.h>
|
||||
#include <qevent.h>
|
||||
#include <qstring.h>
|
||||
@ -393,7 +395,7 @@ bool QAbstractItemDelegate::helpEvent(QHelpEvent *event,
|
||||
}
|
||||
break;}
|
||||
#endif
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
case QEvent::QueryWhatsThis: {
|
||||
if (index.data(Qt::WhatsThisRole).isValid())
|
||||
return true;
|
||||
|
@ -48,7 +48,6 @@
|
||||
#include <qdrag.h>
|
||||
#include <qevent.h>
|
||||
#include <qscrollbar.h>
|
||||
#include <qwhatsthis.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qdatetime.h>
|
||||
#include <qlineedit.h>
|
||||
|
@ -47,7 +47,9 @@
|
||||
#include <qpainter.h>
|
||||
#include <qscrollbar.h>
|
||||
#include <qtooltip.h>
|
||||
#if QT_CONFIG(whatsthis)
|
||||
#include <qwhatsthis.h>
|
||||
#endif
|
||||
#include <qstyle.h>
|
||||
#include <qstyleoption.h>
|
||||
#include <qvector.h>
|
||||
@ -2641,7 +2643,7 @@ bool QHeaderView::viewportEvent(QEvent *e)
|
||||
}
|
||||
break; }
|
||||
#endif
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
case QEvent::QueryWhatsThis: {
|
||||
QHelpEvent *he = static_cast<QHelpEvent*>(e);
|
||||
int logical = logicalIndexAt(he->pos());
|
||||
@ -2661,7 +2663,7 @@ bool QHeaderView::viewportEvent(QEvent *e)
|
||||
}
|
||||
}
|
||||
break; }
|
||||
#endif // QT_NO_WHATSTHIS
|
||||
#endif // QT_CONFIG(whatsthis)
|
||||
#ifndef QT_NO_STATUSTIP
|
||||
case QEvent::StatusTip: {
|
||||
QHelpEvent *he = static_cast<QHelpEvent*>(e);
|
||||
|
@ -99,7 +99,7 @@ public:
|
||||
inline void setToolTip(const QString &toolTip);
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
inline QString whatsThis() const
|
||||
{ return data(Qt::WhatsThisRole).toString(); }
|
||||
inline void setWhatsThis(const QString &whatsThis);
|
||||
@ -179,7 +179,7 @@ inline void QListWidgetItem::setToolTip(const QString &atoolTip)
|
||||
{ setData(Qt::ToolTipRole, atoolTip); }
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
inline void QListWidgetItem::setWhatsThis(const QString &awhatsThis)
|
||||
{ setData(Qt::WhatsThisRole, awhatsThis); }
|
||||
#endif
|
||||
|
@ -116,7 +116,7 @@ public:
|
||||
inline void setToolTip(const QString &toolTip);
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
inline QString whatsThis() const
|
||||
{ return data(Qt::WhatsThisRole).toString(); }
|
||||
inline void setWhatsThis(const QString &whatsThis);
|
||||
@ -196,7 +196,7 @@ inline void QTableWidgetItem::setToolTip(const QString &atoolTip)
|
||||
{ setData(Qt::ToolTipRole, atoolTip); }
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
inline void QTableWidgetItem::setWhatsThis(const QString &awhatsThis)
|
||||
{ setData(Qt::WhatsThisRole, awhatsThis); }
|
||||
#endif
|
||||
|
@ -119,7 +119,7 @@ public:
|
||||
inline void setToolTip(int column, const QString &toolTip);
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
inline QString whatsThis(int column) const
|
||||
{ return data(column, Qt::WhatsThisRole).toString(); }
|
||||
inline void setWhatsThis(int column, const QString &whatsThis);
|
||||
@ -234,7 +234,7 @@ inline void QTreeWidgetItem::setToolTip(int column, const QString &atoolTip)
|
||||
{ setData(column, Qt::ToolTipRole, atoolTip); }
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
inline void QTreeWidgetItem::setWhatsThis(int column, const QString &awhatsThis)
|
||||
{ setData(column, Qt::WhatsThisRole, awhatsThis); }
|
||||
#endif
|
||||
|
@ -24,7 +24,6 @@ HEADERS += \
|
||||
kernel/qsizepolicy.h \
|
||||
kernel/qstackedlayout.h \
|
||||
kernel/qtooltip.h \
|
||||
kernel/qwhatsthis.h \
|
||||
kernel/qwidget.h \
|
||||
kernel/qwidget_p.h \
|
||||
kernel/qwidgetaction.h \
|
||||
@ -52,7 +51,6 @@ SOURCES += \
|
||||
kernel/qsizepolicy.cpp \
|
||||
kernel/qstackedlayout.cpp \
|
||||
kernel/qtooltip.cpp \
|
||||
kernel/qwhatsthis.cpp \
|
||||
kernel/qwidget.cpp \
|
||||
kernel/qwidgetaction.cpp \
|
||||
kernel/qgesture.cpp \
|
||||
@ -87,3 +85,8 @@ qtConfig(formlayout) {
|
||||
HEADERS += kernel/qformlayout.h
|
||||
SOURCES += kernel/qformlayout.cpp
|
||||
}
|
||||
|
||||
qtConfig(whatsthis) {
|
||||
HEADERS += kernel/qwhatsthis.h
|
||||
SOURCES += kernel/qwhatsthis.cpp
|
||||
}
|
||||
|
@ -73,7 +73,7 @@
|
||||
#include <QtGui/private/qwindow_p.h>
|
||||
#include <QtGui/qtouchdevice.h>
|
||||
#include <qpa/qplatformtheme.h>
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
#include <QtWidgets/QWhatsThis>
|
||||
#endif
|
||||
|
||||
@ -1999,7 +1999,7 @@ bool QApplication::event(QEvent *e)
|
||||
} else if (te->timerId() == d->toolTipFallAsleep.timerId()) {
|
||||
d->toolTipFallAsleep.stop();
|
||||
}
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
} else if (e->type() == QEvent::EnterWhatsThisMode) {
|
||||
QWhatsThis::enterWhatsThisMode();
|
||||
return true;
|
||||
@ -3381,7 +3381,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
|
||||
break;
|
||||
#endif // QT_CONFIG(tabletevent)
|
||||
|
||||
#if !defined(QT_NO_TOOLTIP) || !defined(QT_NO_WHATSTHIS)
|
||||
#if !defined(QT_NO_TOOLTIP) || QT_CONFIG(whatsthis)
|
||||
case QEvent::ToolTip:
|
||||
case QEvent::WhatsThis:
|
||||
case QEvent::QueryWhatsThis:
|
||||
@ -3406,7 +3406,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#if !defined(QT_NO_STATUSTIP) || !defined(QT_NO_WHATSTHIS)
|
||||
#if !defined(QT_NO_STATUSTIP) || QT_CONFIG(whatsthis)
|
||||
case QEvent::StatusTip:
|
||||
case QEvent::WhatsThisClicked:
|
||||
{
|
||||
|
@ -42,7 +42,9 @@
|
||||
|
||||
#ifndef QT_NO_SHORTCUT
|
||||
#include <qevent.h>
|
||||
#if QT_CONFIG(whatsthis)
|
||||
#include <qwhatsthis.h>
|
||||
#endif
|
||||
#include <qmenu.h>
|
||||
#include <qmenubar.h>
|
||||
#include <qapplication.h>
|
||||
@ -641,7 +643,7 @@ bool QShortcut::event(QEvent *e)
|
||||
if (d->sc_enabled && e->type() == QEvent::Shortcut) {
|
||||
QShortcutEvent *se = static_cast<QShortcutEvent *>(e);
|
||||
if (se->shortcutId() == d->sc_id && se->key() == d->sc_sequence){
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
if (QWhatsThis::inWhatsThisMode()) {
|
||||
QWhatsThis::showText(QCursor::pos(), d->sc_whatsthis);
|
||||
handled = true;
|
||||
|
@ -38,7 +38,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "qwhatsthis.h"
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#include "qpointer.h"
|
||||
#include "qapplication.h"
|
||||
#include <private/qguiapplication_p.h>
|
||||
@ -54,7 +53,6 @@
|
||||
#include "qtextdocument.h"
|
||||
#include <qpa/qplatformtheme.h>
|
||||
#include "private/qtextdocumentlayout_p.h"
|
||||
#include "qtoolbutton.h"
|
||||
#include "qdebug.h"
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
#include "qaccessible.h"
|
||||
@ -681,5 +679,3 @@ QAction *QWhatsThis::createAction(QObject *parent)
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "qwhatsthis.moc"
|
||||
|
||||
#endif // QT_NO_WHATSTHIS
|
||||
|
@ -44,11 +44,10 @@
|
||||
#include <QtCore/qobject.h>
|
||||
#include <QtGui/qcursor.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(whatsthis);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
|
||||
class QAction;
|
||||
|
||||
class Q_WIDGETS_EXPORT QWhatsThis
|
||||
@ -67,8 +66,6 @@ public:
|
||||
|
||||
};
|
||||
|
||||
#endif // QT_NO_WHATSTHIS
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QWHATSTHIS_H
|
||||
|
@ -71,7 +71,9 @@
|
||||
#include "private/qwidgetwindow_p.h"
|
||||
#include "qpainter.h"
|
||||
#include "qtooltip.h"
|
||||
#if QT_CONFIG(whatsthis)
|
||||
#include "qwhatsthis.h"
|
||||
#endif
|
||||
#include "qdebug.h"
|
||||
#include "private/qstylesheetstyle_p.h"
|
||||
#include "private/qstyle_p.h"
|
||||
@ -8853,7 +8855,7 @@ bool QWidget::event(QEvent *event)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
if (!k->isAccepted()
|
||||
&& k->modifiers() & Qt::ShiftModifier && k->key() == Qt::Key_F1
|
||||
&& d->whatsThis.size()) {
|
||||
@ -9152,7 +9154,7 @@ bool QWidget::event(QEvent *event)
|
||||
event->ignore();
|
||||
break;
|
||||
#endif
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
case QEvent::WhatsThis:
|
||||
if (d->whatsThis.size())
|
||||
QWhatsThis::showText(static_cast<QHelpEvent *>(event)->globalPos(), d->whatsThis, this);
|
||||
@ -11579,7 +11581,7 @@ QString QWidget::statusTip() const
|
||||
}
|
||||
#endif // QT_NO_STATUSTIP
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
/*!
|
||||
\property QWidget::whatsThis
|
||||
|
||||
@ -11600,7 +11602,7 @@ QString QWidget::whatsThis() const
|
||||
Q_D(const QWidget);
|
||||
return d->whatsThis;
|
||||
}
|
||||
#endif // QT_NO_WHATSTHIS
|
||||
#endif // QT_CONFIG(whatsthis)
|
||||
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
/*!
|
||||
|
@ -186,7 +186,7 @@ class Q_WIDGETS_EXPORT QWidget : public QObject, public QPaintDevice
|
||||
#ifndef QT_NO_STATUSTIP
|
||||
Q_PROPERTY(QString statusTip READ statusTip WRITE setStatusTip)
|
||||
#endif
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
Q_PROPERTY(QString whatsThis READ whatsThis WRITE setWhatsThis)
|
||||
#endif
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
@ -390,7 +390,7 @@ public:
|
||||
void setStatusTip(const QString &);
|
||||
QString statusTip() const;
|
||||
#endif
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
void setWhatsThis(const QString &);
|
||||
QString whatsThis() const;
|
||||
#endif
|
||||
|
@ -697,7 +697,7 @@ public:
|
||||
#ifndef QT_NO_STATUSTIP
|
||||
QString statusTip;
|
||||
#endif
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
QString whatsThis;
|
||||
#endif
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
|
@ -243,10 +243,10 @@ static QEvent *cloneEvent(QEvent *e)
|
||||
case QEvent::ShortcutOverride:
|
||||
return new QKeyEvent(*static_cast<QKeyEvent*>(e));
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
case QEvent::WhatsThisClicked:
|
||||
return new QWhatsThisClickedEvent(*static_cast<QWhatsThisClickedEvent*>(e));
|
||||
#endif //QT_NO_WHATSTHIS
|
||||
#endif // QT_CONFIG(whatsthis)
|
||||
|
||||
#ifndef QT_NO_TOOLBAR
|
||||
case QEvent::ToolBarChange:
|
||||
|
@ -60,7 +60,6 @@
|
||||
#include "qvalidator.h"
|
||||
#include "qvariant.h"
|
||||
#include "qvector.h"
|
||||
#include "qwhatsthis.h"
|
||||
#include "qdebug.h"
|
||||
#include "qtextedit.h"
|
||||
#include <private/qtextedit_p.h>
|
||||
|
@ -153,7 +153,9 @@
|
||||
#include <QStylePainter>
|
||||
#include <QVBoxLayout>
|
||||
#include <QMouseEvent>
|
||||
#if QT_CONFIG(whatsthis)
|
||||
#include <QWhatsThis>
|
||||
#endif
|
||||
#include <QToolTip>
|
||||
#include <QMainWindow>
|
||||
#include <QScrollBar>
|
||||
@ -1490,7 +1492,7 @@ void QMdiSubWindowPrivate::processClickedSubControl()
|
||||
Q_Q(QMdiSubWindow);
|
||||
switch (activeSubControl) {
|
||||
case QStyle::SC_TitleBarContextHelpButton:
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
QWhatsThis::enterWhatsThisMode();
|
||||
#endif
|
||||
break;
|
||||
|
@ -59,7 +59,7 @@
|
||||
#ifndef QT_NO_EFFECTS
|
||||
# include <private/qeffects_p.h>
|
||||
#endif
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
# include <qwhatsthis.h>
|
||||
#endif
|
||||
|
||||
@ -187,7 +187,7 @@ private:
|
||||
void QMenuPrivate::init()
|
||||
{
|
||||
Q_Q(QMenu);
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
q->setAttribute(Qt::WA_CustomWhatsThis);
|
||||
#endif
|
||||
q->setAttribute(Qt::WA_X11NetWmWindowTypePopupMenu);
|
||||
@ -1327,12 +1327,12 @@ void QMenuPrivate::activateCausedStack(const QVector<QPointer<QWidget> > &caused
|
||||
void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e, bool self)
|
||||
{
|
||||
Q_Q(QMenu);
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
bool inWhatsThisMode = QWhatsThis::inWhatsThisMode();
|
||||
#endif
|
||||
if (!action || !q->isEnabled()
|
||||
|| (action_e == QAction::Trigger
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
&& !inWhatsThisMode
|
||||
#endif
|
||||
&& (action->isSeparator() ||!action->isEnabled())))
|
||||
@ -1343,7 +1343,7 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e
|
||||
*/
|
||||
const QVector<QPointer<QWidget> > causedStack = calcCausedStack();
|
||||
if (action_e == QAction::Trigger) {
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
if (!inWhatsThisMode)
|
||||
actionAboutToTrigger = action;
|
||||
#endif
|
||||
@ -1362,7 +1362,7 @@ void QMenuPrivate::activateAction(QAction *action, QAction::ActionEvent action_e
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
if (inWhatsThisMode) {
|
||||
QString s = action->whatsThis();
|
||||
if (s.isEmpty())
|
||||
@ -2971,7 +2971,7 @@ QMenu::event(QEvent *e)
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_TOOLTIP
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
case QEvent::QueryWhatsThis:
|
||||
e->setAccepted(d->whatsThis.size());
|
||||
if (QAction *action = d->actionAt(static_cast<QHelpEvent*>(e)->pos())) {
|
||||
@ -3233,7 +3233,7 @@ void QMenu::keyPressEvent(QKeyEvent *e)
|
||||
key_consumed = true;
|
||||
break; }
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
case Qt::Key_F1:
|
||||
if (!d->currentAction || d->currentAction->whatsThis().isNull())
|
||||
break;
|
||||
|
@ -52,7 +52,9 @@
|
||||
#include <qmainwindow.h>
|
||||
#include <qtoolbar.h>
|
||||
#include <qtoolbutton.h>
|
||||
#if QT_CONFIG(whatsthis)
|
||||
#include <qwhatsthis.h>
|
||||
#endif
|
||||
#include <qpa/qplatformtheme.h>
|
||||
#include "private/qguiapplication_p.h"
|
||||
#include "qpa/qplatformintegration.h"
|
||||
@ -1013,7 +1015,7 @@ void QMenuBar::mousePressEvent(QMouseEvent *e)
|
||||
QAction *action = d->actionAt(e->pos());
|
||||
if (!action || !d->isVisible(action) || !action->isEnabled()) {
|
||||
d->setCurrentAction(0);
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
if (QWhatsThis::inWhatsThisMode())
|
||||
QWhatsThis::showText(e->globalPos(), d->whatsThis, this);
|
||||
#endif
|
||||
@ -1432,7 +1434,7 @@ bool QMenuBar::event(QEvent *e)
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
case QEvent::QueryWhatsThis:
|
||||
e->setAccepted(d->whatsThis.size());
|
||||
if (QAction *action = d->actionAt(static_cast<QHelpEvent*>(e)->pos())) {
|
||||
|
@ -49,7 +49,9 @@
|
||||
#include "qstylepainter.h"
|
||||
#include "qtabwidget.h"
|
||||
#include "qtooltip.h"
|
||||
#if QT_CONFIG(whatsthis)
|
||||
#include "qwhatsthis.h"
|
||||
#endif
|
||||
#include "private/qtextengine_p.h"
|
||||
#ifndef QT_NO_ACCESSIBILITY
|
||||
#include "qaccessible.h"
|
||||
@ -1220,7 +1222,7 @@ QString QTabBar::tabToolTip(int index) const
|
||||
}
|
||||
#endif // QT_NO_TOOLTIP
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
/*!
|
||||
\since 4.1
|
||||
|
||||
@ -1248,7 +1250,7 @@ QString QTabBar::tabWhatsThis(int index) const
|
||||
return QString();
|
||||
}
|
||||
|
||||
#endif // QT_NO_WHATSTHIS
|
||||
#endif // QT_CONFIG(whatsthis)
|
||||
|
||||
/*!
|
||||
Sets the data of the tab at position \a index to \a data.
|
||||
@ -1628,7 +1630,7 @@ bool QTabBar::event(QEvent *event)
|
||||
}
|
||||
}
|
||||
#endif // QT_NO_TOOLTIP
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
} else if (event->type() == QEvent::QueryWhatsThis) {
|
||||
const QTabBarPrivate::Tab *tab = d->at(d->indexAtPos(static_cast<QHelpEvent*>(event)->pos()));
|
||||
if (!tab || tab->whatsThis.isEmpty())
|
||||
@ -1642,7 +1644,7 @@ bool QTabBar::event(QEvent *event)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif // QT_NO_WHATSTHIS
|
||||
#endif // QT_CONFIG(whatsthis)
|
||||
#ifndef QT_NO_SHORTCUT
|
||||
} else if (event->type() == QEvent::Shortcut) {
|
||||
QShortcutEvent *se = static_cast<QShortcutEvent *>(event);
|
||||
|
@ -123,7 +123,7 @@ public:
|
||||
QString tabToolTip(int index) const;
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
void setTabWhatsThis(int index, const QString &text);
|
||||
QString tabWhatsThis(int index) const;
|
||||
#endif
|
||||
|
@ -118,7 +118,7 @@ public:
|
||||
#ifndef QT_NO_TOOLTIP
|
||||
QString toolTip;
|
||||
#endif
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
QString whatsThis;
|
||||
#endif
|
||||
QIcon icon;
|
||||
|
@ -1163,7 +1163,7 @@ QString QTabWidget::tabToolTip(int index) const
|
||||
}
|
||||
#endif // QT_NO_TOOLTIP
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
/*!
|
||||
\since 4.1
|
||||
|
||||
@ -1187,7 +1187,7 @@ QString QTabWidget::tabWhatsThis(int index) const
|
||||
Q_D(const QTabWidget);
|
||||
return d->tabs->tabWhatsThis(index);
|
||||
}
|
||||
#endif // QT_NO_WHATSTHIS
|
||||
#endif // QT_CONFIG(whatsthis)
|
||||
|
||||
/*!
|
||||
This virtual handler is called after a new tab was added or
|
||||
|
@ -94,7 +94,7 @@ public:
|
||||
QString tabToolTip(int index) const;
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
void setTabWhatsThis(int index, const QString &text);
|
||||
QString tabWhatsThis(int index) const;
|
||||
#endif
|
||||
|
@ -52,7 +52,9 @@
|
||||
#include <qtextcodec.h>
|
||||
#include <qpainter.h>
|
||||
#include <qdir.h>
|
||||
#if QT_CONFIG(whatsthis)
|
||||
#include <qwhatsthis.h>
|
||||
#endif
|
||||
#include <qtextobject.h>
|
||||
#include <qdesktopservices.h>
|
||||
|
||||
@ -307,7 +309,7 @@ void QTextBrowserPrivate::setSource(const QUrl &url)
|
||||
#ifndef QT_NO_CURSOR
|
||||
QApplication::restoreOverrideCursor();
|
||||
#endif
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
QWhatsThis::showText(QCursor::pos(), txt, q);
|
||||
#endif
|
||||
return;
|
||||
|
@ -922,7 +922,7 @@ void QToolButton::setDefaultAction(QAction *action)
|
||||
#ifndef QT_NO_STATUSTIP
|
||||
setStatusTip(action->statusTip());
|
||||
#endif
|
||||
#ifndef QT_NO_WHATSTHIS
|
||||
#if QT_CONFIG(whatsthis)
|
||||
setWhatsThis(action->whatsThis());
|
||||
#endif
|
||||
#ifndef QT_NO_MENU
|
||||
|
Loading…
x
Reference in New Issue
Block a user