本文整理汇总了C++中QPushButton::isChecked方法的典型用法代码示例。如果您正苦于以下问题:C++ QPushButton::isChecked方法的具体用法?C++ QPushButton::isChecked怎么用?C++ QPushButton::isChecked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPushButton
的用法示例。
在下文中一共展示了QPushButton::isChecked方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: valeChanged
void FormJqgzcs::valeChanged(QWidget *obj){
QSpinBox *spinbox = qobject_cast<QSpinBox *>(obj);
if(spinbox){
int val = spinbox->value();
int index = spinbox->property("index").toInt();
param->setData(QParam::SpaItemHd_Jqgzcs,index,val);
if(14==index)
pcomm->yajiaoTest(Md::POSFRONT,4,val);
if(15==index)
pcomm->yajiaoTest(Md::POSREAR,4,val);
return;
}
QDoubleSpinBox *doublespinbox = qobject_cast<QDoubleSpinBox *>(obj);
if(doublespinbox){
int val =doublespinbox->value()*10;
int index = doublespinbox->property("index").toInt();
param->setData(QParam::SpaItemHd_Jqgzcs,index,val);
return;
}
QPushButton *pushbutton = qobject_cast<QPushButton *>(obj);
if(pushbutton){
int val =pushbutton->isChecked();
int index = pushbutton->property("index").toInt();
param->setData(QParam::SpaItemHd_Jqgzcs,index,val);
return;
}
}
示例2: doConversion
void FormConversion::doConversion() {
int currentMode = conversionStack->currentIndex();
QList<conversionData*> dataList = *(modeList->at(currentMode))->dataList;
bool newButtonFound = false;
for (int c = 0; c < dataList.count(); c++) {
QPushButton *b = (*(dataList.at(c))).button;
if (b->isChecked()) {
if (b == currentButton) {
b->toggle();
} else {
newButton = b;
newFactor = (*(dataList.at(c))).factor;
newButtonFound = true;
}
}
}
if (newButtonFound) {
if (currentButton) { // temp convert ignores these anyway
UnitConversionInstruction::from = currentFactor;
UnitConversionInstruction::to = newFactor;
systemEngine->pushInstruction("UnitConversion");
}
currentButton = newButton;
currentFactor = newFactor;
} else { // current button toggled off
currentButton = 0;
}
}
示例3: valeChanged
void FormXtcs::valeChanged(QWidget *obj){
QSpinBox *spinbox = qobject_cast<QSpinBox *>(obj);
if(spinbox){
int val = spinbox->value();
int index = spinbox->property("index").toInt();
param->setData(QParam::SpaItemHd_Xtcs,index,val,FALSE);
if((index == 11)||(index ==12))
param->updataPivotal();
if(14==index)
pcomm->yajiaoTest(Md::POSFRONT,3,val); //shengke buchang
if(15==index)
pcomm->yajiaoTest(Md::POSREAR,3,val); //shengke buchang
return;
}
QDoubleSpinBox *doublespinbox = qobject_cast<QDoubleSpinBox *>(obj);
if(doublespinbox){
int val =qRound(doublespinbox->value()*10);
int index = doublespinbox->property("index").toInt();
param->setData(QParam::SpaItemHd_Xtcs,index,val,FALSE);
if(index==5)
param->updataPivotal();
return;
}
QPushButton *pushbutton = qobject_cast<QPushButton *>(obj);
if(pushbutton){
int val =pushbutton->isChecked();
int index = pushbutton->property("index").toInt();
param->setData(QParam::SpaItemHd_Xtcs,index,val,FALSE);
return;
}
}
示例4: if
void TagWidget:: buttonTagClicked()
{
if ( m_currentMedia != NULL )
{
QStringList tagList = m_currentMedia->metaTags();
for (int i = 0; i < m_buttonList.count(); i++)
{
QPushButton* button = static_cast<QPushButton*>(m_buttonList[i]);
if ( button->isChecked() && !tagList.contains( button->text() ) )
tagList << button->text();
else if ( !button->isChecked() && tagList.contains( button->text() ) )
tagList.removeAll( button->text() );
}
m_currentMedia->setMetaTags( tagList );
setTagTextEdit();
}
}
示例5: characterButtonClicked
void MainWindow::characterButtonClicked() {
// Black out the character button if clicked
QPushButton* clickedButton = (QPushButton*)(sender());
//if (clickedButton->isEnabled())
// clickedButton->setEnabled(false);
if(clickedButton->isChecked())
clickedButton->setChecked(true);
else
clickedButton->setChecked(false);
//clickedButton->setEnabled(true);
}
示例6: selectType
void FormConversion::selectType(int i) {
UnitConversionInstruction::tempFrom = UnitConversionInstruction::tempTo = 'n';
int currentMode = conversionStack->currentIndex();
QList<conversionData*> dataList = *(modeList->at(currentMode))->dataList;
for (int c = 0; c < dataList.count(); c++) {
QPushButton *b = (*(dataList.at(c))).button;
if (b->isChecked())
b->toggle();
}
currentButton = 0;
conversionStack->setCurrentIndex(i);
}
示例7: slotSetZone
void WorldTime::slotSetZone()
{
QPushButton *sendButton = qobject_cast<QPushButton *>(sender());
if(! sendButton->isChecked()) {
sendButton->setChecked(true);
return;
}
int selButton = findCurrentButton();
QTimeZone zone( strCityTz[selButton].toLocal8Bit());
frmMap->setZone(zone);
editMode();
changed = true;
frmMap->selectNewZone();
setButtonAvailable(selButton);
listTimes.at( selButton )->setZone( zone.id());
}
示例8: labelClicked
void MainWindow::labelClicked( QWidget * wdg )
{
QPushButton * button = dynamic_cast<QPushButton*>( wdg );
if( tool_action == nothing )
{
button->setChecked( false );
return;
}
if( button->isChecked() )
{
if( LastChecked )
LastChecked->setChecked( false );
LastChecked = button;
curItemIndex = plst.GetButtonIndex( button );
ui->Number->setText( QString::number( plst.getItem( curItemIndex )->index ) );
}
CCell * item = plst.getItem( curItemIndex );
ToolAction( item );
item->UpdateView();
UpdateControls();
}
示例9: cyc
void ChimeryMainWindow::cyc()
{
// Get info
cycs = cycNum->value();
QGridLayout * lay = (QGridLayout *) centralWidget()->layout();
// Delete all times in list (we recompute them in this loop)
while(!times->isEmpty())
delete times->takeFirst();
// Init stuff
if(gogogo)
{
delete gogogo;
gogogo = NULL;
}
if(gapL)
{
delete gapL;
gapL = NULL;
}
int cycle;
QDateTime Tstart = QDateTime(QDate::currentDate(), cycStart->time());
QDateTime Tend = QDateTime(Tstart);
QDateTime * insert;
QLinkedList<QPushButton *> * cycButtons_old = cycButtons;
QLinkedList<QPushButton *> * cycButtons_new = new QLinkedList<QPushButton *>();
QLinkedList<QSpinBox *> * cycGaps_old = cycGaps;
QLinkedList<QSpinBox *> * cycGaps_new = new QLinkedList<QSpinBox *>();
QPushButton * cycB;
QSpinBox * cycGap;
// Build widgets for cycles
for(cycle = 0; cycle < cycs; cycle++)
{
if(!cycGaps_old->isEmpty() && cycle < (cycs - 1))
{
cycGap = cycGaps_old->takeFirst();
cycGaps_new->append(cycGap);
}
else if(cycle < (cycs - 1))
{
cycGap = new QSpinBox(centralWidget());
cycGap->setRange(5, 90);
cycGap->setValue(20);
cycGap->setSingleStep(5);
lay->addWidget(cycGap, 2+cycle, 2);
QObject::connect(cycGap, SIGNAL(valueChanged(int)), this, SLOT(cyc()), Qt::QueuedConnection);
cycGaps_new->append(cycGap);
}
Tend = Tstart.addSecs(cycDur->value() * 60);
if(!cycButtons_old->isEmpty())
{
cycB = cycButtons_old->takeFirst();
cycB->setText(Tstart.toString("hh:mm") + "-" + Tend.toString("hh:mm"));
cycButtons_new->append(cycB);
}
else
{
cycB = new QPushButton(Tstart.toString("hh:mm") + "-" + Tend.toString("hh:mm"), centralWidget());
cycB->setCheckable(true);
cycB->setChecked(true);
lay->addWidget(cycB, 2+cycle, 0);
QObject::connect(cycB, SIGNAL(clicked()), this, SLOT(cyc()), Qt::QueuedConnection);
cycButtons_new->append(cycB);
}
if(cycle == 0 && cycs > 1)
{
gapL = new QLabel("Gap:", centralWidget());
lay->addWidget(gapL, 2, 1, Qt::AlignRight);
}
if(cycB->isChecked())
{
insert = new QDateTime(Tstart);
times->append(insert);
insert = new QDateTime(Tend);
times->append(insert);
}
if(cycle < cycs - 1)
Tstart = Tstart.addSecs((cycDur->value() + cycGap->value()) * 60);
}