本文整理汇总了C++中QButtonGroup::addButton方法的典型用法代码示例。如果您正苦于以下问题:C++ QButtonGroup::addButton方法的具体用法?C++ QButtonGroup::addButton怎么用?C++ QButtonGroup::addButton使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QButtonGroup
的用法示例。
在下文中一共展示了QButtonGroup::addButton方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
HistorySizeWidget::HistorySizeWidget(QWidget* parent)
: QWidget(parent)
{
_ui = new Ui::HistorySizeWidget();
_ui->setupUi(this);
_ui->unlimitedWarningWidget->setVisible(false);
_ui->unlimitedWarningWidget->setWordWrap(true);
_ui->unlimitedWarningWidget->setCloseButtonVisible(false);
_ui->unlimitedWarningWidget->setMessageType(KMessageWidget::Information);
_ui->unlimitedWarningWidget->setText(i18nc("@info:status",
"When using this option, the scrollback data will be written "
"unencrypted to temporary files. Those temporary files will be "
"deleted automatically when Konsole is closed in a normal manner.\n"
"Use Settings->Configure Konsole->File Location to select the "
"location of the temporary files."));
// focus and select the spinner automatically when appropriate
_ui->fixedSizeHistoryButton->setFocusProxy(_ui->historyLineSpinner);
connect(_ui->fixedSizeHistoryButton , &QRadioButton::clicked , _ui->historyLineSpinner , &KPluralHandlingSpinBox::selectAll);
QButtonGroup* modeGroup = new QButtonGroup(this);
modeGroup->addButton(_ui->noHistoryButton);
modeGroup->addButton(_ui->fixedSizeHistoryButton);
modeGroup->addButton(_ui->unlimitedHistoryButton);
connect(modeGroup, static_cast<void(QButtonGroup::*)(QAbstractButton*)>(&QButtonGroup::buttonClicked), this, &Konsole::HistorySizeWidget::buttonClicked);
_ui->historyLineSpinner->setSuffix(ki18ncp("Unit of scrollback", " line", " lines"));
this->setLineCount(HistorySizeWidget::DefaultLineCount);
connect(_ui->historyLineSpinner, static_cast<void(KPluralHandlingSpinBox::*)(int)>(&KPluralHandlingSpinBox::valueChanged), this, &Konsole::HistorySizeWidget::historySizeChanged);
}
示例2: init
void DkTifDialog::init() {
isOk = false;
setWindowTitle("TIF compression");
//setFixedSize(270, 146);
setLayout(new QVBoxLayout(this));
//QWidget* buttonWidget = new QWidget(this);
QGroupBox* buttonWidget = new QGroupBox(tr("TIF compression"), this);
QVBoxLayout* vBox = new QVBoxLayout(buttonWidget);
QButtonGroup* bGroup = new QButtonGroup(buttonWidget);
noCompressionButton = new QRadioButton( tr("&no compression"), this);
compressionButton = new QRadioButton(tr("&LZW compression (lossless)"), this);
compressionButton->setChecked(true);
bGroup->addButton(noCompressionButton);
bGroup->addButton(compressionButton);
vBox->addWidget(noCompressionButton);
vBox->addWidget(compressionButton);
// mButtons
QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
buttons->button(QDialogButtonBox::Ok)->setText(tr("&OK"));
buttons->button(QDialogButtonBox::Cancel)->setText(tr("&Cancel"));
connect(buttons, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
layout()->addWidget(buttonWidget);
layout()->addWidget(buttons);
}
示例3: ui
BaseTrackView::BaseTrackView(Controller::MainController *mainController, long trackID) :
ui(new Ui::BaseTrackView),
mainController(mainController),
trackID(trackID),
activated(true),
narrowed(false),
drawDbValue(true)
{
ui->setupUi(this);
QObject::connect(ui->muteButton, SIGNAL(clicked()), this, SLOT(onMuteClicked()));
QObject::connect(ui->soloButton, SIGNAL(clicked()), this, SLOT(onSoloClicked()));
QObject::connect(ui->levelSlider, SIGNAL(valueChanged(int)), this, SLOT(onFaderMoved(int)));
//QObject::connect(ui->panSlider, SIGNAL(sliderMoved(int)), this, SLOT(onPanSliderMoved(int)));
QObject::connect(ui->panSlider, SIGNAL(valueChanged(int)), this, SLOT(onPanSliderMoved(int)));
QObject::connect(ui->buttonBoostZero, SIGNAL(clicked(bool)), this, SLOT(onBoostButtonClicked()));
QObject::connect(ui->buttonBoostMinus12, SIGNAL(clicked(bool)), this, SLOT(onBoostButtonClicked()));
QObject::connect(ui->buttonBoostPlus12, SIGNAL(clicked(bool)), this, SLOT(onBoostButtonClicked()));
ui->panSlider->installEventFilter(this);
ui->levelSlider->installEventFilter(this);
ui->peaksDbLabel->installEventFilter(this);
//add in static map
trackViews.insert(trackID, this);
QButtonGroup* boostButtonGroup = new QButtonGroup(this);
boostButtonGroup->addButton(ui->buttonBoostMinus12);
boostButtonGroup->addButton(ui->buttonBoostZero);
boostButtonGroup->addButton(ui->buttonBoostPlus12);
ui->buttonBoostZero->setChecked(true);
setAttribute(Qt::WA_NoBackground);
}
示例4: QWidget
HistorySizeWidget::HistorySizeWidget(QWidget* parent)
: QWidget(parent)
{
_ui = new Ui::HistorySizeWidget();
_ui->setupUi(this);
_ui->unlimitedWarningWidget->setVisible(false);
_ui->unlimitedWarningWidget->setWordWrap(true);
_ui->unlimitedWarningWidget->setCloseButtonVisible(false);
_ui->unlimitedWarningWidget->setMessageType(KMessageWidget::Information);
_ui->unlimitedWarningWidget->setText(i18nc("@info:status",
"When using this option, the scrollback data will be written "
"unencrypted to temporary files. Those temporary files will be "
"deleted automatically when Konsole is closed in a normal manner."));
// focus and select the spinner automatically when appropriate
_ui->fixedSizeHistoryButton->setFocusProxy(_ui->historyLineSpinner);
connect(_ui->fixedSizeHistoryButton , SIGNAL(clicked()) ,
_ui->historyLineSpinner , SLOT(selectAll()));
QButtonGroup* modeGroup = new QButtonGroup(this);
modeGroup->addButton(_ui->noHistoryButton);
modeGroup->addButton(_ui->fixedSizeHistoryButton);
modeGroup->addButton(_ui->unlimitedHistoryButton);
connect(modeGroup, SIGNAL(buttonClicked(QAbstractButton*)),
this, SLOT(buttonClicked(QAbstractButton*)));
_ui->historyLineSpinner->setSuffix(ki18ncp("Unit of scrollback", " line", " lines"));
this->setLineCount(HistorySizeWidget::DefaultLineCount);
connect(_ui->historyLineSpinner, SIGNAL(valueChanged(int)),
this, SIGNAL(historySizeChanged(int)));
}
示例5: makeTimeGroupBox
void ExportDialog::makeTimeGroupBox(){
timeOutGb=new QGroupBox("Time Output");
radioSingle=new QRadioButton(tr("Single"));
radioAll=new QRadioButton(tr("All frames: 0 to "));
radioRange=new QRadioButton(tr("Range:"));
minBox=new QSpinBox;
maxBox=new QSpinBox;
QLabel *toLb=new QLabel(tr(" to "));
QButtonGroup buttonGroup;
buttonGroup.addButton(radioSingle);
buttonGroup.addButton(radioAll);
buttonGroup.addButton(radioRange);
radioSingle->setChecked(true);
QHBoxLayout *hLayout=new QHBoxLayout;
hLayout->addWidget(radioRange);
hLayout->addWidget(minBox);
hLayout->addWidget(toLb);
hLayout->addWidget(maxBox);
hLayout->addStretch(1);
QVBoxLayout *vLayout=new QVBoxLayout;
vLayout->addWidget(radioSingle);
vLayout->addWidget(radioAll);
vLayout->addLayout(hLayout);
timeOutGb->setLayout(vLayout);
}
示例6: ic
PatchView::PatchView(MainImpl* mi, Git* g) : Domain(mi, g, false) {
patchTab = new Ui_TabPatch();
patchTab->setupUi(container);
SCRef ic(QString::fromUtf8(":/icons/resources/plusminus.png"));
patchTab->buttonFilterPatch->setIcon(QIcon(ic));
QButtonGroup* bg = new QButtonGroup(this);
bg->addButton(patchTab->radioButtonParent, DIFF_TO_PARENT);
bg->addButton(patchTab->radioButtonHead, DIFF_TO_HEAD);
bg->addButton(patchTab->radioButtonSha, DIFF_TO_SHA);
connect(bg, SIGNAL(buttonClicked(int)), this, SLOT(button_clicked(int)));
patchTab->textBrowserDesc->setup(this);
patchTab->textEditDiff->setup(this, git);
patchTab->fileList->setup(this, git);
connect(m(), SIGNAL(typeWriterFontChanged()),
patchTab->textEditDiff, SLOT(typeWriterFontChanged()));
connect(m(), SIGNAL(changeFont(const QFont&)),
patchTab->fileList, SLOT(on_changeFont(const QFont&)));
connect(patchTab->lineEditDiff, SIGNAL(returnPressed()),
this, SLOT(lineEditDiff_returnPressed()));
connect(patchTab->fileList, SIGNAL(contextMenu(const QString&, int)),
this, SLOT(on_contextMenu(const QString&, int)));
connect(patchTab->buttonFilterPatch, SIGNAL(clicked()),
this, SLOT(buttonFilterPatch_clicked()));
}
示例7: optionsPreferences
void Kard::optionsPreferences()
{
if ( KConfigDialog::showDialog( "settings" ) ) {
return;
}
//KConfigDialog didn't find an instance of this dialog, so lets create it :
KConfigDialog* dialog = new KConfigDialog( this, "settings", KardSettings::self() );
dialog->setModal(true); //makes it modal even if it's not the default
QWidget *generalSettingsDlg = new QWidget;
ui_general.setupUi(generalSettingsDlg);
QButtonGroup *groupTimer = new QButtonGroup;
groupTimer->addButton(ui_general.slow, 0);
groupTimer->addButton(ui_general.medium, 1);
groupTimer->addButton(ui_general.quick, 2);
connect(groupTimer, SIGNAL(buttonClicked(int)), this, SLOT(slotUpdateTimer(int)));
ui_general.kcfg_LanguageCombobox->insertItems(0, m_sortedNames);
ui_general.kcfg_LanguageCombobox->setCurrentIndex(m_languages.indexOf(KardSettings::selectedLanguage()));
dialog->addPage(generalSettingsDlg, i18n("General"), "wizard");
QWidget *themeSettingsDlg = new QWidget;
ui_theme.setupUi(themeSettingsDlg);
dialog->addPage(themeSettingsDlg, i18n("Theme"), "colors");
connect(dialog, SIGNAL(settingsChanged(const QString &)), this, SLOT(slotUpdateSettings(const QString &)));
dialog->addPage(new KGameThemeSelector(dialog, KardSettings::self(), KGameThemeSelector::NewStuffDisableDownload),
i18n("Theme"), "games-config-theme");
dialog->show();
}
示例8: QWidget
XYZTextEditor::XYZTextEditor(QWidget *parent) : QWidget(parent), m_ui(new Ui::XYZTextEditor) {
m_ui->setupUi(this);
setupTextActions();
fontChanged(m_ui->textEdit->font());
alignmentChanged(m_ui->textEdit->alignment());
m_ui->textEdit->setFocus();
textEdit = m_ui->textEdit;
QButtonGroup *btnGroup = new QButtonGroup(this);
btnGroup->addButton(m_ui->btnAlignCenter);
btnGroup->addButton(m_ui->btnAlignJustify);
btnGroup->addButton(m_ui->btnAlignLeft);
btnGroup->addButton(m_ui->btnAlignRight);
QObject::connect(m_ui->textEdit, SIGNAL(currentCharFormatChanged(const QTextCharFormat &)),
this, SLOT(currentCharFormatChanged(const QTextCharFormat &)));
QObject::connect(m_ui->textEdit, SIGNAL(cursorPositionChanged()), this, SLOT(cursorPositionChanged()));
QObject::connect(m_ui->btnCut, SIGNAL(clicked()), m_ui->textEdit, SLOT(cut()));
QObject::connect(m_ui->btnCopy, SIGNAL(clicked()), m_ui->textEdit, SLOT(copy()));
QObject::connect(m_ui->btnPaste, SIGNAL(clicked()), m_ui->textEdit, SLOT(paste()));
QObject::connect(m_ui->btnTextDirection, SIGNAL(clicked()), this, SLOT(textDirection()));
// m_ui->textEdit->document()->defaultTextOption().setTextDirection(QApplication::layoutDirection());
// QTextCursor cursor = m_ui->textEdit->textCursor();
// QTextBlockFormat blockFmt = cursor.blockFormat();
// if (QApplication::layoutDirection() == Qt::RightToLeft) {
// blockFmt.setLayoutDirection(Qt::RightToLeft);
// } else {
// blockFmt.setLayoutDirection(Qt::LeftToRight);
// }
// cursor.setBlockFormat(blockFmt);
// qDebug()<<m_ui->textEdit->document()->defaultTextOption().textDirection();
// qDebug()<<m_ui->textEdit->toHtml();
}
示例9: MusicAbstractMoveDialog
MusicMessageBox::MusicMessageBox(QWidget *parent)
: MusicAbstractMoveDialog(parent),
ui(new Ui::MusicMessageBox)
{
ui->setupUi(this);
m_status = 0;
////////////////////////////////////////////////
ui->topTitleCloseButton->setIcon(QIcon(":/share/searchclosed"));
ui->topTitleCloseButton->setStyleSheet(MusicUIObject::MToolButtonStyle03);
ui->topTitleCloseButton->setCursor(QCursor(Qt::PointingHandCursor));
ui->topTitleCloseButton->setToolTip(tr("Close"));
ui->confirmButton->setStyleSheet(MusicUIObject::MPushButtonStyle08);
ui->cancelButton->setStyleSheet(MusicUIObject::MPushButtonStyle08);
ui->confirmButton->setCursor(QCursor(Qt::PointingHandCursor));
ui->cancelButton->setCursor(QCursor(Qt::PointingHandCursor));
QButtonGroup *groupButton = new QButtonGroup(this);
groupButton->addButton(ui->topTitleCloseButton, 0);
groupButton->addButton(ui->confirmButton, 1);
groupButton->addButton(ui->cancelButton, 2);
connect(groupButton, SIGNAL(buttonClicked(int)), SLOT(buttonClicked(int)));
}
示例10: XDialog
substituteList::substituteList(QWidget* parent, const char* name, bool modal, Qt::WFlags fl)
: XDialog(parent, name, modal, fl)
{
setupUi(this);
QButtonGroup * showByButtonGroup = new QButtonGroup(this);
showByButtonGroup->addButton(_byLeadTime);
showByButtonGroup->addButton(_byDays);
showByButtonGroup->addButton(_byDate);
// signals and slots connections
connect(_byDays, SIGNAL(toggled(bool)), _days, SLOT(setEnabled(bool)));
connect(_byDate, SIGNAL(toggled(bool)), _date, SLOT(setEnabled(bool)));
connect(_subs, SIGNAL(valid(bool)), _select, SLOT(setEnabled(bool)));
connect(_subs, SIGNAL(itemSelected(int)), _select, SLOT(animateClick()));
connect(showByButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(sFillList()));
connect(_close, SIGNAL(clicked()), this, SLOT(reject()));
connect(_select, SIGNAL(clicked()), this, SLOT(sSelect()));
connect(_item, SIGNAL(newId(int)), _warehouse, SLOT(findItemsites(int)));
connect(_item, SIGNAL(warehouseIdChanged(int)), _warehouse, SLOT(setId(int)));
_subs->addColumn(tr("Item Number"), _itemColumn, Qt::AlignLeft, true, "item_number" );
_subs->addColumn(tr("Description"), -1, Qt::AlignLeft, true, "itemdescrip" );
_subs->addColumn(tr("QOH"), _qtyColumn, Qt::AlignRight, true, "qoh" );
_subs->addColumn(tr("Norm. QOH"), _qtyColumn, Qt::AlignRight, true, "normqoh" );
_subs->addColumn(tr("Availability"), _qtyColumn, Qt::AlignRight, true, "available" );
_subs->addColumn(tr("Norm. Avail."), _qtyColumn, Qt::AlignRight, true, "normavailable" );
//If not multi-warehouse hide whs control
if (!_metrics->boolean("MultiWhs"))
{
_warehouseLit->hide();
_warehouse->hide();
}
}
示例11: WeatherAbstractMoveDialog
WeatherMessageBox::WeatherMessageBox(QWidget *parent)
: WeatherAbstractMoveDialog(parent),
ui(new Ui::WeatherMessageBox)
{
ui->setupUi(this);
drawWindowRoundedRect(this);
//set window radius
m_status = 0;
ui->background->setPixmap(QPixmap(":/image/background").scaled(size()));
////////////////////////////////////////////////
ui->topTitleCloseButton->setIcon(QIcon(":/image/close1"));
ui->topTitleCloseButton->setStyleSheet(WeatherUIObject::MToolButtonStyle01);
ui->topTitleCloseButton->setCursor(QCursor(Qt::PointingHandCursor));
ui->topTitleCloseButton->setToolTip(tr("Close"));
ui->confirmButton->setStyleSheet(WeatherUIObject::MPushButtonStyle04);
ui->cancelButton->setStyleSheet(WeatherUIObject::MPushButtonStyle04);
ui->confirmButton->setCursor(QCursor(Qt::PointingHandCursor));
ui->cancelButton->setCursor(QCursor(Qt::PointingHandCursor));
QButtonGroup *groupButton = new QButtonGroup(this);
groupButton->addButton(ui->topTitleCloseButton, 0);
groupButton->addButton(ui->confirmButton, 1);
groupButton->addButton(ui->cancelButton, 2);
connect(groupButton, SIGNAL(buttonClicked(int)), SLOT(buttonClicked(int)));
}
示例12: QWidget
TimeAnalysisWidget::TimeAnalysisWidget(QWidget *parent) :
QWidget(parent),
_ui(new Ui::TimeAnalysisWidget)
{
_ui->setupUi(this);
_ui->legendGroupBox->setLayout(new QFormLayout);
// read data
loadLowAndHighData(std::string(DATA_DIR) + "perDay.low");
//
initTransitionGraphs();
//
_ui->projectionWidget->setMainUI(this);
_ui->projectionWidget->setRadiusFactor(_ui->radiusSlider->value());
_ui->projectionWidget->setOpacity(_ui->opacitySlider->value());
// Autoexclude the Selection Modes
QButtonGroup *buttonGroup = new QButtonGroup;
buttonGroup->addButton(_ui->singleSelection, 0);
buttonGroup->addButton(_ui->groupSelection, 1);
connect(buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(selectionModeChanges(int)));
//
fillScalarComboBox();
_selectedScalar = _scalars[0];
_ui->colorByComboBox->setCurrentIndex(_selectedScalar->index());
connect(_ui->colorByComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changeSelectedScalar(int)));
connect(_ui->projectionWidget,SIGNAL(selectionChanged(QList<int>)), _ui->calendarWidget,SLOT(updateSelectedDays(QList<int>)));
connect(_ui->projectionWidget,SIGNAL(selectionChanged(QList<int>)), _ui->graphWidget,SLOT(updateSelectedDays(QList<int>)));
connect(_ui->calendarWidget, SIGNAL(changedSelectedDays(QList<int>)), _ui->projectionWidget, SLOT(updateSelectedPoints(QList<int>)));
updateLegend();
}
示例13: QWidget
WITToolPanel::WITToolPanel(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *vbox = new QHBoxLayout();
QButtonGroup *bgroup = new QButtonGroup();
QPushButton *b1 = new QPushButton("Touch");
QPushButton *b2 = new QPushButton("Surface");
QPushButton *b3 = new QPushButton("Stats");
QPushButton *b4 = new QPushButton("VOI");
b1->setCheckable(true);
b2->setCheckable(true);
b3->setCheckable(true);
b4->setCheckable(true);
bgroup->addButton(b1);
bgroup->addButton(b2);
bgroup->addButton(b3);
bgroup->addButton(b4);
QHBoxLayout *hbox = new QHBoxLayout();
hbox->addWidget(b1);
hbox->addWidget(b2);
hbox->addWidget(b3);
hbox->addWidget(b4);
hbox->addSpacerItem(new QSpacerItem(0,0,QSizePolicy::Expanding, QSizePolicy::Expanding));
vbox->addLayout(hbox);
setLayout(vbox);
}
示例14: highlightBackgroundColor
ConfigAppearanceWidget::ConfigAppearanceWidget(QWidget *parent)
: QWidget(parent)
{
m_itemMargin = 10;
ui.setupUi(this);
QButtonGroup *buttonGroup = new QButtonGroup(this);
buttonGroup->addButton(ui.standardAppearanceCheck);
buttonGroup->addButton(ui.customAppearanceCheck);
buttonGroup->setExclusive(true);
connect(buttonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(toggleCustom()));
QPalette palette = ui.itemTable->palette();
QColor highlightBackgroundColor(QApplication::style()->standardPalette().color(QPalette::Normal, QPalette::AlternateBase));
if (highlightBackgroundColor == QApplication::style()->standardPalette().color(QPalette::Normal, QPalette::Base))
highlightBackgroundColor = highlightBackgroundColor.darker(110);
palette.setColor(QPalette::Normal, QPalette::Highlight, highlightBackgroundColor);
palette.setColor(QPalette::Normal, QPalette::HighlightedText, QPalette::Text);
palette.setColor(QPalette::Inactive, QPalette::Highlight, highlightBackgroundColor);
palette.setColor(QPalette::Inactive, QPalette::HighlightedText, QPalette::Text);
palette.setColor(QPalette::Disabled, QPalette::Highlight, highlightBackgroundColor);
ui.itemTable->setPalette(palette);
m_itemHighlighted = -1;
connect(ui.itemTable, SIGNAL(currentItemChanged(QTableWidgetItem*,QTableWidgetItem*)), this, SLOT(setItemHighlighted(QTableWidgetItem*)));
connect(ui.fontButton, SIGNAL(clicked()), this, SLOT(showFontDialog()));
connect(ui.colorButton, SIGNAL(clicked()), this, SLOT(showColorDialog()));
}
示例15: GetLayout
QWidget* PackagesDelegate::GetLayout (const QModelIndex& index) const
{
if (!Row2Layout_.contains (index.row ()))
{
QToolButton *instRem = GetInstallRemove (index);
QToolButton *update = GetUpdate (index);
QButtonGroup *group = new QButtonGroup (Viewport_);
group->addButton (instRem);
group->addButton (update);
QWidget *result = new QWidget (Viewport_);
QHBoxLayout *layout = new QHBoxLayout (result);
layout->addWidget (instRem);
layout->addWidget (update);
result->setLayout (layout);
Row2Layout_ [index.row ()] = result;
}
else
{
bool isInstalled = index.data (PackagesModel::PMRInstalled).toBool ();
bool isUpgradable = index.data (PackagesModel::PMRUpgradable).toBool ();
if (isInstalled != WasInstalled_ [index])
GetInstallRemove (index);
if (isUpgradable != WasUpgradable_ [index])
GetUpdate (index);
}
return Row2Layout_ [index.row ()];
}