本文整理汇总了C++中KWDocument::frameSets方法的典型用法代码示例。如果您正苦于以下问题:C++ KWDocument::frameSets方法的具体用法?C++ KWDocument::frameSets怎么用?C++ KWDocument::frameSets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KWDocument
的用法示例。
在下文中一共展示了KWDocument::frameSets方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertCommand
void TestPageCommands::testRemovePageCommand4() // auto remove of frames
{
KWDocument document;
KWPageInsertCommand insertCommand(&document, 0);
insertCommand.redo();
KWFrameSet *fs = new KWFrameSet();
document.addFrameSet(fs);
MockShape *shape1 = new MockShape();
new KWFrame(shape1, fs);
KWTextFrameSet *tfs = new KWTextFrameSet(&document, Words::MainTextFrameSet);
document.addFrameSet(tfs);
MockShape *shape2 = new MockShape();
shape2->setUserData(new KoTextShapeData());
new KWTextFrame(shape2, tfs);
KWTextFrameSet *header = new KWTextFrameSet(&document, Words::EvenPagesHeaderTextFrameSet);
document.addFrameSet(header);
MockShape *shape3 = new MockShape();
shape3->setUserData(new KoTextShapeData());
new KWTextFrame(shape3, header);
KWPageRemoveCommand command(&document, insertCommand.page());
QCOMPARE(document.frameSetCount(), 3);
command.redo();
QCOMPARE(document.frameSetCount(), 2); // only the main&header framesets are left
QVERIFY(document.frameSets().contains(tfs));
QVERIFY(document.frameSets().contains(header));
QCOMPARE(fs->frameCount(), 0);
QCOMPARE(tfs->frameCount(), 0);
QCOMPARE(header->frameCount(), 0);
command.undo();
QCOMPARE(document.frameSetCount(), 3);
QCOMPARE(fs->frameCount(), 1);
QCOMPARE(tfs->frameCount(), 0); // doesn't get auto-added
QCOMPARE(header->frameCount(), 0); // doesn't get auto-added
}