本文整理汇总了C++中QToolButton::setChecked方法的典型用法代码示例。如果您正苦于以下问题:C++ QToolButton::setChecked方法的具体用法?C++ QToolButton::setChecked怎么用?C++ QToolButton::setChecked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QToolButton
的用法示例。
在下文中一共展示了QToolButton::setChecked方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setCurrentStackWidgetSlot
void TCPTransfer::setCurrentStackWidgetSlot()
{
QObject* sender = this->sender();
QToolButton* tbtn = static_cast<QToolButton*>(sender);
if(!tbtn) return;
ui->friendsTBtn->setChecked(false);
ui->uploadTBtn->setChecked(false);
ui->historyTBtn->setChecked(false);
int index = 0;
if( tbtn == ui->friendsTBtn )
{
tbtn->setChecked(true);
index = 0;
}
else if( tbtn == ui->uploadTBtn )
{
tbtn->setChecked(true);
index = 1;
}
else if( tbtn == ui->historyTBtn )
{
tbtn->setChecked(true);
index = 2;
}
updateButton(index);
emit currentStackWidgetSingal(index);
}
示例2: QMainWindow
Plot3D::Plot3D(QWidget *parent, Data *dat) : QMainWindow(parent)
{
// pointers
data = dat;
// create 3D surface
setData();
// design widget
QToolBar *toolBar = new QToolBar(this);
QToolButton *btnSpectrogram = new QToolButton(toolBar);
QToolButton *btnContour = new QToolButton(toolBar);
QToolButton *btnPrint = new QToolButton(toolBar);
btnPrint->setText("Print");
btnPrint->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
toolBar->addWidget(btnPrint);
addToolBar(toolBar);
connect(btnPrint, SIGNAL(clicked()), this, SLOT(printPlot()));
btnSpectrogram->setChecked(true);
btnContour->setChecked(false);
}
示例3: tbButton_clicked
void UIControllerSetting::tbButton_clicked()
{
QToolButton* tb = qobject_cast<QToolButton*>( sender() );
if ( !mTimer->isActive() )
{
tb->setChecked( true );
mPadKey = mButtons[ tb ];
QString text1 = QtYabause::translate(QString("Awaiting input for"));
QString text2 = QtYabause::translate(mNames[ mPadKey ]);
QString text3 = QtYabause::translate(QString("Press Esc key to cancel"));
mlInfos->setText( text1 + QString(": %1\n").arg(text2) + text3 );
setScanFlags(mScanMasks[mPadKey]);
mCore->Flush();
curTb=tb;
tb->setAttribute(Qt::WA_TransparentForMouseEvents);
mTimer->start();
}
else
{
tb->setChecked( tb == mButtons.key( mPadKey ) );
}
}
示例4: createToolbars
void MainWindow::createToolbars()
{
editToolBar = addToolBar(tc->toUnicode("Edit"));
editToolBar->addAction(deleteAction);
editToolBar->addAction(toFrontAction);
editToolBar->addAction(sendBackAction);
editToolBar->addAction(checkAction);
editToolBar->addAction(BHAct);
editToolBar->addAction(JHAct);
QToolButton *pointerButton = new QToolButton;
pointerButton->setCheckable(true);
pointerButton->setChecked(true);
pointerButton->setIcon(QIcon(":/images/pointer.png"));
pointerTypeGroup = new QButtonGroup;
pointerTypeGroup->addButton(pointerButton, int(MoveItem));
connect(pointerTypeGroup, SIGNAL(buttonClicked(int)),
this, SLOT(pointerGroupClicked(int)));
pointerToolbar = addToolBar(tc->toUnicode("Pointer type"));
pointerToolbar->addWidget(pointerButton);
QToolButton *BanButton = new QToolButton;
BanButton->setCheckable(true);
QToolButton *TransButton = new QToolButton;
TransButton->setCheckable(true);
TransButton->setChecked(true);
BanButton->setIcon(QIcon(":/images/ban.png"));
TransButton->setIcon(QIcon(":/images/scale.png"));
BorTGroup = new QButtonGroup;
BorTGroup->addButton(BanButton, 1);
connect(BorTGroup, SIGNAL(buttonClicked(int)),
this, SLOT(BorTGroupClicked(int)));
BorTGroup->addButton(TransButton, 0);
connect(BorTGroup, SIGNAL(buttonClicked(int)),
this, SLOT(BorTGroupClicked(int)));
BorTToolbar = addToolBar(tc->toUnicode("Pointer type"));
BorTToolbar->addWidget(BanButton);
BorTToolbar->addWidget(TransButton);
}
示例5: createUI
void SensorWidget::createUI()
{
if(m_pSensorModel)
{
// Sensor Selection
QButtonGroup *qBGSensorSelection = new QButtonGroup;
qBGSensorSelection->setExclusive(true);
QVBoxLayout *VBoxSensorSelection = new QVBoxLayout;
for(qint32 i = 0; i < m_pSensorModel->getSensorGroups().size(); ++i)
{
QToolButton *sensorSelectionButton = new QToolButton;
sensorSelectionButton->setText(m_pSensorModel->getSensorGroups()[i].getGroupName());
qBGSensorSelection->addButton(sensorSelectionButton,i);
VBoxSensorSelection->addWidget(sensorSelectionButton);
}
connect(qBGSensorSelection, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), m_pSensorModel, &SensorModel::applySensorGroup);
// Layout Selection
QButtonGroup *qBGLayout = new QButtonGroup;
qBGLayout->setExclusive(true);
QHBoxLayout *HBoxButtonGroupLayout = new QHBoxLayout;
for(qint32 i = 0; i < m_pSensorModel->getNumLayouts(); ++i)
{
QToolButton *buttonLayout = new QToolButton;
buttonLayout->setText(m_pSensorModel->getSensorLayouts()[i].getName());
buttonLayout->setCheckable(true);
if(i == 0)
buttonLayout->setChecked(true);
else
buttonLayout->setChecked(false);
qBGLayout->addButton(buttonLayout, i);
HBoxButtonGroupLayout->addWidget(buttonLayout);
}
connect(qBGLayout, static_cast<void (QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked), m_pSensorModel, &SensorModel::setCurrentLayout);
QGridLayout *topLayout = new QGridLayout;
topLayout->addWidget(m_pGraphicsView, 0, 0);
topLayout->addLayout(VBoxSensorSelection, 0, 1);
topLayout->addLayout(HBoxButtonGroupLayout, 1, 0);
setLayout(topLayout);
}
}
示例6: createToolbars
void MainWindow::createToolbars()
{
QToolButton *dragButton = new QToolButton;
dragButton->setCheckable(true);
dragButton->setChecked(true);
dragButton->setIcon(QIcon(":/images/pointer.png"));
QToolButton *linePointerButton = new QToolButton;
linePointerButton->setCheckable(true);
linePointerButton->setIcon(QIcon(":/images/linepointer.png"));
m_pointerTypeGroup = new QButtonGroup(this);
m_pointerTypeGroup->addButton(dragButton, int(BTEditorScene::Mode::Drag));
m_pointerTypeGroup->addButton(linePointerButton, int(BTEditorScene::Mode::InsertLine));
connect(m_pointerTypeGroup, SIGNAL(buttonClicked(int)), this, SLOT(onPointerTypeGroupClicked(int)));
m_sceneScaleCombo = new QComboBox;
QStringList scales;
scales << tr("25%") << tr("50%") << tr("75%") << tr("100%") << tr("150%") << tr("200%");
m_sceneScaleCombo->addItems(scales);
m_sceneScaleCombo->setCurrentIndex(3);
connect(m_sceneScaleCombo, SIGNAL(currentIndexChanged(QString)), this, SLOT(onSceneScaleChanged(QString)));
m_pointerToolbar = addToolBar(tr("pointer"));
m_pointerToolbar->addWidget(dragButton);
m_pointerToolbar->addWidget(linePointerButton);
m_pointerToolbar->addWidget(m_sceneScaleCombo);
}
示例7: toolButtonClicked
void QmitkToolSelectionBox::toolButtonClicked(int id)
{
if ( !QWidget::isEnabled() ) return; // this method could be triggered from the constructor, when we are still disabled
MITK_DEBUG << "toolButtonClicked(" << id << "): id translates to tool ID " << m_ToolIDForButtonID[id];
//QToolButton* toolButton = dynamic_cast<QToolButton*>( Q3ButtonGroup::find(id) );
QToolButton* toolButton = dynamic_cast<QToolButton*>( m_ToolButtonGroup->buttons().at(id) );
if (toolButton)
{
if ( (m_ButtonIDForToolID.find( m_ToolManager->GetActiveToolID() ) != m_ButtonIDForToolID.end()) // if we have this tool in our box
&& (m_ButtonIDForToolID[ m_ToolManager->GetActiveToolID() ] == id) ) // the tool corresponding to this button is already active
{
// disable this button, disable all tools
// mmueller
toolButton->setChecked(false);
m_ToolManager->ActivateTool(-1); // disable everything
}
else
{
// enable the corresponding tool
m_SelfCall = true;
m_ToolManager->ActivateTool( m_ToolIDForButtonID[id] );
m_SelfCall = false;
}
}
}
示例8: addChildView
void AMBrowseScansView::addChildView(QAbstractItemView *childView, const QIcon &icon)
{
if(!childView)
return;
childViews_.append(childView);
childView->setModel(proxyModel_);
QToolButton* viewButton = new QToolButton();
viewButton->setIcon(icon);
viewButton->setCheckable(true);
if(viewButtonGroup_->buttons().isEmpty())
viewButton->setChecked(true);
viewButtonLayout_->addWidget(viewButton);
viewButtonGroup_->addButton(viewButton);
childViewDisplayArea_->addWidget(childView);
viewButtonGroup_->setId(viewButton, viewButtonGroup_->buttons().count()-1);
childView->setContextMenuPolicy(Qt::CustomContextMenu);
childView->setDragEnabled(true);
childView->setDropIndicatorShown(true);
connect(childView, SIGNAL(doubleClicked(const QModelIndex&)), this, SIGNAL(childViewDoubleClicked(const QModelIndex&)));
connect(childView, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(onContextMenuRequested(const QPoint&)));
connect(childView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(onChildViewSelectionChanged()));
}
示例9: createToolbars
void fmSegmentsImpl::createToolbars()
{
mainToolBar = addToolBar(tr("Start"));
mainToolBar->addAction(startAction);
editToolBar = addToolBar(tr("Edit"));
//editToolBar->addAction(deleteAction);
editToolBar->addAction(clearAction);
QToolButton *pointerButton = new QToolButton;
pointerButton->setCheckable(true);
pointerButton->setIcon(QIcon("./images/pointer.png"));
QToolButton *linePointerButton = new QToolButton;
linePointerButton->setCheckable(true);
linePointerButton->setChecked(true);
linePointerButton->setIcon(QIcon("./images/linepointer.png"));
pointerTypeGroup = new QButtonGroup;
pointerTypeGroup->addButton(pointerButton, int(SegmentScene::MoveSegment));
pointerTypeGroup->addButton(linePointerButton, int(SegmentScene::InsertSegment));
connect(pointerTypeGroup, SIGNAL(buttonClicked(int )), this, SLOT(pointerGroupClicked(int )));
pointerToolbar = addToolBar(tr("Pointer type"));
pointerToolbar->addWidget(pointerButton);
pointerToolbar->addWidget(linePointerButton);
}
示例10: creatToolbar
void MainWindow::creatToolbar()
{
QToolButton *pointerButton = new QToolButton;
pointerButton->setCheckable(true);
pointerButton->setChecked(true);
pointerButton->setIcon(QIcon(":/images/pointer.png"));
QToolButton *linkButton = new QToolButton;
linkButton->setCheckable(true);
linkButton->setIcon(QIcon(":/images/link.png"));
pointerTypeGroup = new QButtonGroup;
pointerTypeGroup->addButton(pointerButton,FDBScene::MoveItem);
pointerTypeGroup->addButton(linkButton,FDBScene::InsertLine);
connect(pointerTypeGroup,SIGNAL(buttonClicked(int)),this,SLOT(pointerTypeGroupClicked(int)));
editToolBar = addToolBar(tr("Edit"));
editToolBar->addAction(addAndGateAction);
editToolBar->addAction(addOrGateAction);
editToolBar->addAction(addOrGateAction);
editToolBar->addAction(addNotGateAction);
//...
editToolBar->addSeparator();
editToolBar->addAction(cutAction);
editToolBar->addAction(copyAction);
editToolBar->addAction(pasteAction);
editToolBar->addSeparator();
editToolBar->addAction(deleteAction);
editToolBar->addAction(bringToFrontAction);
editToolBar->addAction(sendToBackAction);
editToolBar->addWidget(pointerButton);
editToolBar->addWidget(linkButton);
}
示例11: QHBoxLayout
QWidget *QmlProfilerTraceView::createToolbar()
{
Utils::StyledBar *bar = new Utils::StyledBar(this);
bar->setStyleSheet(QLatin1String("background: #9B9B9B"));
bar->setSingleRow(true);
bar->setFixedWidth(150);
bar->setFixedHeight(24);
QHBoxLayout *toolBarLayout = new QHBoxLayout(bar);
toolBarLayout->setMargin(0);
toolBarLayout->setSpacing(0);
QToolButton *buttonPrev= new QToolButton;
buttonPrev->setIcon(QIcon(QLatin1String(":/qmlprofiler/ico_prev.png")));
buttonPrev->setToolTip(tr("Jump to previous event"));
connect(buttonPrev, SIGNAL(clicked()), this, SIGNAL(jumpToPrev()));
connect(this, SIGNAL(enableToolbar(bool)), buttonPrev, SLOT(setEnabled(bool)));
QToolButton *buttonNext= new QToolButton;
buttonNext->setIcon(QIcon(QLatin1String(":/qmlprofiler/ico_next.png")));
buttonNext->setToolTip(tr("Jump to next event"));
connect(buttonNext, SIGNAL(clicked()), this, SIGNAL(jumpToNext()));
connect(this, SIGNAL(enableToolbar(bool)), buttonNext, SLOT(setEnabled(bool)));
QToolButton *buttonZoomControls = new QToolButton;
buttonZoomControls->setIcon(QIcon(QLatin1String(":/qmlprofiler/ico_zoom.png")));
buttonZoomControls->setToolTip(tr("Show zoom slider"));
buttonZoomControls->setCheckable(true);
buttonZoomControls->setChecked(false);
connect(buttonZoomControls, SIGNAL(toggled(bool)), this, SIGNAL(showZoomSlider(bool)));
connect(this, SIGNAL(enableToolbar(bool)), buttonZoomControls, SLOT(setEnabled(bool)));
d->m_buttonRange = new QToolButton;
d->m_buttonRange->setIcon(QIcon(QLatin1String(":/qmlprofiler/ico_rangeselection.png")));
d->m_buttonRange->setToolTip(tr("Select range"));
d->m_buttonRange->setCheckable(true);
d->m_buttonRange->setChecked(false);
connect(d->m_buttonRange, SIGNAL(clicked(bool)), this, SLOT(toggleRangeMode(bool)));
connect(this, SIGNAL(enableToolbar(bool)), d->m_buttonRange, SLOT(setEnabled(bool)));
connect(this, SIGNAL(rangeModeChanged(bool)), d->m_buttonRange, SLOT(setChecked(bool)));
d->m_buttonLock = new QToolButton;
d->m_buttonLock->setIcon(QIcon(QLatin1String(":/qmlprofiler/ico_selectionmode.png")));
d->m_buttonLock->setToolTip(tr("View event information on mouseover"));
d->m_buttonLock->setCheckable(true);
d->m_buttonLock->setChecked(false);
connect(d->m_buttonLock, SIGNAL(clicked(bool)), this, SLOT(toggleLockMode(bool)));
connect(this, SIGNAL(enableToolbar(bool)), d->m_buttonLock, SLOT(setEnabled(bool)));
connect(this, SIGNAL(lockModeChanged(bool)), d->m_buttonLock, SLOT(setChecked(bool)));
toolBarLayout->addWidget(buttonPrev);
toolBarLayout->addWidget(buttonNext);
toolBarLayout->addWidget(new Utils::StyledSeparator());
toolBarLayout->addWidget(buttonZoomControls);
toolBarLayout->addWidget(new Utils::StyledSeparator());
toolBarLayout->addWidget(d->m_buttonRange);
toolBarLayout->addWidget(d->m_buttonLock);
return bar;
}
示例12: QToolButton
QToolButton * KviWindow::createToolButton(QWidget * pPar, const char * pcName, KviIconManager::SmallIcon eIcon, const QString & szToolTip, bool bOn)
{
QToolButton * pTool = new QToolButton(pPar);
pTool->setObjectName(pcName);
pTool->setIcon(QIcon(*(g_pIconManager->getSmallIcon(eIcon))));
pTool->setAutoRaise(true);
pTool->setChecked(bOn);
KviTalToolTip::add(pTool, szToolTip);
return pTool;
}
示例13: SIGNAL
static QToolButton *createFilterButton(QIcon icon, const QString &toolTip,
QObject *receiver, const char *slot)
{
QToolButton *button = new QToolButton;
button->setIcon(icon);
button->setToolTip(toolTip);
button->setCheckable(true);
button->setChecked(true);
button->setAutoRaise(true);
button->setEnabled(true);
QObject::connect(button, SIGNAL(toggled(bool)), receiver, slot);
return button;
}
示例14: setOpen
void Task::setOpen(bool o) {
QToolButton *b = m_header->toggleButton();
if (b->isChecked() == o) {
b->setChecked(o);
if (b->arrowType()!=Qt::NoArrow) {
if (o) {
b->setArrowType(Qt::UpArrow);
} else {
b->setArrowType(Qt::DownArrow);
}
}
QwwTaskPanel *tp = parent() ? qobject_cast<QwwTaskPanel*>(parent()->parent()->parent()->parent()) : 0;
if(tp && tp->isAnimated()){
if (m_animator.state()!=QTimeLine::NotRunning) {
m_animator.setDirection(m_animator.direction()==QTimeLine::Forward ? QTimeLine::Backward : QTimeLine::Forward);
} else {
m_animBody = new QWidget;
m_animBody->installEventFilter(this);
#ifndef Q_WS_WIN
m_animBody->setEnabled(false);
#endif
m_animBody->setAttribute(Qt::WA_NoSystemBackground, true);
body()->ensurePolished();
QSize s = QLayout::closestAcceptableSize(body(), body()->sizeHint()).expandedTo(QSize(width(), 0));
body()->resize(s);
body()->setAttribute(Qt::WA_WState_ExplicitShowHide, true);
body()->setAttribute(Qt::WA_WState_Hidden, false);
m_animpix = QPixmap::grabWidget(body());
body()->setAttribute(Qt::WA_WState_Hidden, true);
if (o) {
m_animator.setDirection(QTimeLine::Forward);
m_animator.setFrameRange(0, s.height());
} else {
m_animator.setDirection(QTimeLine::Backward);
m_animator.setFrameRange(0, m_body->height());
}
m_body->hide();
QVBoxLayout *l = (QVBoxLayout*)layout();
l->addWidget(m_animBody);
m_animBody->show();
m_animator.start();
}
} else {
if(o)
m_body->show();
else
m_body->hide();
}
}
}
示例15: createWidget
Core::NavigationView FolderNavigationWidgetFactory::createWidget()
{
Core::NavigationView n;
FolderNavigationWidget *ptw = new FolderNavigationWidget;
n.widget = ptw;
QToolButton *toggleSync = new QToolButton;
toggleSync->setIcon(QIcon(QLatin1String(Core::Constants::ICON_LINK)));
toggleSync->setCheckable(true);
toggleSync->setChecked(ptw->autoSynchronization());
toggleSync->setToolTip(tr("Synchronize with Editor"));
connect(toggleSync, SIGNAL(clicked(bool)), ptw, SLOT(toggleAutoSynchronization()));
n.dockToolBarWidgets << toggleSync;
return n;
}