Source

Target

Commits (5)
Showing with 29 additions and 9 deletions
......@@ -293,6 +293,7 @@ bool QPainterPrivate::attachPainterPrivate(QPainter *q, QPaintDevice *pdev)
// Update matrix.
if (q->d_ptr->state->WxF) {
q->d_ptr->state->redirectionMatrix = q->d_ptr->state->matrix;
q->d_ptr->state->redirectionMatrix *= q->d_ptr->hidpiScaleTransform().inverted();
q->d_ptr->state->redirectionMatrix.translate(-offset.x(), -offset.y());
q->d_ptr->state->worldMatrix = QTransform();
q->d_ptr->state->WxF = false;
......
......@@ -136,7 +136,7 @@ QIOSScreen::QIOSScreen(unsigned int screenIndex)
int unscaledDpi = 163; // Regular iPhone DPI
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad
&& deviceIdentifier != QStringLiteral("iPad2,5") /* iPad Mini */) {
&& !deviceIdentifier.contains(QRegularExpression("^iPad2,[567]$")) /* excluding iPad Mini */) {
unscaledDpi = 132;
};
......
......@@ -150,7 +150,8 @@
- (void)updateTouchList:(NSSet *)touches withState:(Qt::TouchPointState)state
{
QRect applicationRect = fromCGRect(self.window.screen.applicationFrame);
QPlatformScreen *screen = QGuiApplication::primaryScreen()->handle();
QRect applicationRect = fromPortraitToPrimary(fromCGRect(self.window.screen.applicationFrame), screen);
foreach (UITouch *uiTouch, m_activeTouches.keys()) {
QWindowSystemInterface::TouchPoint &touchPoint = m_activeTouches[uiTouch];
......@@ -163,8 +164,10 @@
// Find the touch position relative to the window. Then calculate the screen
// position by subtracting the position of the applicationRect (since UIWindow
// does not take that into account when reporting its own frame):
QPoint touchPos = fromCGPoint([uiTouch locationInView:nil]);
touchPoint.area = QRectF(touchPos - applicationRect.topLeft(), QSize(0, 0));
QRect touchInWindow = QRect(fromCGPoint([uiTouch locationInView:nil]), QSize(0, 0));
QRect touchInScreen = fromPortraitToPrimary(touchInWindow, screen);
QPoint touchPos = touchInScreen.topLeft() - applicationRect.topLeft();
touchPoint.area = QRectF(touchPos, QSize(0, 0));
touchPoint.normalPosition = QPointF(touchPos.x() / applicationRect.width(), touchPos.y() / applicationRect.height());
}
}
......
......@@ -503,10 +503,14 @@ QWindowsWindow::WindowData
const QWindowCreationContextPtr context(new QWindowCreationContext(w, rect, data.customMargins, style, exStyle));
QWindowsContext::instance()->setWindowCreationContext(context);
if (context->frameX < 0)
context->frameX = 0;
if (context->frameY < 0)
context->frameY = 0;
QRect screenGeometry;
if (QScreen *screen = w->screen())
screenGeometry = screen->availableVirtualGeometry();
if (context->frameX < screenGeometry.left())
context->frameX = screenGeometry.left();
if (context->frameY < screenGeometry.top())
context->frameY = screenGeometry.top();
if (QWindowsContext::verboseWindows)
qDebug().nospace()
......
......@@ -291,7 +291,7 @@ void QGridLayoutRowData::calculateGeometries(int start, int end, qreal targetSiz
int stretch = stretches[start + i];
if (sumStretches == 0) {
if (hasIgnoreFlag) {
if (hasIgnoreFlag || sizes[i] == 0.0) {
factors[i] = (stretch < 0) ? 1.0 : 0.0;
} else {
factors[i] = (stretch < 0) ? sizes[i] : 0.0;
......
......@@ -1884,6 +1884,18 @@ void tst_QGraphicsGridLayout::defaultStretchFactors_data()
<< QSizeF(10,10) << QSizeF(10,10) << QSizeF(10,10)
);
QTest::newRow("preferredsizeIsZero") << (ItemList()
<< ItemDesc(0,0)
.preferredSizeHint(QSizeF(0,10))
<< ItemDesc(0,1)
.preferredSizeHint(QSizeF(10,10))
.maxSize(QSizeF(20, 10))
)
<< QSizeF(30, 10)
<< (SizeList()
<< QSizeF(10,10) << QSizeF(20,10)
);
QTest::newRow("ignoreitem01") << (ItemList()
<< ItemDesc(0,0)
.preferredSizeHint(QSizeF(10,10))
......