本文整理汇总了C++中MockClient::setHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ MockClient::setHeight方法的具体用法?C++ MockClient::setHeight怎么用?C++ MockClient::setHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MockClient
的用法示例。
在下文中一共展示了MockClient::setHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testSection
void DecorationTest::testSection()
{
MockBridge bridge;
auto decoSettings = QSharedPointer<KDecoration2::DecorationSettings>::create(&bridge);
MockDecoration deco(&bridge);
deco.setSettings(decoSettings);
MockSettings *settings = bridge.lastCreatedSettings();
settings->setLargeSpacing(0);
MockClient *client = bridge.lastCreatedClient();
client->setWidth(100);
client->setHeight(100);
QCOMPARE(deco.size(), QSize(100, 100));
QCOMPARE(deco.borderLeft(), 0);
QCOMPARE(deco.borderTop(), 0);
QCOMPARE(deco.borderRight(), 0);
QCOMPARE(deco.borderBottom(), 0);
QCOMPARE(deco.titleBar(), QRect());
QCOMPARE(deco.sectionUnderMouse(), Qt::NoSection);
QFETCH(QRect, titleBar);
QFETCH(QMargins, margins);
deco.setBorders(margins);
QCOMPARE(deco.borderLeft(), margins.left());
QCOMPARE(deco.borderTop(), margins.top());
QCOMPARE(deco.borderRight(), margins.right());
QCOMPARE(deco.borderBottom(), margins.bottom());
deco.setTitleBar(titleBar);
QCOMPARE(deco.titleBar(), titleBar);
QCOMPARE(deco.size(), QSize(100 + deco.borderLeft() + deco.borderRight(), 100 + deco.borderTop() + deco.borderBottom()));
QSignalSpy spy(&deco, SIGNAL(sectionUnderMouseChanged(Qt::WindowFrameSection)));
QVERIFY(spy.isValid());
QFETCH(QPoint, pos);
QHoverEvent event(QEvent::HoverMove, QPointF(pos), QPointF(pos));
QCoreApplication::sendEvent(&deco, &event);
QFETCH(Qt::WindowFrameSection, expected);
QCOMPARE(deco.sectionUnderMouse(), expected);
QCOMPARE(spy.count(), 1);
QCOMPARE(spy.first().first().value<Qt::WindowFrameSection>(), expected);
QHoverEvent event2(QEvent::HoverMove, QPointF(50, 50), QPointF(50, 50));
QCoreApplication::sendEvent(&deco, &event2);
QCOMPARE(deco.sectionUnderMouse(), Qt::NoSection);
QCOMPARE(spy.count(), 2);
QCOMPARE(spy.first().first().value<Qt::WindowFrameSection>(), expected);
QCOMPARE(spy.last().first().value<Qt::WindowFrameSection>(), Qt::NoSection);
}