Auto tests: revise cursor dependant tests
Cursor dependant auto tests are currently skipped in various ways. Some are checking PlatformQuirks::haveMouseCursor() that tries to detect if the desktop environment is MeeGo, using obsolete Q_WS_X11. Some are skipped if QT_NO_CURSOR or Q_OS_WINCE is defined and some are actually missing the approriate guards. => unify by defining QTEST_NO_CURSOR in qtest-config.h when appropriate ie. for platforms that have no regular mouse cursor support or when QT_NO_CURSOR is defined. Task-number: QTBUG-22551 Change-Id: I9a1e0e3156617945ae46226c79268955454c8a9a Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
This commit is contained in:
parent
dc0d5bf387
commit
6b04ee10e6
@ -48,6 +48,8 @@
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPen>
|
||||
|
||||
#include "../../../qtest-config.h"
|
||||
|
||||
Q_DECLARE_METATYPE(QBitArray)
|
||||
Q_DECLARE_METATYPE(qint64)
|
||||
|
||||
@ -78,8 +80,10 @@ private slots:
|
||||
void stream_QByteArray_data();
|
||||
void stream_QByteArray();
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void stream_QCursor_data();
|
||||
void stream_QCursor();
|
||||
#endif
|
||||
|
||||
void stream_QDate_data();
|
||||
void stream_QDate();
|
||||
@ -193,7 +197,9 @@ private:
|
||||
void writeQBrush(QDataStream *s);
|
||||
void writeQColor(QDataStream *s);
|
||||
void writeQByteArray(QDataStream *s);
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void writeQCursor(QDataStream *s);
|
||||
#endif
|
||||
void writeQWaitCursor(QDataStream *s);
|
||||
void writeQDate(QDataStream *s);
|
||||
void writeQTime(QDataStream *s);
|
||||
@ -220,7 +226,9 @@ private:
|
||||
void readQBrush(QDataStream *s);
|
||||
void readQColor(QDataStream *s);
|
||||
void readQByteArray(QDataStream *s);
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void readQCursor(QDataStream *s);
|
||||
#endif
|
||||
void readQDate(QDataStream *s);
|
||||
void readQTime(QDataStream *s);
|
||||
void readQDateTime(QDataStream *s);
|
||||
@ -999,7 +1007,7 @@ void tst_QDataStream::readQByteArray(QDataStream *s)
|
||||
}
|
||||
|
||||
// ************************************
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
static QCursor qCursorData(int index)
|
||||
{
|
||||
switch (index) {
|
||||
@ -1018,31 +1026,31 @@ static QCursor qCursorData(int index)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QDataStream::stream_QCursor_data()
|
||||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
stream_data(9);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QDataStream::stream_QCursor()
|
||||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
STREAM_IMPL(QCursor);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QDataStream::writeQCursor(QDataStream *s)
|
||||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
QCursor d5(qCursorData(dataIndex(QTest::currentDataTag())));
|
||||
*s << d5;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QDataStream::readQCursor(QDataStream *s)
|
||||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
QCursor test(qCursorData(dataIndex(QTest::currentDataTag())));
|
||||
QCursor d5;
|
||||
*s >> d5;
|
||||
@ -1061,8 +1069,8 @@ void tst_QDataStream::readQCursor(QDataStream *s)
|
||||
QPixmap expected = *(test.mask());
|
||||
QCOMPARE(actual, expected);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
// ************************************
|
||||
|
||||
|
@ -44,6 +44,8 @@
|
||||
#include <QtGui>
|
||||
#include <QtTest/QtTest>
|
||||
|
||||
#include "../../../qtest-config.h"
|
||||
|
||||
Q_DECLARE_METATYPE(QMetaType::Type)
|
||||
|
||||
class tst_QGuiMetaType: public QObject
|
||||
@ -133,11 +135,13 @@ template<> struct TypeComparator<QMetaType::QBitmap>
|
||||
{ return v1.size() == v2.size(); }
|
||||
};
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
template<> struct TypeComparator<QMetaType::QCursor>
|
||||
{
|
||||
static bool equal(const QCursor &v1, const QCursor &v2)
|
||||
{ return v1.shape() == v2.shape(); }
|
||||
};
|
||||
#endif
|
||||
|
||||
template <int ID>
|
||||
struct DefaultValueFactory
|
||||
@ -176,9 +180,11 @@ template<> struct TestValueFactory<QMetaType::QRegion> {
|
||||
template<> struct TestValueFactory<QMetaType::QBitmap> {
|
||||
static QBitmap *create() { return new QBitmap(16, 32); }
|
||||
};
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
template<> struct TestValueFactory<QMetaType::QCursor> {
|
||||
static QCursor *create() { return new QCursor(Qt::WaitCursor); }
|
||||
};
|
||||
#endif
|
||||
template<> struct TestValueFactory<QMetaType::QKeySequence> {
|
||||
static QKeySequence *create() { return new QKeySequence(QKeySequence::Close); }
|
||||
};
|
||||
|
@ -65,6 +65,7 @@
|
||||
|
||||
#include "tst_qvariant_common.h"
|
||||
|
||||
#include "../../../../qtest-config.h"
|
||||
|
||||
class tst_QGuiVariant : public QObject
|
||||
{
|
||||
@ -182,7 +183,7 @@ void tst_QGuiVariant::canConvert_data()
|
||||
var = QVariant::fromValue(QColor());
|
||||
QTest::newRow("Color")
|
||||
<< var << N << N << N << Y << Y << Y << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << Y << N << N << N << N;
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
var = QVariant::fromValue(QCursor());
|
||||
QTest::newRow("Cursor")
|
||||
<< var << N << N << N << N << N << N << Y << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N << N;
|
||||
@ -508,7 +509,7 @@ void tst_QGuiVariant::writeToReadFromDataStream_data()
|
||||
QTest::newRow( "bitmap_valid" ) << QVariant::fromValue( bitmap ) << false;
|
||||
QTest::newRow( "brush_valid" ) << QVariant::fromValue( QBrush( Qt::red ) ) << false;
|
||||
QTest::newRow( "color_valid" ) << QVariant::fromValue( QColor( Qt::red ) ) << false;
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
QTest::newRow( "cursor_valid" ) << QVariant::fromValue( QCursor( Qt::PointingHandCursor ) ) << false;
|
||||
#endif
|
||||
QTest::newRow( "font_valid" ) << QVariant::fromValue( QFont( "times", 12 ) ) << false;
|
||||
@ -676,12 +677,16 @@ void tst_QGuiVariant::implicitConstruction()
|
||||
void tst_QGuiVariant::guiVariantAtExit()
|
||||
{
|
||||
// crash test, it should not crash at QGuiApplication exit
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
static QVariant cursor = QCursor();
|
||||
#endif
|
||||
static QVariant point = QPoint();
|
||||
static QVariant icon = QIcon();
|
||||
static QVariant image = QImage();
|
||||
static QVariant palette = QPalette();
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
Q_UNUSED(cursor);
|
||||
#endif
|
||||
Q_UNUSED(point);
|
||||
Q_UNUSED(icon);
|
||||
Q_UNUSED(image);
|
||||
|
@ -39,27 +39,15 @@
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef PLATFORMQUIRKS_H
|
||||
#define PLATFORMQUIRKS_H
|
||||
#ifndef QTEST_CONFIG_H
|
||||
#define QTEST_CONFIG_H
|
||||
|
||||
#include <qglobal.h>
|
||||
|
||||
#ifdef QT_GUI_LIB
|
||||
#include <qapplication.h>
|
||||
#endif
|
||||
|
||||
|
||||
struct PlatformQuirks
|
||||
{
|
||||
static inline bool haveMouseCursor()
|
||||
{
|
||||
#if defined(Q_WS_X11)
|
||||
return X11->desktopEnvironment != DE_MEEGO_COMPOSITOR;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
# if defined(QT_NO_CURSOR) || defined(Q_OS_WINCE) || defined(MEEGO_EDITION_HARMATTAN)
|
||||
# define QTEST_NO_CURSOR
|
||||
# endif
|
||||
#endif // QTEST_NO_CURSOR
|
||||
|
||||
#endif // QTEST_CONFIG_H
|
@ -73,7 +73,7 @@ Q_DECLARE_METATYPE(QPainterPath)
|
||||
Q_DECLARE_METATYPE(QPointF)
|
||||
Q_DECLARE_METATYPE(QRectF)
|
||||
|
||||
#include "../../../platformquirks.h"
|
||||
#include "../../../qtest-config.h"
|
||||
|
||||
#if defined(Q_OS_WIN) && !defined(Q_OS_WINCE)
|
||||
#include <windows.h>
|
||||
@ -360,7 +360,9 @@ private slots:
|
||||
void filtersChildEvents();
|
||||
void filtersChildEvents2();
|
||||
void ensureVisible();
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void cursor();
|
||||
#endif
|
||||
//void textControlGetterSetter();
|
||||
void defaultItemTest_QGraphicsLineItem();
|
||||
void defaultItemTest_QGraphicsPixmapItem();
|
||||
@ -4145,9 +4147,9 @@ void tst_QGraphicsItem::ensureVisible()
|
||||
QTest::qWait(25);
|
||||
}
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QGraphicsItem::cursor()
|
||||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
QGraphicsScene scene;
|
||||
QGraphicsRectItem *item1 = scene.addRect(QRectF(0, 0, 50, 50));
|
||||
QGraphicsRectItem *item2 = scene.addRect(QRectF(0, 0, 50, 50));
|
||||
@ -4203,15 +4205,6 @@ void tst_QGraphicsItem::cursor()
|
||||
QApplication::sendEvent(view.viewport(), &event);
|
||||
}
|
||||
|
||||
if (!PlatformQuirks::haveMouseCursor())
|
||||
return;
|
||||
#if !defined(Q_OS_WINCE)
|
||||
QTest::qWait(250);
|
||||
#else
|
||||
// Test environment does not have any cursor, therefore no shape
|
||||
return;
|
||||
#endif
|
||||
|
||||
QCOMPARE(view.viewport()->cursor().shape(), item1->cursor().shape());
|
||||
|
||||
{
|
||||
@ -4233,8 +4226,8 @@ void tst_QGraphicsItem::cursor()
|
||||
QTest::qWait(25);
|
||||
|
||||
QCOMPARE(view.viewport()->cursor().shape(), cursor.shape());
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
void tst_QGraphicsItem::textControlGetterSetter()
|
||||
{
|
||||
@ -4499,7 +4492,7 @@ protected:
|
||||
case QGraphicsItem::ItemSceneHasChanged:
|
||||
break;
|
||||
case QGraphicsItem::ItemCursorChange:
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
oldValues << cursor();
|
||||
#endif
|
||||
break;
|
||||
|
@ -49,6 +49,8 @@
|
||||
#include <QMacStyle>
|
||||
#endif
|
||||
|
||||
#include "../../../qtest-config.h"
|
||||
|
||||
static void sendMouseMove(QWidget *widget, const QPoint &point, Qt::MouseButton button = Qt::NoButton)
|
||||
{
|
||||
QMouseEvent event(QEvent::MouseMove, point, widget->mapToGlobal(point), button, button, 0);
|
||||
@ -115,8 +117,10 @@ private slots:
|
||||
void focusNextPrevChild();
|
||||
void focusOutEvent_data();
|
||||
void focusOutEvent();
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void hoverEnterLeaveEvent_data();
|
||||
void hoverEnterLeaveEvent();
|
||||
#endif
|
||||
void hoverMoveEvent_data();
|
||||
void hoverMoveEvent();
|
||||
void keyPressEvent_data();
|
||||
@ -154,7 +158,9 @@ private slots:
|
||||
void setFocus_complexTwoWidgets();
|
||||
void popup_basic();
|
||||
void popup_subwidget();
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void changingCursor_basic();
|
||||
#endif
|
||||
void tooltip_basic();
|
||||
void childPos_data();
|
||||
void childPos();
|
||||
@ -423,7 +429,7 @@ void tst_QGraphicsProxyWidget::setWidget()
|
||||
}
|
||||
|
||||
QWidget *widget = new QWidget;
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
widget->setCursor(Qt::IBeamCursor);
|
||||
#endif
|
||||
widget->setPalette(QPalette(Qt::magenta));
|
||||
@ -461,7 +467,7 @@ void tst_QGraphicsProxyWidget::setWidget()
|
||||
QVERIFY(subWidget->testAttribute(Qt::WA_DontShowOnScreen));
|
||||
QVERIFY(!subWidget->testAttribute(Qt::WA_QuitOnClose));
|
||||
QCOMPARE(proxy->acceptHoverEvents(), true);
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
QVERIFY(proxy->hasCursor());
|
||||
|
||||
// These should match
|
||||
@ -938,6 +944,7 @@ protected:
|
||||
}
|
||||
};
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent_data()
|
||||
{
|
||||
QTest::addColumn<bool>("hasWidget");
|
||||
@ -954,10 +961,6 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent()
|
||||
QFETCH(bool, hasWidget);
|
||||
QFETCH(bool, hoverEnabled);
|
||||
|
||||
#if defined(Q_OS_WINCE) && (!defined(GWES_ICONCURS) || defined(QT_NO_CURSOR))
|
||||
QSKIP("hover events not supported on this platform");
|
||||
#endif
|
||||
|
||||
// proxy should translate this into events that the widget would expect
|
||||
|
||||
QGraphicsScene scene;
|
||||
@ -1003,6 +1006,7 @@ void tst_QGraphicsProxyWidget::hoverEnterLeaveEvent()
|
||||
if (!hasWidget)
|
||||
delete widget;
|
||||
}
|
||||
#endif
|
||||
|
||||
void tst_QGraphicsProxyWidget::hoverMoveEvent_data()
|
||||
{
|
||||
@ -1522,7 +1526,7 @@ void tst_QGraphicsProxyWidget::setWidget_simple()
|
||||
// Properties
|
||||
// QCOMPARE(proxy.focusPolicy(), lineEdit->focusPolicy());
|
||||
// QCOMPARE(proxy.palette(), lineEdit->palette());
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
QCOMPARE(proxy.cursor().shape(), lineEdit->cursor().shape());
|
||||
#endif
|
||||
QCOMPARE(proxy.layoutDirection(), lineEdit->layoutDirection());
|
||||
@ -2538,12 +2542,9 @@ void tst_QGraphicsProxyWidget::popup_subwidget()
|
||||
QCOMPARE(popup->size(), child->size().toSize());
|
||||
}
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QGraphicsProxyWidget::changingCursor_basic()
|
||||
{
|
||||
#if defined(Q_OS_WINCE) && (!defined(GWES_ICONCURS) || defined(QT_NO_CURSOR))
|
||||
QSKIP("hover events not supported on this platform");
|
||||
#endif
|
||||
#ifndef QT_NO_CURSOR
|
||||
// Confirm that mouse events are working properly by checking that
|
||||
// when moving the mouse over a line edit it will change the cursor into the I
|
||||
QGraphicsScene scene;
|
||||
@ -2568,8 +2569,8 @@ void tst_QGraphicsProxyWidget::changingCursor_basic()
|
||||
QTest::mouseMove(view.viewport(), QPoint(1, 1));
|
||||
sendMouseMove(view.viewport(), QPoint(1, 1));
|
||||
QTRY_COMPARE(view.viewport()->cursor().shape(), Qt::ArrowCursor);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void tst_QGraphicsProxyWidget::tooltip_basic()
|
||||
{
|
||||
@ -3617,7 +3618,7 @@ public slots:
|
||||
|
||||
void tst_QGraphicsProxyWidget::QTBUG_6986_sendMouseEventToAlienWidget()
|
||||
{
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(QT_NO_CURSOR)
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN) || defined(QTEST_NO_CURSOR)
|
||||
QSKIP("Test case unstable on this platform");
|
||||
#endif
|
||||
QGraphicsView view;
|
||||
|
@ -68,10 +68,11 @@
|
||||
#include <QtWidgets/QDesktopWidget>
|
||||
#include <private/qgraphicsscene_p.h>
|
||||
#include <private/qgraphicsview_p.h>
|
||||
#include "../../../platformquirks.h"
|
||||
#include "../../../shared/platforminputcontext.h"
|
||||
#include <private/qinputmethod_p.h>
|
||||
|
||||
#include "../../../qtest-config.h"
|
||||
|
||||
Q_DECLARE_METATYPE(QList<int>)
|
||||
Q_DECLARE_METATYPE(QList<QRectF>)
|
||||
Q_DECLARE_METATYPE(QMatrix)
|
||||
@ -196,8 +197,10 @@ private slots:
|
||||
void mapFromScenePath();
|
||||
void sendEvent();
|
||||
void wheelEvent();
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void cursor();
|
||||
void cursor2();
|
||||
#endif
|
||||
void transformationAnchor();
|
||||
void resizeAnchor();
|
||||
void viewportUpdateMode();
|
||||
@ -256,7 +259,9 @@ private slots:
|
||||
void QTBUG_4151_clipAndIgnore_data();
|
||||
void QTBUG_4151_clipAndIgnore();
|
||||
void QTBUG_5859_exposedRect();
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void QTBUG_7438_cursor();
|
||||
#endif
|
||||
void hoverLeave();
|
||||
void QTBUG_16063_microFocusRect();
|
||||
|
||||
@ -678,7 +683,7 @@ void tst_QGraphicsView::dragMode_scrollHand()
|
||||
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
// ScrollHandDrag
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
Qt::CursorShape cursorShape = view.viewport()->cursor().shape();
|
||||
#endif
|
||||
int horizontalScrollBarValue = view.horizontalScrollBar()->value();
|
||||
@ -697,7 +702,7 @@ void tst_QGraphicsView::dragMode_scrollHand()
|
||||
QTRY_VERIFY(item->isSelected());
|
||||
|
||||
for (int k = 0; k < 4; ++k) {
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
QCOMPARE(view.viewport()->cursor().shape(), Qt::ClosedHandCursor);
|
||||
#endif
|
||||
{
|
||||
@ -740,7 +745,7 @@ void tst_QGraphicsView::dragMode_scrollHand()
|
||||
QTRY_VERIFY(item->isSelected());
|
||||
QCOMPARE(view.horizontalScrollBar()->value(), horizontalScrollBarValue - 10);
|
||||
QCOMPARE(view.verticalScrollBar()->value(), verticalScrollBarValue - 10);
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
QCOMPARE(view.viewport()->cursor().shape(), cursorShape);
|
||||
#endif
|
||||
|
||||
@ -800,7 +805,7 @@ void tst_QGraphicsView::dragMode_rubberBand()
|
||||
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
// RubberBandDrag
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
Qt::CursorShape cursorShape = view.viewport()->cursor().shape();
|
||||
#endif
|
||||
int horizontalScrollBarValue = view.horizontalScrollBar()->value();
|
||||
@ -814,7 +819,7 @@ void tst_QGraphicsView::dragMode_rubberBand()
|
||||
QApplication::sendEvent(view.viewport(), &event);
|
||||
QVERIFY(event.isAccepted());
|
||||
}
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
QCOMPARE(view.viewport()->cursor().shape(), cursorShape);
|
||||
#endif
|
||||
|
||||
@ -862,7 +867,7 @@ void tst_QGraphicsView::dragMode_rubberBand()
|
||||
}
|
||||
QCOMPARE(view.horizontalScrollBar()->value(), horizontalScrollBarValue);
|
||||
QCOMPARE(view.verticalScrollBar()->value(), verticalScrollBarValue);
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
QCOMPARE(view.viewport()->cursor().shape(), cursorShape);
|
||||
#endif
|
||||
|
||||
@ -2102,15 +2107,9 @@ void tst_QGraphicsView::wheelEvent()
|
||||
QVERIFY(widget->hasFocus());
|
||||
}
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QGraphicsView::cursor()
|
||||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
#if defined(Q_OS_WINCE)
|
||||
QSKIP("Qt/CE does not have regular cursor support");
|
||||
#endif
|
||||
if (PlatformQuirks::haveMouseCursor())
|
||||
QSKIP("The Platform does not have regular cursor support");
|
||||
|
||||
QGraphicsScene scene;
|
||||
QGraphicsItem *item = scene.addRect(QRectF(-10, -10, 20, 20));
|
||||
item->setCursor(Qt::IBeamCursor);
|
||||
@ -2129,20 +2128,12 @@ void tst_QGraphicsView::cursor()
|
||||
|
||||
sendMouseMove(view.viewport(), QPoint(5, 5));
|
||||
QCOMPARE(view.viewport()->cursor().shape(), Qt::PointingHandCursor);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
// Qt/CE does not have regular cursor support.
|
||||
#if !defined(QT_NO_CURSOR) && !defined(Q_OS_WINCE)
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QGraphicsView::cursor2()
|
||||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
#if defined(Q_OS_WINCE)
|
||||
QSKIP("Qt/CE does not have regular cursor support");
|
||||
#endif
|
||||
if (PlatformQuirks::haveMouseCursor())
|
||||
QSKIP("The Platform does not have regular cursor support");
|
||||
|
||||
QGraphicsScene scene;
|
||||
QGraphicsItem *item = scene.addRect(QRectF(-10, -10, 20, 20));
|
||||
item->setCursor(Qt::IBeamCursor);
|
||||
@ -2205,8 +2196,8 @@ void tst_QGraphicsView::cursor2()
|
||||
QCOMPARE(view.viewport()->cursor().shape(), Qt::IBeamCursor);
|
||||
sendMouseMove(view.viewport(), view.mapFromScene(-15, -15));
|
||||
QCOMPARE(view.viewport()->cursor().shape(), Qt::SizeAllCursor);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void tst_QGraphicsView::transformationAnchor()
|
||||
{
|
||||
@ -3529,7 +3520,7 @@ void tst_QGraphicsView::mouseTracking()
|
||||
QGraphicsView view(&scene);
|
||||
|
||||
QGraphicsRectItem *item = new QGraphicsRectItem(10, 10, 10, 10);
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
item->setCursor(Qt::CrossCursor);
|
||||
#endif
|
||||
scene.addItem(item);
|
||||
@ -3539,7 +3530,7 @@ void tst_QGraphicsView::mouseTracking()
|
||||
// Adding an item to the scene before the scene is set on the view.
|
||||
QGraphicsScene scene(-10000, -10000, 20000, 20000);
|
||||
QGraphicsRectItem *item = new QGraphicsRectItem(10, 10, 10, 10);
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
item->setCursor(Qt::CrossCursor);
|
||||
#endif
|
||||
scene.addItem(item);
|
||||
@ -3556,7 +3547,7 @@ void tst_QGraphicsView::mouseTracking()
|
||||
QGraphicsView view3(&scene);
|
||||
|
||||
QGraphicsRectItem *item = new QGraphicsRectItem(10, 10, 10, 10);
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
item->setCursor(Qt::CrossCursor);
|
||||
#endif
|
||||
scene.addItem(item);
|
||||
@ -4359,7 +4350,6 @@ void tst_QGraphicsView::task255529_transformationAnchorMouseAndViewportMargins()
|
||||
QEXPECT_FAIL("", message.constData(), Abort);
|
||||
#endif
|
||||
QVERIFY2(dx < slack && dy < slack, message.constData());
|
||||
#endif
|
||||
}
|
||||
|
||||
void tst_QGraphicsView::task259503_scrollingArtifacts()
|
||||
@ -4505,12 +4495,9 @@ void tst_QGraphicsView::QTBUG_5859_exposedRect()
|
||||
QCOMPARE(item.lastExposedRect, scene.lastBackgroundExposedRect);
|
||||
}
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QGraphicsView::QTBUG_7438_cursor()
|
||||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
#if defined(Q_OS_WINCE)
|
||||
QSKIP("Qt/CE does not have regular cursor support");
|
||||
#endif
|
||||
QGraphicsScene scene;
|
||||
QGraphicsItem *item = scene.addRect(QRectF(-10, -10, 20, 20));
|
||||
item->setFlag(QGraphicsItem::ItemIsMovable);
|
||||
@ -4529,8 +4516,8 @@ void tst_QGraphicsView::QTBUG_7438_cursor()
|
||||
QCOMPARE(view.viewport()->cursor().shape(), Qt::PointingHandCursor);
|
||||
sendMouseRelease(view.viewport(), view.mapFromScene(0, 0));
|
||||
QCOMPARE(view.viewport()->cursor().shape(), Qt::PointingHandCursor);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
class GraphicsItemWithHover : public QGraphicsRectItem
|
||||
{
|
||||
|
@ -53,6 +53,7 @@
|
||||
#include <qaction.h>
|
||||
#include <qwidgetaction.h>
|
||||
|
||||
#include "../../../qtest-config.h"
|
||||
|
||||
class EventSpy : public QObject
|
||||
{
|
||||
@ -3203,10 +3204,12 @@ void tst_QGraphicsWidget::itemChangeEvents()
|
||||
valueDuringEvents.insert(QEvent::ParentChange, QVariant::fromValue(parentItem()));
|
||||
break;
|
||||
}
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
case QEvent::CursorChange: {
|
||||
valueDuringEvents.insert(QEvent::CursorChange, int(cursor().shape()));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
case QEvent::ToolTipChange: {
|
||||
valueDuringEvents.insert(QEvent::ToolTipChange, toolTip());
|
||||
break;
|
||||
@ -3252,9 +3255,11 @@ void tst_QGraphicsWidget::itemChangeEvents()
|
||||
QVERIFY(!item->isVisible());
|
||||
QTRY_VERIFY(!item->valueDuringEvents.value(QEvent::Hide).toBool());
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
// CursorChange should be triggered after the cursor has changed
|
||||
item->setCursor(Qt::PointingHandCursor);
|
||||
QTRY_COMPARE(item->valueDuringEvents.value(QEvent::CursorChange).toInt(), int(item->cursor().shape()));
|
||||
#endif
|
||||
|
||||
// ToolTipChange should be triggered after the tooltip has changed
|
||||
item->setToolTip("tooltipText");
|
||||
|
@ -71,6 +71,7 @@
|
||||
|
||||
#include <qpa/qwindowsysteminterface.h>
|
||||
|
||||
#include "../../../qtest-config.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
static QWindowSystemInterface::TouchPoint touchPoint(const QTouchEvent::TouchPoint& pt)
|
||||
@ -2231,7 +2232,9 @@ Q_GLOBAL_STATIC(QPixmap, tst_qapp_pixmap);
|
||||
Q_GLOBAL_STATIC(QFont, tst_qapp_font);
|
||||
Q_GLOBAL_STATIC(QRegion, tst_qapp_region);
|
||||
Q_GLOBAL_STATIC(QFontDatabase, tst_qapp_fontDatabase);
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
Q_GLOBAL_STATIC(QCursor, tst_qapp_cursor);
|
||||
#endif
|
||||
|
||||
void tst_QApplication::globalStaticObjectDestruction()
|
||||
{
|
||||
@ -2250,7 +2253,9 @@ void tst_QApplication::globalStaticObjectDestruction()
|
||||
QVERIFY(tst_qapp_font());
|
||||
QVERIFY(tst_qapp_region());
|
||||
QVERIFY(tst_qapp_fontDatabase());
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
QVERIFY(tst_qapp_cursor());
|
||||
#endif
|
||||
}
|
||||
|
||||
//QTEST_APPLESS_MAIN(tst_QApplication)
|
||||
|
@ -76,6 +76,8 @@
|
||||
#include <QtWidgets/QGraphicsView>
|
||||
#include <QtWidgets/QGraphicsProxyWidget>
|
||||
|
||||
#include "../../../qtest-config.h"
|
||||
|
||||
#if defined(Q_OS_MAC)
|
||||
#include "tst_qwidget_mac_helpers.h" // Abstract the ObjC stuff out so not everyone must run an ObjC++ compile.
|
||||
#endif
|
||||
@ -273,7 +275,9 @@ private slots:
|
||||
void deleteStyle();
|
||||
void multipleToplevelFocusCheck();
|
||||
void setFocus();
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void setCursor();
|
||||
#endif
|
||||
void setToolTip();
|
||||
void testWindowIconChangeEventPropagation();
|
||||
|
||||
@ -344,7 +348,7 @@ private slots:
|
||||
|
||||
void setClearAndResizeMask();
|
||||
void maskedUpdate();
|
||||
#if !defined(Q_OS_WINCE_WM)
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void syntheticEnterLeave();
|
||||
void taskQTBUG_4055_sendSyntheticEnterLeave();
|
||||
#endif
|
||||
@ -5222,9 +5226,9 @@ private:
|
||||
int m_count;
|
||||
};
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QWidget::setCursor()
|
||||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
{
|
||||
QWidget window;
|
||||
window.resize(200, 200);
|
||||
@ -5339,8 +5343,8 @@ void tst_QWidget::setCursor()
|
||||
widget.unsetCursor();
|
||||
QCOMPARE(spy.count(), 2);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void tst_QWidget::setToolTip()
|
||||
{
|
||||
@ -8491,8 +8495,7 @@ void tst_QWidget::maskedUpdate()
|
||||
QTRY_COMPARE(grandChild.paintedRegion, QRegion(grandChild.rect())); // Full update.
|
||||
}
|
||||
|
||||
// Windows Mobile has no proper cursor support, so skip this test on that platform.
|
||||
#if !defined(Q_OS_WINCE_WM)
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QWidget::syntheticEnterLeave()
|
||||
{
|
||||
class MyWidget : public QWidget
|
||||
@ -8595,8 +8598,7 @@ void tst_QWidget::syntheticEnterLeave()
|
||||
}
|
||||
#endif
|
||||
|
||||
// Windows Mobile has no proper cursor support, so skip this test on that platform.
|
||||
#if !defined(Q_OS_WINCE_WM)
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QWidget::taskQTBUG_4055_sendSyntheticEnterLeave()
|
||||
{
|
||||
if (m_platform == QStringLiteral("windows") || m_platform == QStringLiteral("xcb"))
|
||||
@ -8812,7 +8814,9 @@ QWidgetBackingStore* backingStore(QWidget &widget)
|
||||
#ifndef Q_OS_WINCE_WM
|
||||
void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
|
||||
{
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
QApplication::setOverrideCursor(Qt::BlankCursor); //keep the cursor out of screen grabs
|
||||
#endif
|
||||
QWidget main(0,Qt::FramelessWindowHint); //don't get confused by the size of the window frame
|
||||
QPalette palette;
|
||||
palette.setColor(QPalette::Window, Qt::red);
|
||||
@ -8845,7 +8849,9 @@ void tst_QWidget::rectOutsideCoordinatesLimit_task144779()
|
||||
|
||||
QTRY_COMPARE(mainPixmap.toImage().convertToFormat(QImage::Format_RGB32),
|
||||
correct.toImage().convertToFormat(QImage::Format_RGB32));
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
QApplication::restoreOverrideCursor();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -47,7 +47,8 @@
|
||||
#include <QPlastiqueStyle>
|
||||
|
||||
#include <private/qstylesheetstyle_p.h>
|
||||
#include "../../../platformquirks.h"
|
||||
|
||||
#include "../../../qtest-config.h"
|
||||
|
||||
class tst_QStyleSheetStyle : public QObject
|
||||
{
|
||||
@ -78,7 +79,9 @@ private slots:
|
||||
void onWidgetDestroyed();
|
||||
void fontPrecedence();
|
||||
void focusColors();
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void hoverColors();
|
||||
#endif
|
||||
void background();
|
||||
void tabAlignement();
|
||||
void attributesList();
|
||||
@ -788,10 +791,9 @@ void tst_QStyleSheetStyle::focusColors()
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QStyleSheetStyle::hoverColors()
|
||||
{
|
||||
if (!PlatformQuirks::haveMouseCursor())
|
||||
QSKIP("No mouse Cursor on this platform");
|
||||
QList<QWidget *> widgets;
|
||||
widgets << new QPushButton("TESTING TESTING");
|
||||
widgets << new QLineEdit("TESTING TESTING");
|
||||
@ -880,8 +882,8 @@ void tst_QStyleSheetStyle::hoverColors()
|
||||
(QString::fromLatin1(widget->metaObject()->className())
|
||||
+ " did not contain text color #ff0084").toLocal8Bit().constData());
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
class SingleInheritanceDialog : public QDialog
|
||||
{
|
||||
|
@ -74,6 +74,7 @@
|
||||
#include "../../../shared/platforminputcontext.h"
|
||||
#include <private/qinputmethod_p.h>
|
||||
|
||||
#include "../../../qtest-config.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QPainter;
|
||||
@ -240,7 +241,7 @@ private slots:
|
||||
|
||||
void noTextEditedOnClear();
|
||||
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void cursor();
|
||||
#endif
|
||||
|
||||
@ -3260,7 +3261,7 @@ void tst_QLineEdit::textMargin()
|
||||
QTRY_COMPARE(testWidget.cursorPosition(), cursorPosition);
|
||||
}
|
||||
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QLineEdit::cursor()
|
||||
{
|
||||
testWidget->setReadOnly(false);
|
||||
|
@ -57,6 +57,8 @@
|
||||
#include <private/qmainwindowlayout_p.h>
|
||||
#include <private/qdockarealayout_p.h>
|
||||
|
||||
#include "../../../qtest-config.h"
|
||||
|
||||
static uchar restoreData41[] = { 0x0, 0x0, 0x0, 0xff, 0x0, 0x0, 0x0, 0x0, 0xfc, 0x0, 0x0, 0x0, 0x0, 0xfd, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x64, 0x0, 0x0, 0x1, 0x19, 0xfc, 0x2, 0x0, 0x0, 0x0, 0x4, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x30, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x45, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xc, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x34, 0x1, 0x0, 0x0, 0x0, 0x49, 0x0, 0x0, 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0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64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x31, 0x1, 0x0, 0x0, 0x0, 0xd6, 0x0, 0x0, 0x0, 0x68, 0x0, 0x0, 0x0, 0x50, 0x0, 0xff, 0xff, 0xff, 0xfb, 0x0, 0x0, 0x0, 0xe, 0x0, 0x64, 0x0, 0x6f, 0x0, 0x63, 0x0, 0x6b, 0x0, 0x20, 0x0, 0x31, 0x0, 0x35, 0x1, 0x0, 0x0, 0x1, 0x42, 0x0, 0x0, 0x0, 0x66, 0x0, 0x0, 0x0, 0x50, 0x0, 0xff, 0xff, 0xff, 0x0, 0x0, 0x0, 0xb8, 0x0, 0x0, 0x0, 0xa0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x8, 0x0, 0x0, 0x0, 0x8, 0xfc, 0x0, 0x0, 0x0, 0x0};
|
||||
@ -137,7 +139,7 @@ private slots:
|
||||
void statusBar();
|
||||
#endif
|
||||
void isSeparator();
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void setCursor();
|
||||
#endif
|
||||
void addToolbarAfterShow();
|
||||
@ -1646,7 +1648,7 @@ class MainWindow : public QMainWindow {
|
||||
using QMainWindow::event;
|
||||
};
|
||||
|
||||
#ifndef QT_NO_CURSOR
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QMainWindow::setCursor()
|
||||
{
|
||||
MainWindow mw;
|
||||
|
@ -63,6 +63,8 @@
|
||||
#include <QMacStyle>
|
||||
#endif
|
||||
|
||||
#include "../../../qtest-config.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
#if !defined(Q_WS_WIN)
|
||||
extern bool qt_tab_all_widgets();
|
||||
@ -173,8 +175,10 @@ private slots:
|
||||
void showShaded();
|
||||
void showNormal_data();
|
||||
void showNormal();
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void setOpaqueResizeAndMove_data();
|
||||
void setOpaqueResizeAndMove();
|
||||
#endif
|
||||
void setWindowFlags_data();
|
||||
void setWindowFlags();
|
||||
void mouseDoubleClick();
|
||||
@ -677,6 +681,7 @@ private:
|
||||
int _count;
|
||||
};
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QMdiSubWindow::setOpaqueResizeAndMove_data()
|
||||
{
|
||||
QTest::addColumn<bool>("opaqueMode");
|
||||
@ -691,9 +696,6 @@ void tst_QMdiSubWindow::setOpaqueResizeAndMove_data()
|
||||
|
||||
void tst_QMdiSubWindow::setOpaqueResizeAndMove()
|
||||
{
|
||||
#if defined (QT_NO_CURSOR) || defined (Q_OS_WINCE_WM) //For Windows CE we will set QT_NO_CURSOR if there is no cursor support
|
||||
QSKIP("No cursor available");
|
||||
#endif
|
||||
QFETCH(bool, opaqueMode);
|
||||
QFETCH(int, geometryCount);
|
||||
QFETCH(int, expectedGeometryCount);
|
||||
@ -800,6 +802,7 @@ void tst_QMdiSubWindow::setOpaqueResizeAndMove()
|
||||
QCOMPARE(window->size(), windowSize + QSize(geometryCount, geometryCount));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void tst_QMdiSubWindow::setWindowFlags_data()
|
||||
{
|
||||
|
@ -60,6 +60,8 @@
|
||||
#include "qplaintextedit.h"
|
||||
#include "../../../shared/platformclipboard.h"
|
||||
|
||||
#include "../../../qtest-config.h"
|
||||
|
||||
//Used in copyAvailable
|
||||
typedef QPair<Qt::Key, Qt::KeyboardModifier> keyPairType;
|
||||
typedef QList<keyPairType> pairListType;
|
||||
@ -115,7 +117,9 @@ private slots:
|
||||
void shiftDownInLineLastShouldSelectToEnd();
|
||||
void undoRedoShouldRepositionTextEditCursor();
|
||||
void lineWrapModes();
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void mouseCursorShape();
|
||||
#endif
|
||||
void implicitClear();
|
||||
void undoRedoAfterSetContent();
|
||||
void numPadKeyNavigation();
|
||||
@ -869,9 +873,9 @@ void tst_QPlainTextEdit::lineWrapModes()
|
||||
delete window;
|
||||
}
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QPlainTextEdit::mouseCursorShape()
|
||||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
// always show an IBeamCursor, see change 170146
|
||||
QVERIFY(!ed->isReadOnly());
|
||||
QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
|
||||
@ -881,8 +885,8 @@ void tst_QPlainTextEdit::mouseCursorShape()
|
||||
|
||||
ed->setPlainText("Foo");
|
||||
QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void tst_QPlainTextEdit::implicitClear()
|
||||
{
|
||||
|
@ -68,6 +68,7 @@
|
||||
#include "../../../shared/platforminputcontext.h"
|
||||
#include <private/qinputmethod_p.h>
|
||||
|
||||
#include "../../../qtest-config.h"
|
||||
|
||||
//Used in copyAvailable
|
||||
typedef QPair<Qt::Key, Qt::KeyboardModifier> keyPairType;
|
||||
@ -141,7 +142,9 @@ private slots:
|
||||
void shiftDownInLineLastShouldSelectToEnd();
|
||||
void undoRedoShouldRepositionTextEditCursor();
|
||||
void lineWrapModes();
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void mouseCursorShape();
|
||||
#endif
|
||||
void implicitClear();
|
||||
void undoRedoAfterSetContent();
|
||||
void numPadKeyNavigation();
|
||||
@ -1235,9 +1238,9 @@ void tst_QTextEdit::lineWrapModes()
|
||||
QCOMPARE(ed->document()->pageSize().width(), qreal(1000));
|
||||
}
|
||||
|
||||
#ifndef QTEST_NO_CURSOR
|
||||
void tst_QTextEdit::mouseCursorShape()
|
||||
{
|
||||
#ifndef QT_NO_CURSOR
|
||||
// always show an IBeamCursor, see change 170146
|
||||
QVERIFY(!ed->isReadOnly());
|
||||
QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
|
||||
@ -1247,8 +1250,8 @@ void tst_QTextEdit::mouseCursorShape()
|
||||
|
||||
ed->setPlainText("Foo");
|
||||
QVERIFY(ed->viewport()->cursor().shape() == Qt::IBeamCursor);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
void tst_QTextEdit::implicitClear()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user