本文整理汇总了C++中Theme::name方法的典型用法代码示例。如果您正苦于以下问题:C++ Theme::name方法的具体用法?C++ Theme::name怎么用?C++ Theme::name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Theme
的用法示例。
在下文中一共展示了Theme::name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadThemes
void AppearanceSettings::loadThemes()
{
QStringList themeNames;
QStringList installPaths = Qtopia::installPaths();
qDeleteAll(m_themes);
m_themes.clear();
for (int i=0; i<installPaths.size(); i++) {
QString path(installPaths[i] + "etc/themes/");
QDir dir;
if (!dir.exists(path)) {
qLog(UI) << "Theme style configuration path not found" << path.toLocal8Bit().data();
continue;
}
// read theme.conf files
dir.setPath(path);
dir.setNameFilters(QStringList("*.conf")); // No tr
for (uint j=0; j<dir.count(); j++) {
QString name = dir[j].mid(0, dir[j].length() - 5); // cut ".conf"
Theme *theme = Theme::create(path + dir[j], name);
if (theme) {
m_themes << theme;
themeNames << theme->name();
}
}
}
themeNames << m_moreThemes;
QStringListModel *model;
model = qobject_cast<QStringListModel *>(m_themeCombo->model());
model->setStringList(themeNames);
}
示例2: findThemeItemByTheme
void ConfigureThemesDialog::Private::editedThemeNameChanged()
{
Theme * set = mEditor->editedTheme();
if ( !set )
return;
ThemeListWidgetItem * it = findThemeItemByTheme( set );
if ( !it )
return;
QString goodName = uniqueNameForTheme( set->name(), set );
it->setText( goodName );
}
示例3: CCHARP
#include <stdio.h>
#include "UnitTest.h"
#define CCHARP(str) ((const char*)str)
#define STR_EQUAL(str1, str2) (strcmp(CCHARP(str1), CCHARP(str2)) == 0)
EDELIB_NS_USE
UT_FUNC(ThemeTestReader, "Test Theme reader")
{
Theme t;
UT_VERIFY( t.load("theme.et") == true );
UT_VERIFY( t.loaded() == true );
UT_VERIFY( t.author() && STR_EQUAL(t.author(), "John Foo <[email protected]>") );
UT_VERIFY( t.name() && STR_EQUAL(t.name(), "Demo") );
UT_VERIFY( t.sample_image() && STR_EQUAL(t.sample_image(), "img.jpg") );
char buf[64];
long lval;
UT_VERIFY( t.get_item("test style", "item1", buf, sizeof(buf)) );
UT_VERIFY( STR_EQUAL(buf, "value 1") );
UT_VERIFY( t.get_item("test style", "item2", buf, sizeof(buf)) );
UT_VERIFY( STR_EQUAL(buf, "value 2") );
UT_VERIFY( t.get_item("test style", "item3", lval, 0) );
UT_VERIFY( lval == 123 );
/* return false if item wasn't found */