Changeset View
Changeset View
Standalone View
Standalone View
autotests/ksqueezedtextlabelautotest.cpp
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Line(s) | 139 | { | |||
---|---|---|---|---|---|
167 | QCOMPARE(label->minimumSizeHint().width(), -1); | 167 | QCOMPARE(label->minimumSizeHint().width(), -1); | ||
168 | QCOMPARE(label->sizeHint().width(), labelWidth); | 168 | QCOMPARE(label->sizeHint().width(), labelWidth); | ||
169 | 169 | | |||
170 | const int indent = 40; | 170 | const int indent = 40; | ||
171 | label->setIndent(indent); | 171 | label->setIndent(indent); | ||
172 | label->adjustSize(); | 172 | label->adjustSize(); | ||
173 | 173 | | |||
174 | QVERIFY(!label->isSqueezed()); | 174 | QVERIFY(!label->isSqueezed()); | ||
175 | QEXPECT_FAIL("", "To fix: Respect chrome in sizeHint()", Abort); | | |||
176 | QCOMPARE(label->size().width(), labelWidth + indent); | 175 | QCOMPARE(label->size().width(), labelWidth + indent); | ||
177 | QCOMPARE(label->minimumSizeHint().width(), -1); | 176 | QCOMPARE(label->minimumSizeHint().width(), -1); | ||
178 | QCOMPARE(label->sizeHint().width(), labelWidth + indent); | 177 | QCOMPARE(label->sizeHint().width(), labelWidth + indent); | ||
179 | } | 178 | } | ||
180 | 179 | | |||
181 | void KSqueezedTextLabelAutotest::testClearing() | 180 | void KSqueezedTextLabelAutotest::testClearing() | ||
182 | { | 181 | { | ||
183 | KSqueezedTextLabel *label = createLabel(); | 182 | KSqueezedTextLabel *label = createLabel(); | ||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Line(s) | 211 | { | |||
237 | label->setFrameStyle(QFrame::Box); | 236 | label->setFrameStyle(QFrame::Box); | ||
238 | label->setLineWidth(0); | 237 | label->setLineWidth(0); | ||
239 | const int oldWidth = label->width(); | 238 | const int oldWidth = label->width(); | ||
240 | 239 | | |||
241 | QVERIFY(!label->isSqueezed()); | 240 | QVERIFY(!label->isSqueezed()); | ||
242 | 241 | | |||
243 | (label->*attributeFn)(amount); | 242 | (label->*attributeFn)(amount); | ||
244 | 243 | | |||
245 | QEXPECT_FAIL("", "To fix: Respect chrome in squeezeTextToLabel()", Abort); | | |||
246 | QVERIFY(label->isSqueezed()); | 244 | QVERIFY(label->isSqueezed()); | ||
247 | 245 | | |||
248 | label->adjustSize(); | 246 | label->adjustSize(); | ||
249 | 247 | | |||
250 | QVERIFY(!label->isSqueezed()); | 248 | QVERIFY(!label->isSqueezed()); | ||
251 | QCOMPARE(label->width(), oldWidth + widthDifference); | 249 | QCOMPARE(label->width(), oldWidth + widthDifference); | ||
252 | } | 250 | } | ||
253 | 251 | | |||
Show All 13 Lines |