本文整理汇总了C++中GitClient::settings方法的典型用法代码示例。如果您正苦于以下问题:C++ GitClient::settings方法的具体用法?C++ GitClient::settings怎么用?C++ GitClient::settings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GitClient
的用法示例。
在下文中一共展示了GitClient::settings方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runDialog
bool LogChangeDialog::runDialog(const QString &repository,
const QString &commit,
LogChangeWidget::LogFlags flags)
{
if (!m_widget->init(repository, commit, flags))
return false;
if (QDialog::exec() == QDialog::Accepted) {
if (m_resetTypeComboBox) {
GitClient *client = GitPlugin::instance()->client();
client->settings().setValue(GitSettings::lastResetIndexKey,
m_resetTypeComboBox->currentIndex());
}
return true;
}
return false;
}
示例2: QDialog
LogChangeDialog::LogChangeDialog(bool isReset, QWidget *parent) :
QDialog(parent)
, m_widget(new LogChangeWidget)
, m_dialogButtonBox(new QDialogButtonBox(this))
, m_resetTypeComboBox(0)
{
auto layout = new QVBoxLayout(this);
layout->addWidget(new QLabel(isReset ? tr("Reset to:") : tr("Select change:"), this));
layout->addWidget(m_widget);
auto popUpLayout = new QHBoxLayout;
if (isReset) {
popUpLayout->addWidget(new QLabel(tr("Reset type:"), this));
m_resetTypeComboBox = new QComboBox(this);
m_resetTypeComboBox->addItem(tr("Hard"), QLatin1String("--hard"));
m_resetTypeComboBox->addItem(tr("Mixed"), QLatin1String("--mixed"));
m_resetTypeComboBox->addItem(tr("Soft"), QLatin1String("--soft"));
GitClient *client = GitPlugin::instance()->client();
m_resetTypeComboBox->setCurrentIndex(client->settings().intValue(
GitSettings::lastResetIndexKey));
popUpLayout->addWidget(m_resetTypeComboBox);
popUpLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Ignored));
}
popUpLayout->addWidget(m_dialogButtonBox);
m_dialogButtonBox->addButton(QDialogButtonBox::Cancel);
QPushButton *okButton = m_dialogButtonBox->addButton(QDialogButtonBox::Ok);
layout->addLayout(popUpLayout);
connect(m_dialogButtonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_dialogButtonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
connect(m_widget, &LogChangeWidget::activated, okButton, [okButton] { okButton->animateClick(); });
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
resize(600, 400);
}