当前位置: 首页>>代码示例>>C++>>正文


C++ Entry::backgroundColor方法代码示例

本文整理汇总了C++中Entry::backgroundColor方法的典型用法代码示例。如果您正苦于以下问题:C++ Entry::backgroundColor方法的具体用法?C++ Entry::backgroundColor怎么用?C++ Entry::backgroundColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Entry的用法示例。


在下文中一共展示了Entry::backgroundColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: testEntrySets

void TestModified::testEntrySets()
{
    int spyCount = 0;
    Database* db = new Database();
    Group* root = db->rootGroup();

    Group* g = new Group();
    g->setParent(root);
    Entry* entry = new Entry();
    entry->setGroup(g);

    QSignalSpy spyModified(db, SIGNAL(modifiedImmediate()));

    entry->setUuid(Uuid::random());
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setUuid(entry->uuid());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setTitle("test");
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setTitle(entry->title());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setUrl("test");
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setUrl(entry->url());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setUsername("test");
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setUsername(entry->username());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setPassword("test");
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setPassword(entry->password());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setNotes("test");
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setNotes(entry->notes());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setIcon(1);
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setIcon(entry->iconNumber());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setIcon(Uuid::random());
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setIcon(entry->iconUuid());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setTags("test");
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setTags(entry->tags());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setExpires(true);
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setExpires(entry->timeInfo().expires());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setExpiryTime(Tools::currentDateTimeUtc().addYears(1));
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setExpiryTime(entry->timeInfo().expiryTime());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setAutoTypeEnabled(false);
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setAutoTypeEnabled(entry->autoTypeEnabled());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setAutoTypeObfuscation(1);
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setAutoTypeObfuscation(entry->autoTypeObfuscation());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setDefaultAutoTypeSequence("test");
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setDefaultAutoTypeSequence(entry->defaultAutoTypeSequence());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setForegroundColor(Qt::red);
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setForegroundColor(entry->foregroundColor());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setBackgroundColor(Qt::red);
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setBackgroundColor(entry->backgroundColor());
    QCOMPARE(spyModified.count(), spyCount);

    entry->setOverrideUrl("test");
    QCOMPARE(spyModified.count(), ++spyCount);
    entry->setOverrideUrl(entry->overrideUrl());
    QCOMPARE(spyModified.count(), spyCount);

    entry->attributes()->set("test key", "test value", false);
    QCOMPARE(spyModified.count(), ++spyCount);
//.........这里部分代码省略.........
开发者ID:2015yc,项目名称:keepassx,代码行数:101,代码来源:TestModified.cpp


注:本文中的Entry::backgroundColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。