summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/cocoa/qmaccocoaviewcontainer/qmaccocoaviewcontainer.pro1
-rw-r--r--tests/manual/cocoa/wheelevent/wheelevent.pro2
-rw-r--r--tests/manual/cocoa/wheelevent/window.cpp23
-rw-r--r--tests/manual/highdpi/highdpi.pro1
-rw-r--r--tests/manual/windowgeometry/windowgeometry.pro2
5 files changed, 21 insertions, 8 deletions
diff --git a/tests/manual/cocoa/qmaccocoaviewcontainer/qmaccocoaviewcontainer.pro b/tests/manual/cocoa/qmaccocoaviewcontainer/qmaccocoaviewcontainer.pro
index a7aa675d87..9546adea1c 100644
--- a/tests/manual/cocoa/qmaccocoaviewcontainer/qmaccocoaviewcontainer.pro
+++ b/tests/manual/cocoa/qmaccocoaviewcontainer/qmaccocoaviewcontainer.pro
@@ -1,6 +1,5 @@
TEMPLATE = app
TARGET = qmaccocoaviewcontainer
-DEPENDPATH += .
INCLUDEPATH += .
QT += widgets
LIBS += -framework Cocoa
diff --git a/tests/manual/cocoa/wheelevent/wheelevent.pro b/tests/manual/cocoa/wheelevent/wheelevent.pro
index cf32954750..f90302da95 100644
--- a/tests/manual/cocoa/wheelevent/wheelevent.pro
+++ b/tests/manual/cocoa/wheelevent/wheelevent.pro
@@ -3,5 +3,5 @@ TEMPLATE = app
HEADERS += window.h
SOURCES += window.cpp main.cpp
-QT += core gui gui-private core-private
+QT += core core-private gui gui-private widgets
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/manual/cocoa/wheelevent/window.cpp b/tests/manual/cocoa/wheelevent/window.cpp
index ecf337f85b..70ce41d094 100644
--- a/tests/manual/cocoa/wheelevent/window.cpp
+++ b/tests/manual/cocoa/wheelevent/window.cpp
@@ -80,7 +80,6 @@ void Window::initialize()
setSizeIncrement(QSize(10, 10));
setBaseSize(QSize(640, 480));
setMinimumSize(QSize(240, 160));
- setMaximumSize(QSize(800, 600));
}
create();
@@ -102,6 +101,12 @@ void Window::mouseMoveEvent(QMouseEvent *event)
{
if (m_lastPos != QPoint(-1, -1)) {
QPainter p(&m_image);
+
+ QPen pen;
+ pen.setCosmetic(true);
+ pen.setWidth(1);
+ p.setPen(pen);
+
p.setRenderHint(QPainter::Antialiasing);
p.drawLine(m_lastPos, event->pos());
m_lastPos = event->pos();
@@ -153,13 +158,16 @@ void Window::resizeEvent(QResizeEvent *)
{
QImage old = m_image;
- //qDebug() << "Window::resizeEvent" << width << height;
+ qDebug() << "Window::resizeEvent" << geometry();
+
+ int width = qMax(geometry().width() * devicePixelRatio(), qreal(old.width()));
+ int height = qMax(geometry().height() * devicePixelRatio(), qreal(old.height()));
- int width = qMax(geometry().width(), old.width());
- int height = qMax(geometry().height(), old.height());
+ qDebug() << "Window::resizeEvent" << width << height;
if (width > old.width() || height > old.height()) {
m_image = QImage(width, height, QImage::Format_RGB32);
+ m_image.setDevicePixelRatio(devicePixelRatio());
m_image.fill(colorTable[(m_backgroundColorIndex) % (sizeof(colorTable) / sizeof(colorTable[0]))].rgba());
QPainter p(&m_image);
@@ -221,6 +229,12 @@ void Window::render()
// draw grid:
int gridSpace = 80;
+ QPen pen;
+ pen.setCosmetic(true);
+ pen.setWidth(1);
+ p.setPen(pen);
+
+
for (int y = 0; y < geometry().height() + gridSpace; y+= gridSpace) {
int offset = scrollOffset.y() % gridSpace;
//int color = ((y + offset) %255);// + scrollOffset.y()) % 255);
@@ -229,6 +243,7 @@ void Window::render()
//p.fillRect(0, y + offset, geometry().width(), gridSpace,QColor(color,0, 0));
}
+
for (int x = 0; x < geometry().width() + gridSpace; x+= gridSpace) {
p.drawLine(x + scrollOffset.x() % gridSpace, 0, x + scrollOffset.x() % gridSpace, geometry().height());
}
diff --git a/tests/manual/highdpi/highdpi.pro b/tests/manual/highdpi/highdpi.pro
index 635ba37a38..b827456f9b 100644
--- a/tests/manual/highdpi/highdpi.pro
+++ b/tests/manual/highdpi/highdpi.pro
@@ -1,6 +1,5 @@
TEMPLATE = app
TARGET = highdpi
-DEPENDPATH += .
INCLUDEPATH += .
QT += widgets
diff --git a/tests/manual/windowgeometry/windowgeometry.pro b/tests/manual/windowgeometry/windowgeometry.pro
index f339dc4d09..c0c7ef0217 100644
--- a/tests/manual/windowgeometry/windowgeometry.pro
+++ b/tests/manual/windowgeometry/windowgeometry.pro
@@ -1,4 +1,5 @@
QT += core gui
+greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = windowgeometry
TEMPLATE = app
@@ -6,5 +7,4 @@ INCLUDEPATH += ../windowflags
SOURCES += $$PWD/main.cpp controllerwidget.cpp ../windowflags/controls.cpp
HEADERS += controllerwidget.h ../windowflags/controls.h
-greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0