本文整理汇总了C++中Theme类的典型用法代码示例。如果您正苦于以下问题:C++ Theme类的具体用法?C++ Theme怎么用?C++ Theme使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Theme类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWizard
OwncloudWizard::OwncloudWizard(QWidget *parent)
: QWizard(parent),
_configExists(false)
{
_setupPage = new OwncloudSetupPage;
_resultPage = new OwncloudWizardResultPage;
setPage(Page_oCSetup, _setupPage );
setPage(Page_Result, _resultPage );
// note: start Id is set by the calling class depending on if the
// welcome text is to be shown or not.
setWizardStyle( QWizard::ModernStyle );
connect( this, SIGNAL(currentIdChanged(int)), SLOT(slotCurrentPageChanged(int)));
connect( _setupPage, SIGNAL(connectToOCUrl(QString)), SIGNAL(connectToOCUrl(QString)));
Theme *theme = Theme::instance();
setWizardStyle(QWizard::ModernStyle);
setPixmap( QWizard::BannerPixmap, theme->wizardHeaderBanner() );
setPixmap( QWizard::LogoPixmap, theme->wizardHeaderLogo() );
setOption( QWizard::NoBackButtonOnStartPage );
setOption( QWizard::NoBackButtonOnLastPage );
setOption( QWizard::NoCancelButton );
setTitleFormat(Qt::RichText);
setSubTitleFormat(Qt::RichText);
}
示例2: setTitle
OwncloudWizardResultPage::OwncloudWizardResultPage()
{
_ui.setupUi(this);
// no fields to register.
Theme *theme = Theme::instance();
setTitle( tr("<font color=\"%1\" size=\"5\">Everything set up!</font>")
.arg(theme->wizardHeaderTitleColor().name()));
// required to show header in QWizard's modern style
setSubTitle( QLatin1String(" ") );
_ui.pbOpenLocal->setText("Open local folder");
_ui.pbOpenServer->setText(tr("Open %1").arg(Theme::instance()->appNameGUI()));
_ui.pbOpenLocal->setIcon(QIcon(":/mirall/resources/folder-sync.png"));
_ui.pbOpenLocal->setText(tr("Open Local Folder"));
_ui.pbOpenLocal->setIconSize(QSize(48, 48));
connect(_ui.pbOpenLocal, SIGNAL(clicked()), SLOT(slotOpenLocal()));
_ui.pbOpenLocal->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
QIcon appIcon = theme->applicationIcon();
_ui.pbOpenServer->setIcon(appIcon.pixmap(48));
_ui.pbOpenServer->setText(tr("Open %1").arg(theme->appNameGUI()));
_ui.pbOpenServer->setIconSize(QSize(48, 48));
_ui.pbOpenServer->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
connect(_ui.pbOpenServer, SIGNAL(clicked()), SLOT(slotOpenServer()));
setupCustomization();
}
示例3: setupCustomMedia
void OwncloudSetupPage::setupCustomization()
{
// set defaults for the customize labels.
_ui.sideLabel->setText( QString::null );
_ui.sideLabel->setFixedWidth(160);
_ui.topLabel->hide();
_ui.bottomLabel->hide();
Theme *theme = Theme::instance();
QVariant variant = theme->customMedia( Theme::oCSetupTop );
setupCustomMedia( variant, _ui.topLabel );
variant = theme->customMedia( Theme::oCSetupSide );
setupCustomMedia( variant, _ui.sideLabel );
variant = theme->customMedia( Theme::oCSetupBottom );
setupCustomMedia( variant, _ui.bottomLabel );
QString fixUrl = theme->overrideServerUrl();
if( !fixUrl.isEmpty() ) {
setOCUrl( fixUrl );
_ui.leUrl->setEnabled( false );
_ui.cbSecureConnect->hide();
_ui.leUrl->hide();
_ui.protocolLabel->hide();
_ui.serverAddressLabel->hide();
}
}
示例4: setupCustomMedia
void OwncloudSetupPage::setupCustomization()
{
// set defaults for the customize labels.
// _ui.topLabel->hide();
_ui.bottomLabel->hide();
Theme *theme = Theme::instance();
QVariant variant = theme->customMedia( Theme::oCSetupTop );
if( variant.isNull() ) {
_ui.topLabel->setOpenExternalLinks(true);
_ui.topLabel->setText("If you don't have an ownCloud server yet, see <a href=\"https://owncloud.com\">owncloud.com</a> for more info.");
} else {
setupCustomMedia( variant, _ui.topLabel );
}
variant = theme->customMedia( Theme::oCSetupBottom );
setupCustomMedia( variant, _ui.bottomLabel );
QString fixUrl = theme->overrideServerUrl();
if( !fixUrl.isEmpty() ) {
setServerUrl( fixUrl );
_ui.leUrl->setEnabled( false );
_ui.leUrl->hide();
}
}
示例5: AbstractCredentialsWizardPage
OwncloudOAuthCredsPage::OwncloudOAuthCredsPage()
: AbstractCredentialsWizardPage()
{
_ui.setupUi(this);
Theme *theme = Theme::instance();
_ui.topLabel->hide();
_ui.bottomLabel->hide();
QVariant variant = theme->customMedia(Theme::oCSetupTop);
WizardCommon::setupCustomMedia(variant, _ui.topLabel);
variant = theme->customMedia(Theme::oCSetupBottom);
WizardCommon::setupCustomMedia(variant, _ui.bottomLabel);
WizardCommon::initErrorLabel(_ui.errorLabel);
setTitle(WizardCommon::titleTemplate().arg(tr("Connect to %1").arg(Theme::instance()->appNameGUI())));
setSubTitle(WizardCommon::subTitleTemplate().arg(tr("Login in your browser")));
connect(_ui.openLinkButton, &QCommandLinkButton::clicked, [this] {
_ui.errorLabel->hide();
qobject_cast<OwncloudWizard *>(wizard())->account()->clearCookieJar(); // #6574
if (_asyncAuth)
_asyncAuth->openBrowser();
});
_ui.openLinkButton->setContextMenuPolicy(Qt::CustomContextMenu);
QObject::connect(_ui.openLinkButton, &QWidget::customContextMenuRequested, [this](const QPoint &pos) {
auto menu = new QMenu(_ui.openLinkButton);
menu->addAction(tr("Copy link to clipboard"), this, [this] {
if (_asyncAuth)
QApplication::clipboard()->setText(_asyncAuth->authorisationLink().toString(QUrl::FullyEncoded));
});
menu->setAttribute(Qt::WA_DeleteOnClose);
menu->popup(_ui.openLinkButton->mapToGlobal(pos));
});
}
示例6: lua_Theme_getRefCount
static int lua_Theme_getRefCount(lua_State* state)
{
// Get the number of parameters.
int paramCount = lua_gettop(state);
// Attempt to match the parameters to a valid binding.
switch (paramCount)
{
case 1:
{
if ((lua_type(state, 1) == LUA_TUSERDATA))
{
Theme* instance = getInstance(state);
unsigned int result = instance->getRefCount();
// Push the return value onto the stack.
lua_pushunsigned(state, result);
return 1;
}
lua_pushstring(state, "lua_Theme_getRefCount - Failed to match the given parameters to a valid function signature.");
lua_error(state);
break;
}
default:
{
lua_pushstring(state, "Invalid number of parameters (expected 1).");
lua_error(state);
break;
}
}
return 0;
}
示例7: QWizardPage
OwncloudSetupPage::OwncloudSetupPage()
: QWizardPage(),
_ui(),
_oCUrl(),
_ocUser(),
_authTypeKnown(false),
_checking(false),
_authType(WizardCommon::HttpCreds),
_progressIndi(new QProgressIndicator (this))
{
_ui.setupUi(this);
Theme *theme = Theme::instance();
setTitle(WizardCommon::titleTemplate().arg(tr("Connect to %1").arg(theme->appNameGUI())));
setSubTitle(WizardCommon::subTitleTemplate().arg(tr("Setup %1 server").arg(theme->appNameGUI())));
registerField( QLatin1String("OCUrl*"), _ui.leUrl );
_ui.resultLayout->addWidget( _progressIndi );
stopSpinner();
setupCustomization();
connect(_ui.leUrl, SIGNAL(textChanged(QString)), SLOT(slotUrlChanged(QString)));
connect(_ui.leUrl, SIGNAL(editingFinished()), SLOT(slotUrlEditFinished()));
}
示例8: lua_Theme_addRef
static int lua_Theme_addRef(lua_State* state)
{
// Get the number of parameters.
int paramCount = lua_gettop(state);
// Attempt to match the parameters to a valid binding.
switch (paramCount)
{
case 1:
{
if ((lua_type(state, 1) == LUA_TUSERDATA))
{
Theme* instance = getInstance(state);
instance->addRef();
return 0;
}
lua_pushstring(state, "lua_Theme_addRef - Failed to match the given parameters to a valid function signature.");
lua_error(state);
break;
}
default:
{
lua_pushstring(state, "Invalid number of parameters (expected 1).");
lua_error(state);
break;
}
}
return 0;
}
示例9: QWizardPage
OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage()
: QWizardPage(),
_ui(),
_checking(false),
_created(false),
_localFolderValid(false),
_progressIndi(new QProgressIndicator (this)),
_oldLocalFolder(),
_remoteFolder()
{
_ui.setupUi(this);
Theme *theme = Theme::instance();
setTitle(WizardCommon::titleTemplate().arg(tr("Connect to %1").arg(theme->appNameGUI())));
setSubTitle(WizardCommon::subTitleTemplate().arg(tr("Setup local folder options")));
registerField( QLatin1String("OCSyncFromScratch"), _ui.cbSyncFromScratch);
_ui.resultLayout->addWidget( _progressIndi );
stopSpinner();
setupCustomization();
connect( _ui.pbSelectLocalFolder, SIGNAL(clicked()), SLOT(slotSelectFolder()));
setButtonText(QWizard::NextButton, tr("Connect..."));
connect( _ui.rSyncEverything, SIGNAL(clicked()), SLOT(slotSyncEverythingClicked()));
connect( _ui.rSelectiveSync, SIGNAL(clicked()), SLOT(slotSelectiveSyncClicked()));
connect( _ui.bSelectiveSync, SIGNAL(clicked()), SLOT(slotSelectiveSyncClicked()));
QIcon appIcon = theme->applicationIcon();
_ui.lServerIcon->setText(QString());
_ui.lServerIcon->setPixmap(appIcon.pixmap(48));
_ui.lLocalIcon->setText(QString());
_ui.lLocalIcon->setPixmap(QPixmap(Theme::hidpiFileName(":/client/resources/folder-sync.png")));
}
示例10: QWizardPage
OwncloudWizardResultPage::OwncloudWizardResultPage()
: QWizardPage(),
_localFolder(),
_remoteFolder(),
_complete(false),
_ui()
{
_ui.setupUi(this);
// no fields to register.
setTitle(WizardCommon::subTitleTemplate().arg(tr("Everything set up!")));
// required to show header in QWizard's modern style
setSubTitle( QLatin1String(" ") );
_ui.pbOpenLocal->setText(tr("Open Local Folder"));
_ui.pbOpenLocal->setIcon(QIcon(QLatin1String(":/client/resources/folder-sync.png")));
_ui.pbOpenLocal->setIconSize(QSize(48, 48));
_ui.pbOpenLocal->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
connect(_ui.pbOpenLocal, SIGNAL(clicked()), SLOT(slotOpenLocal()));
Theme* theme = Theme::instance();
QIcon appIcon = theme->applicationIcon();
_ui.pbOpenServer->setText(tr("Open %1 in Browser").arg(theme->appNameGUI()));
_ui.pbOpenServer->setIcon(appIcon.pixmap(48));
_ui.pbOpenServer->setIconSize(QSize(48, 48));
_ui.pbOpenServer->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
connect(_ui.pbOpenServer, SIGNAL(clicked()), SLOT(slotOpenServer()));
setupCustomization();
}
示例11: QObject
ApplicationUI::ApplicationUI(bb::cascades::Application *app)
: QObject(app)
{
ThemeSupport* themeSupport = app->themeSupport();
Theme* currentTheme = themeSupport->theme();
ColorTheme* colorTheme = currentTheme->colorTheme();
VisualStyle::Type style = colorTheme->style();
switch (style)
{
case VisualStyle::Bright:
m_theme = Bright;
break;
case VisualStyle::Dark:
m_theme = Dark;
break;
}
// create scene document from main.qml asset
// set parent to created document to ensure it exists for the whole application lifetime
QmlDocument *qml = QmlDocument::create("asset:///main.qml").parent(this);
qml->setContextProperty("_native", this);
// create root object for the UI
AbstractPane *root = qml->createRootObject<AbstractPane>();
// set created root object as a scene
app->setScene(root);
}
示例12: QWizardPage
OwncloudAdvancedSetupPage::OwncloudAdvancedSetupPage()
: QWizardPage(),
_ui(),
_checking(false),
_created(false),
_configExists(false),
_multipleFoldersExist(false),
_progressIndi(new QProgressIndicator (this)),
_oldLocalFolder(),
_remoteFolder()
{
_ui.setupUi(this);
Theme *theme = Theme::instance();
setTitle(WizardCommon::titleTemplate().arg(tr("Connect to %1").arg(theme->appNameGUI())));
setSubTitle(WizardCommon::subTitleTemplate().arg(tr("Setup local folder options")));
registerField( QLatin1String("OCSyncFromScratch"), _ui.cbSyncFromScratch);
_ui.resultLayout->addWidget( _progressIndi );
stopSpinner();
setupCustomization();
connect( _ui.pbSelectLocalFolder, SIGNAL(clicked()), SLOT(slotSelectFolder()));
}
示例13: qDeleteAll
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);
}
示例14: currentTheme
void AppearanceSettings::backgroundChanged(int index)
{
Theme *theme = currentTheme();
if (theme) {
theme->setCurrentBackgroundIndex(index);
QTimer::singleShot(0, this, SLOT(previewBackgroundChanges()));
}
}
示例15: beginUpdate
void Frame::setTheme( Theme& t, const string prefix )
{
beginUpdate();
Widget::setTheme( t, prefix );
setCursor( t.getCursor( prefix+"frame" ) );
setFont( t.getFont( prefix+"frame" ) );
endUpdate();
}