Fix QTabBar autotest for high DPI displays
Change-Id: Ic50d7fb9eb3568f16dd1422c380a4ae7bb288a51 Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
This commit is contained in:
parent
cc5bd47163
commit
e39f30a0d2
@ -316,12 +316,17 @@ void tst_QTabBar::sizeHints()
|
|||||||
tabBar.setUsesScrollButtons(false);
|
tabBar.setUsesScrollButtons(false);
|
||||||
tabBar.setElideMode(Qt::ElideRight);
|
tabBar.setElideMode(Qt::ElideRight);
|
||||||
// qDebug() << tabBar.minimumSizeHint() << tabBar.sizeHint();
|
// qDebug() << tabBar.minimumSizeHint() << tabBar.sizeHint();
|
||||||
QVERIFY(tabBar.minimumSizeHint().width() < 500);
|
|
||||||
QVERIFY(tabBar.sizeHint().width() > 700); // unchanged
|
// The sizeHint is very much dependent on the screen DPI value
|
||||||
|
// so we can not really predict it.
|
||||||
|
int tabBarMinSizeHintWidth = tabBar.minimumSizeHint().width();
|
||||||
|
int tabBarSizeHintWidth = tabBar.sizeHint().width();
|
||||||
|
QVERIFY(tabBarMinSizeHintWidth < tabBarSizeHintWidth);
|
||||||
|
QVERIFY(tabBarSizeHintWidth > 700); // unchanged
|
||||||
|
|
||||||
tabBar.addTab("This is tab10 with a very long title");
|
tabBar.addTab("This is tab10 with a very long title");
|
||||||
QVERIFY(tabBar.minimumSizeHint().width() < 600);
|
QVERIFY(tabBar.minimumSizeHint().width() > tabBarMinSizeHintWidth);
|
||||||
QVERIFY(tabBar.sizeHint().width() > 700); // unchanged
|
QVERIFY(tabBar.sizeHint().width() > tabBarSizeHintWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QTabBar::setUsesScrollButtons_data()
|
void tst_QTabBar::setUsesScrollButtons_data()
|
||||||
|
Loading…
Reference in New Issue
Block a user