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


C++ Theme::color方法代码示例

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


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

示例1: setDetails

//! Set commit message in details
void ChangeSelectionDialog::setDetails(int exitCode)
{
    Theme *theme = creatorTheme();

    QPalette palette;
    if (exitCode == 0) {
        m_ui->detailsText->setPlainText(QString::fromUtf8(m_process->readAllStandardOutput()));
        palette.setColor(QPalette::Text, theme->color(Theme::TextColorNormal));
        m_ui->changeNumberEdit->setPalette(palette);
        enableButtons(true);
    } else {
        m_ui->detailsText->setPlainText(tr("Error: Unknown reference"));
        palette.setColor(QPalette::Text, theme->color(Theme::TextColorError));
        m_ui->changeNumberEdit->setPalette(palette);
    }
}
开发者ID:leppa,项目名称:qt-creator,代码行数:17,代码来源:changeselectiondialog.cpp

示例2: recalculateDetails

void ChangeSelectionDialog::recalculateDetails()
{
    terminateProcess();
    enableButtons(false);

    const QString workingDir = workingDirectory();
    QPalette palette = m_ui->workingDirectoryEdit->palette();
    Theme *theme = creatorTheme();
    if (workingDir.isEmpty()) {
        m_ui->detailsText->setPlainText(tr("Error: Bad working directory."));
        palette.setColor(QPalette::Text, theme->color(Theme::TextColorError));
        m_ui->workingDirectoryEdit->setPalette(palette);
        return;
    } else {
        palette.setColor(QPalette::Text, theme->color(Theme::TextColorNormal));
        m_ui->workingDirectoryEdit->setPalette(palette);
    }

    const QString ref = change();
    if (ref.isEmpty()) {
        m_ui->detailsText->clear();
        return;
    }

    QStringList args;
    args << QLatin1String("show") << QLatin1String("--stat=80") << ref;

    m_process = new QProcess(this);
    m_process->setWorkingDirectory(workingDir);
    m_process->setProcessEnvironment(m_gitEnvironment);

    connect(m_process, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
            this, &ChangeSelectionDialog::setDetails);

    m_process->start(m_gitExecutable.toString(), args);
    m_process->closeWriteChannel();
    if (!m_process->waitForStarted())
        m_ui->detailsText->setPlainText(tr("Error: Could not start Git."));
    else
        m_ui->detailsText->setPlainText(tr("Fetching commit data..."));
}
开发者ID:leppa,项目名称:qt-creator,代码行数:41,代码来源:changeselectiondialog.cpp

示例3: buttonPalette

static QPalette buttonPalette(bool isActive, bool isCursorInside, bool forText)
{
    QPalette pal;
    Theme *theme = Utils::creatorTheme();
    if (isActive) {
        if (forText) {
            pal.setColor(QPalette::Background, theme->color(Theme::Welcome_ForegroundPrimaryColor));
            pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_ForegroundPrimaryColor));
            pal.setColor(QPalette::WindowText, theme->color(Theme::Welcome_BackgroundColor));
        } else {
            pal.setColor(QPalette::Background, theme->color(Theme::Welcome_ForegroundPrimaryColor));
            pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_ForegroundPrimaryColor));
        }
    } else {
        if (isCursorInside) {
            if (forText) {
                pal.setColor(QPalette::Background, theme->color(Theme::Welcome_HoverColor));
                pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_HoverColor));
                pal.setColor(QPalette::WindowText, theme->color(Theme::Welcome_TextColor));
            } else {
                pal.setColor(QPalette::Background, theme->color(Theme::Welcome_HoverColor));
                pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_ForegroundSecondaryColor));
            }
        } else {
            if (forText) {
                pal.setColor(QPalette::Background, theme->color(Theme::Welcome_ForegroundPrimaryColor));
                pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_BackgroundColor));
                pal.setColor(QPalette::WindowText, theme->color(Theme::Welcome_TextColor));
            } else {
                pal.setColor(QPalette::Background, theme->color(Theme::Welcome_BackgroundColor));
                pal.setColor(QPalette::Foreground, theme->color(Theme::Welcome_ForegroundSecondaryColor));
            }
        }
    }
    return pal;
}
开发者ID:choenig,项目名称:qt-creator,代码行数:36,代码来源:iwelcomepage.cpp


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