Changeset View
Changeset View
Standalone View
Standalone View
autotests/ksqueezedtextlabelautotest.cpp
Show First 20 Lines • Show All 169 Lines • ▼ Show 20 Line(s) | 142 | { | |||
---|---|---|---|---|---|
170 | QCOMPARE(label->minimumSizeHint().width(), -1); | 170 | QCOMPARE(label->minimumSizeHint().width(), -1); | ||
171 | QCOMPARE(label->sizeHint().width(), labelWidth); | 171 | QCOMPARE(label->sizeHint().width(), labelWidth); | ||
172 | 172 | | |||
173 | const int indent = 40; | 173 | const int indent = 40; | ||
174 | label->setIndent(indent); | 174 | label->setIndent(indent); | ||
175 | label->adjustSize(); | 175 | label->adjustSize(); | ||
176 | 176 | | |||
177 | QVERIFY(!label->isSqueezed()); | 177 | QVERIFY(!label->isSqueezed()); | ||
178 | QEXPECT_FAIL("", "To fix: Respect chrome in sizeHint()", Abort); | | |||
179 | QCOMPARE(label->size().width(), labelWidth + indent); | 178 | QCOMPARE(label->size().width(), labelWidth + indent); | ||
180 | QCOMPARE(label->minimumSizeHint().width(), -1); | 179 | QCOMPARE(label->minimumSizeHint().width(), -1); | ||
181 | QCOMPARE(label->sizeHint().width(), labelWidth + indent); | 180 | QCOMPARE(label->sizeHint().width(), labelWidth + indent); | ||
182 | } | 181 | } | ||
183 | 182 | | |||
184 | void KSqueezedTextLabelAutotest::testClearing() | 183 | void KSqueezedTextLabelAutotest::testClearing() | ||
185 | { | 184 | { | ||
186 | KSqueezedTextLabel *label = createLabel(); | 185 | KSqueezedTextLabel *label = createLabel(); | ||
Show All 34 Lines | 214 | { | |||
221 | label->setFrameStyle(QFrame::Box); | 220 | label->setFrameStyle(QFrame::Box); | ||
222 | label->setLineWidth(0); | 221 | label->setLineWidth(0); | ||
223 | const int oldWidth = label->width(); | 222 | const int oldWidth = label->width(); | ||
224 | 223 | | |||
225 | QVERIFY(!label->isSqueezed()); | 224 | QVERIFY(!label->isSqueezed()); | ||
226 | 225 | | |||
227 | label->setProperty(attribute.toLatin1().data(), amount); | 226 | label->setProperty(attribute.toLatin1().data(), amount); | ||
228 | 227 | | |||
229 | QEXPECT_FAIL("", "To fix: Respect chrome in squeezeTextToLabel()", Abort); | | |||
230 | QVERIFY(label->isSqueezed()); | 228 | QVERIFY(label->isSqueezed()); | ||
231 | 229 | | |||
232 | label->adjustSize(); | 230 | label->adjustSize(); | ||
233 | 231 | | |||
234 | QVERIFY(!label->isSqueezed()); | 232 | QVERIFY(!label->isSqueezed()); | ||
235 | QCOMPARE(label->width(), oldWidth + widthDifference); | 233 | QCOMPARE(label->width(), oldWidth + widthDifference); | ||
236 | } | 234 | } | ||
237 | 235 | | |||
Show All 13 Lines |