本文整理汇总了C++中KWPage::setPageStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ KWPage::setPageStyle方法的具体用法?C++ KWPage::setPageStyle怎么用?C++ KWPage::setPageStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KWPage
的用法示例。
在下文中一共展示了KWPage::setPageStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QCOMPARE
void TestPageCommands::testInsertPageCommand3() // restore all properties
{
KWDocument document;
KWPageInsertCommand command1(&document, 0);
command1.redo();
KWPage page = command1.page();
KWPageStyle style = page.pageStyle();
style.setHasMainTextFrame(false);
style.setFootnoteDistance(10);
KoPageLayout layout;
layout.width = 400;
layout.height = 300;
layout.leftMargin = 4;
layout.rightMargin = 6;
layout.topMargin = 7;
layout.bottomMargin = 5;
style.setPageLayout(layout);
page.setPageStyle(style);
KWPageInsertCommand command2(&document, 1); // append one page.
command2.redo();
QCOMPARE(command2.page().pageStyle(), style);
QCOMPARE(command2.page().width(), 400.);
// undo and redo, remember order is important
command2.undo();
command1.undo();
command1.redo();
command2.redo();
QVERIFY(command1.page() != page);
QCOMPARE(command1.page().pageNumber(), 1);
KWPageStyle style2 = command1.page().pageStyle();
QCOMPARE(style2, style);
QCOMPARE(style2.hasMainTextFrame(), false);
QCOMPARE(style2.footnoteDistance(), 10.);
KoPageLayout layout2 = style2.pageLayout();
QCOMPARE(layout2, layout);
QCOMPARE(command2.page().pageStyle(), style);
QCOMPARE(command2.page().width(), 400.);
}
示例2: insertCommand
void TestPageCommands::testRemovePageCommand3() // test restore all properties
{
KWDocument document;
KWPageInsertCommand insertCommand(&document, 0);
insertCommand.redo();
KWPage page = insertCommand.page();
KWPageStyle style = page.pageStyle();
style.setHasMainTextFrame(false);
style.setFootnoteDistance(10);
KoPageLayout layout;
layout.width = 400;
layout.height = 300;
layout.leftMargin = 4;
layout.rightMargin = 6;
layout.topMargin = 7;
layout.bottomMargin = 5;
style.setPageLayout(layout);
page.setPageStyle(style);
KWPageRemoveCommand command(&document, page);
command.redo();
QVERIFY(!page.isValid());
command.undo();
page = document.pageManager()->begin();
QVERIFY(page.isValid());
QVERIFY(insertCommand.page() != page);
QCOMPARE(page.pageNumber(), 1);
KWPageStyle style2 = page.pageStyle();
QCOMPARE(style2, style);
QCOMPARE(style2.hasMainTextFrame(), false);
QCOMPARE(style2.footnoteDistance(), 10.);
KoPageLayout layout2 = style2.pageLayout();
QCOMPARE(layout2, layout);
QCOMPARE(page.pageStyle(), style);
QCOMPARE(page.width(), 400.);
}