本文整理汇总了C++中KisLayerSP::visible方法的典型用法代码示例。如果您正苦于以下问题:C++ KisLayerSP::visible方法的具体用法?C++ KisLayerSP::visible怎么用?C++ KisLayerSP::visible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisLayerSP
的用法示例。
在下文中一共展示了KisLayerSP::visible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testLayerComposition
void KisImageTest::testLayerComposition()
{
KisImageSP image = new KisImage(0, IMAGE_WIDTH, IMAGE_WIDTH, 0, "layer tests");
QVERIFY(image->rootLayer() != 0);
QVERIFY(image->rootLayer()->firstChild() == 0);
KisLayerSP layer = new KisPaintLayer(image, "layer 1", OPACITY_OPAQUE_U8);
image->addNode(layer);
KisLayerSP layer2 = new KisPaintLayer(image, "layer 2", OPACITY_OPAQUE_U8);
image->addNode(layer2);
QVERIFY(layer->visible());
QVERIFY(layer2->visible());
KisLayerComposition comp(image, "comp 1");
comp.store();
layer2->setVisible(false);
QVERIFY(layer->visible());
QVERIFY(!layer2->visible());
KisLayerComposition comp2(image, "comp 2");
comp2.store();
comp.apply();
QVERIFY(layer->visible());
QVERIFY(layer2->visible());
comp2.apply();
QVERIFY(layer->visible());
QVERIFY(!layer2->visible());
}
示例2: testCreation
void KisLayerTest::testCreation()
{
const KoColorSpace * colorSpace = KoColorSpaceRegistry::instance()->colorSpace("RGBA", 0);
KisImageSP image = new KisImage(0, 512, 512, colorSpace, "layer test");
KisLayerSP layer = new TestLayer(image, "test", OPACITY_OPAQUE);
QCOMPARE(layer->name(), QString("test"));
QCOMPARE(layer->opacity(), OPACITY_OPAQUE);
QCOMPARE(layer->image(), image);
QCOMPARE(layer->colorSpace(), image->colorSpace());
QCOMPARE(layer->visible(), true);
QCOMPARE(layer->userLocked(), false);
QCOMPARE(layer->temporary(), false);
image->addNode(layer, image->rootLayer());
QBitArray channels(4);
channels.fill(true);
layer->setChannelFlags(channels);
QVERIFY(layer->channelFlags().count() == 4);
QCOMPARE(layer->channelFlags().at(0), true);
QCOMPARE(layer->channelFlags().at(1), true);
QCOMPARE(layer->channelFlags().at(2), true);
QCOMPARE(layer->channelFlags().at(3), true);
layer->setOpacity(OPACITY_TRANSPARENT);
QCOMPARE(layer->opacity(), OPACITY_TRANSPARENT);
layer->setPercentOpacity(100);
QCOMPARE(layer->opacity(), OPACITY_OPAQUE);
layer->setPercentOpacity(0);
QCOMPARE(layer->opacity(), OPACITY_TRANSPARENT);
}