コード例 #1
0
ファイル: formjqgzcs.cpp プロジェクト: httpftpli/mdimh
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
0
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
0
ファイル: formxtcs.cpp プロジェクト: httpftpli/mdimh
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
0
ファイル: TagWidget.cpp プロジェクト: Aang/vlmc
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
0
ファイル: mainwindow.cpp プロジェクト: ttendohv/GuessWho17B
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
0
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
0
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
0
ファイル: mainwindow.cpp プロジェクト: n0ran/BunnyMapRedactor
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
0
ファイル: chimerymainwin.cpp プロジェクト: djcapelis/chimery
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);
    }