Esempio n. 1
0
void PatVerticalTabWidget::refreshIcons()
{
  for(int i = 0; i < m_buttonGroup->buttons().size(); i++)
  {
    // TODO "done" not handled
    //imagePath = m_donePixmaps[i]; 

    QAbstractButton * button = m_buttonGroup->button(i);
  
    QString imagePath;
    if(button->isEnabled() && button->isChecked()){
      imagePath = m_selectedPixmaps[i];
    }
    else if(button->isEnabled() && !button->isChecked()){
      imagePath = m_unSelectedPixmaps[i];
    }
    else if(!button->isEnabled() && button->isChecked()){
      imagePath = m_selectedPixmaps[i];
    }
    else if(!button->isEnabled() && !button->isChecked()){
      imagePath = m_disabledPixmaps[i];
    }
    else{
      // you should not be here
      OS_ASSERT(false);
    }

    QString style;
    style.append("QPushButton { background-color: blue; background-image: url(\"");
    style.append(imagePath);
    style.append("\"); border: none; background-repeat: 0; }");

    button->setStyleSheet(style);
  }
}
bool GTUtilsMSAEditorSequenceArea::collapsingMode(HI::GUITestOpStatus &os){
    QAbstractButton* collapce = GTAction::button(os, "Enable collapsing");
    bool nameLists = getVisibleNames(os)==getNameList(os);
    if(nameLists && !collapce->isChecked()){
        return false;
    }else if (!nameLists && collapce->isChecked()) {
        return true;
    }else{
        GT_CHECK_RESULT(false, "somithing wrong with collapsing mode", false);
    }
}
Esempio n. 3
0
    virtual dyn_t getGuiValue(void){

      QAbstractButton *button = dynamic_cast<QAbstractButton*>(_widget);
      if (button!=NULL)
        return DYN_create_bool(button->isChecked());

      QAbstractSlider *slider = dynamic_cast<QAbstractSlider*>(_widget);
      if (slider!=NULL)
        return DYN_create_int(slider->value());

      QLabel *label = dynamic_cast<QLabel*>(_widget);
      if (label!=NULL)
        return DYN_create_string(label->text());

      QLineEdit *line_edit = dynamic_cast<QLineEdit*>(_widget);
      if (line_edit!=NULL)
        return DYN_create_string(line_edit->text());

      QTextEdit *text_edit = dynamic_cast<QTextEdit*>(_widget);
      if (text_edit!=NULL)
        return DYN_create_string(text_edit->toPlainText());

      QSpinBox *spinbox = dynamic_cast<QSpinBox*>(_widget);
      if (spinbox!=NULL)
        return DYN_create_int(spinbox->value());

      QDoubleSpinBox *doublespinbox = dynamic_cast<QDoubleSpinBox*>(_widget);
      if (doublespinbox!=NULL)
        return DYN_create_float(doublespinbox->value());
      
                  
      handleError("Gui #%d does not have a getValue method", _gui_num);
      return DYN_create_bool(false);
    }
Esempio n. 4
0
void vrpn_Qt::AddWidget(QWidget* widget) {
    // Ignore widgets called vrpn_Qt_ignore
    if (widget->objectName() == "vrpn_Qt_ignore") {
        return;
    }


    // Check if widget is derived from abstract button
    if (qobject_cast<QAbstractButton*>(widget)) {
        QAbstractButton* button = qobject_cast<QAbstractButton*>(widget);

        connect(button, SIGNAL(pressed()), this, SLOT(ButtonChanged()));
        connect(button, SIGNAL(released()), this, SLOT(ButtonChanged()));

        buttonWidgets.append(button);
        buttons[num_buttons] = button->isChecked();
        num_buttons++;
    }
    // Check if widget is derived from abstract slider
    else if (qobject_cast<QAbstractSlider*>(widget)) {
        QAbstractSlider* slider = qobject_cast<QAbstractSlider*>(widget);

        connect(slider, SIGNAL(valueChanged(int)), this, SLOT(AnalogChanged()));

        analogWidgets.append(slider);
        channel[num_channel] = slider->value();
        num_channel++;
    }
    // Check for double spin box
    else if (qobject_cast<QDoubleSpinBox*>(widget)) {
Esempio n. 5
0
QAccessible::State QAccessibleButton::state() const
{
    QAccessible::State state = QAccessibleWidget::state();

    QAbstractButton *b = button();
    QCheckBox *cb = qobject_cast<QCheckBox *>(b);
    if (b->isCheckable())
        state.checkable = true;
    if (b->isChecked())
        state.checked = true;
    else if (cb && cb->checkState() == Qt::PartiallyChecked)
        state.checkStateMixed = true;
    if (b->isDown())
        state.pressed = true;
    QPushButton *pb = qobject_cast<QPushButton*>(b);
    if (pb) {
        if (pb->isDefault())
            state.defaultButton = true;
#ifndef QT_NO_MENU
        if (pb->menu())
            state.hasPopup = true;
#endif
    }

    return state;
}
Esempio n. 6
0
int egx_button_checked_(egx_wnd_t hwnd)
{
	QAbstractButton *button = (QAbstractButton*)hwnd;
	if(!button){
		return -1;
	}
	return button->isChecked();
}
Esempio n. 7
0
bool GTUtilsCv::cvBtn::isChecked(HI::GUITestOpStatus &os, ADVSingleSequenceWidget *seqWidget) {
    QAbstractButton *cvButton = getCvButton(os, seqWidget, true /* CV button must exist */ );

    CHECK_OP_SET_ERR_RESULT(os, "Error getting CV button!", false);
    SAFE_POINT(NULL != cvButton, "cvButton is NULL!", false);

    CHECK_SET_ERR_RESULT(cvButton->isCheckable(), "CV button is not checkable!", false);

    return cvButton->isChecked();
}
Esempio n. 8
0
void ScrollableButtons::scrollToSelected()
{
  QAbstractButton *selectedButton = 0;
  QListIterator<QAbstractButton *> button(buttonGroup->buttons());

  while (button.hasNext())
  {
    QAbstractButton *buttonItem = button.next();

    if (buttonItem->isChecked())
      selectedButton = buttonItem;
  }

  if (selectedButton)
    scrollToButton(selectedButton);
}
Esempio n. 9
0
/*!
  When one of the 6 coordinate check boxes is clicked, this checks to see
  how many are already selected.  It only allows a box to be checked if there
  are fewer than 3 boxes already checked.  If there are 3 checked, the OK
  button is enabled, otherwise it is disabled.  \a whichFixed keeps track of
  the indexes of the currently selected check boxes.
*/
void GWSProjDlg::coordBoxClicked(int buttonNum)
{
  QAbstractButton *b = coordButtonGroup->button(buttonNum);
  if (b->isChecked()) {
    if (whichFixed.size() < 3) {
      whichFixed.insert(buttonNum);
      if (whichFixed.size() == 3) { OKButton->setEnabled(true); }
    }
    else {
      b->toggle();
    }
  }
  else {
    whichFixed.erase(buttonNum);
    OKButton->setEnabled(false);
  }
}
Esempio n. 10
0
void PatVerticalTabWidget::setCurrentIndex(int index)
{
  int yPos = 25;
  
  for(int i = 0; i < m_buttonGroup->buttons().size(); i++)
  {
    QAbstractButton * button = m_buttonGroup->button(i);

    button->move(0,yPos);

    yPos += button->height();

    // Ignore clicks to the already active tab
    if(button->isEnabled() && button->isChecked() && currentIndex != index){
      currentIndex = index;
      emit tabSelected(i);
    }
  }
  QTimer::singleShot(0, this, SLOT(refreshIcons()));
}
Esempio n. 11
0
void
dmz::MBRAPluginNACalculate::_slot_weight_by_clicked (int id) {

   ObjectModule *objMod = get_object_module ();

   if (objMod && _simulatorHandle) {

      const Handle AttrHandle (id);
      
      QAbstractButton *button = _weightByGroup.button (id);
      
      if (button) {
         
         Boolean value = button->isChecked ();
         _ignoreUpdates = True;
         objMod->store_flag (_simulatorHandle, AttrHandle, value);
         _ignoreUpdates = False;
      }
   }
}
Esempio n. 12
0
/*! \reimp */
QAccessible::State QAccessibleButton::state(int child) const
{
    State state = QAccessibleWidgetEx::state(child);

    QAbstractButton *b = button();
    QCheckBox *cb = qobject_cast<QCheckBox *>(b);
    if (b->isChecked())
        state |= Checked;
    else if (cb && cb->checkState() == Qt::PartiallyChecked)
        state |= Mixed;
    if (b->isDown())
        state |= Pressed;
    QPushButton *pb = qobject_cast<QPushButton*>(b);
    if (pb) {
        if (pb->isDefault())
            state |= DefaultButton;
#ifndef QT_NO_MENU
        if (pb->menu())
            state |= HasPopup;
#endif
    }

    return state;
}
Esempio n. 13
0
void JalousieEinstellungen::on_pushButton_JalOK_clicked()
{
    QString sendString;
    QString tmpString;
    for(int i = 0; i < 8; i++)
    {
        sendString  = QString("cmd=%1 value=%2key=%3\n").arg(CMD_SET_CONFIG);
        tmpString  = QString("%1%2");
        if(confWidgetsJal[i].isBool)
        {
            QAbstractButton *foo = (QAbstractButton*)confWidgetsJal[i].object;
            if(foo->isChecked() != confWidgetsJal[i].boolValue)
            {
                sendString = QString(sendString).arg(foo->isChecked()).arg(confWidgetsJal[i].section + ":" + confWidgetsJal[i].key);
                tcpClient->write(sendString.toLatin1());
                confWidgetsJal[i].boolValue = foo->isChecked();
            }
        }else if(confWidgetsJal[i].isTime)
        {
            QSpinBox *spinBox_Offset = confWidgetsJal[i].object->findChild<QSpinBox *>();
            QTimeEdit *timeEdit_Uhrzeit = confWidgetsJal[i].object->findChild<QTimeEdit *>();
            QList<QRadioButton *> listRadioButton = confWidgetsJal[i].object->findChildren<QRadioButton *>();
            for(int k = 0; k < 3; k++)
            {
                if(listRadioButton[k]->objectName().contains("Uhrzeit") && listRadioButton[k]->isChecked())
                {
                    tmpString = timeEdit_Uhrzeit->time().toString("hh:mm");
                    break;
                }
            }
            for(int k = 0; k < 3; k++)
            {
                if(listRadioButton[k]->objectName().contains("SA") && listRadioButton[k]->isChecked())
                {
                    if(spinBox_Offset->value() > -1)
                    {
                        tmpString = QString(tmpString).arg("SA+").arg(spinBox_Offset->value());
                    }else{
                        tmpString = QString(tmpString).arg("SA").arg(spinBox_Offset->value());
                    }
                    break;
                }
            }
            for(int k = 0; k < 3; k++)
            {
                if(listRadioButton[k]->objectName().contains("SU") && listRadioButton[k]->isChecked())
                {
                    if(spinBox_Offset->value() > -1)
                    {
                        tmpString = QString(tmpString).arg("SU+").arg(spinBox_Offset->value());
                    }else{
                        tmpString = QString(tmpString).arg("SU").arg(spinBox_Offset->value());
                    }
                    break;
                }
            }
            if(confWidgetsJal[i].strValue != tmpString)
            {
                confWidgetsJal[i].strValue = tmpString;
                sendString = QString(sendString).arg(tmpString).arg(confWidgetsJal[i].section + ":" + confWidgetsJal[i].key);
                tcpClient->write(sendString.toLatin1());
            }
        }
    }
    this->close();
}
Esempio n. 14
0
void ClsQNeuronStateVariableDisplay::slotStateVariables(int ii){
#ifdef DEBUG_CLSQSTATEVARIABLEDISPLAY
    cout << "void ClsQNeuronStateVariableDisplay::slotStateVariables(int ii)" << endl;
#endif

    /*
    cout << "qbtngrpStateVariables->exclusive ( ): " << qbtngrpStateVariables->exclusive ( ) << endl;
    cout << "iCurrentStateButton: " << iCurrentStateButton << endl;
    cout << "ii: " << ii << endl;
    */

    QAbstractButton *btn = qbtngrpStateVariables->button ( ii );
    if(btn==NULL){
	return;
    } 
   

    if(qchkbxLiveData->isOn() && ii != iCurrentStateButton){
	if(btn->isChecked()){
	    //cout << "send request: " << btn->text().latin1() << endl;
	    /* send request */
	    string strSinkID = btn->text().latin1() + strID;

	    clsFEDataClient->addDataSink(strSinkID, clsFEGroup, btn->text().latin1(), strSelectedIndices);

	    QColor qc;
	    qc.setHsv(clsFEDataClient->getDataSinkColor(strSinkID), 255, 210);
	    QPalette palette = (btn)->palette();
	    palette.setColor ( QColorGroup::Foreground, qc );
	    (btn)->setPalette(palette);
	    if(bAverage){
		clsFEDataClient->setSinkMath(strSinkID, ClsFEDataSink::MATH_AVERAGE);
	    }

	    if(qbtngrpStateVariables->exclusive( ) && iCurrentStateButton >= 0){
		/* cancel rewquest of the last active checkbox (iCurrentStateButton) */
		QAbstractButton *btnCurrent =  qbtngrpStateVariables->button (iCurrentStateButton);
		
		if(btnCurrent!=NULL){
		    // cout << "cancel request: " << btnCurrent->text().latin1() << endl;
		    string strSinkID = btnCurrent->text().latin1() + strID;
		    clsFEDataClient->removeDataSink(strSinkID);
		    QColor qc;
		    qc.setRgb(0,0,0);

		    QPalette palette = btnCurrent->palette();
		    palette.setColor ( QColorGroup::Foreground, qc );
		    btnCurrent->setPalette(palette);
		}
	    }
	} else {
	    /* cancel request */
	    // cout << "cancel request: " << btn->text().latin1() << endl;
	    string strSinkID = btn->text().latin1() + strID;
	    clsFEDataClient->removeDataSink(strSinkID);
	    QColor qc;
	    qc.setRgb(0,0,0);
	    QPalette palette = (btn)->palette();
	    palette.setColor ( QColorGroup::Foreground, qc );
	    (btn)->setPalette(palette);
	}
    } 
    if(qbtngrpStateVariables->exclusive ( )){
	iCurrentStateButton = ii;
    }
};