Esempio n. 1
0
int QProg::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: valueChanged((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 1: setValue((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 2: setMaxValue((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 3: setMinValue((*reinterpret_cast< double(*)>(_a[1]))); break;
        case 4: setFontDim((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 5: setPrecision((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 6: setBarColor((*reinterpret_cast< QColor(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 7;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< double*>(_v) = value(); break;
        case 1: *reinterpret_cast< double*>(_v) = minValue(); break;
        case 2: *reinterpret_cast< double*>(_v) = maxValue(); break;
        case 3: *reinterpret_cast< int*>(_v) = font(); break;
        case 4: *reinterpret_cast< int*>(_v) = numPrec(); break;
        case 5: *reinterpret_cast< QColor*>(_v) = color(); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setValue(*reinterpret_cast< double*>(_v)); break;
        case 1: setMinValue(*reinterpret_cast< double*>(_v)); break;
        case 2: setMaxValue(*reinterpret_cast< double*>(_v)); break;
        case 3: setFontDim(*reinterpret_cast< int*>(_v)); break;
        case 4: setPrecision(*reinterpret_cast< int*>(_v)); break;
        case 5: setBarColor(*reinterpret_cast< QColor*>(_v)); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 6;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Esempio n. 2
0
/**
 * Draw all the bars of the spectrum.
 * @param heights the heights of all the bars.
 */
static void drawBars(float heights[])
{
    glPushMatrix();
    glTranslatef(-2.0, 0.0, 0.0);

    glEnableClientState(GL_VERTEX_ARRAY);
    glEnableClientState(GL_NORMAL_ARRAY);

    float w = SPECTRUM_WIDTH / NB_BANDS;
    for (unsigned i = 0; i < NB_BANDS; ++i)
    {
        glPushMatrix();
        glScalef(1.0, heights[i], 1.0);
        setBarColor(heights[i]);
        drawBar();
        glPopMatrix();

        glTranslatef(w, 0.0, 0.0);
    }

    glDisableClientState(GL_VERTEX_ARRAY);
    glDisableClientState(GL_NORMAL_ARRAY);

    glPopMatrix();
}
Esempio n. 3
0
CSVDoc::Operation::Operation (int type, QWidget* parent) : mType (type), mStalling (false)
{
    /// \todo Add a cancel button or a pop up menu with a cancel item
    initWidgets();
    setBarColor( type);
    updateLabel();

    /// \todo assign different progress bar colours to allow the user to distinguish easily between operation types
}
Esempio n. 4
0
 void GLFW_App::create_tweakbar_from_component(const Component::Ptr &the_component)
 {
     if(!the_component) return;
     m_tweakBars.push_back(TwNewBar(the_component->getName().c_str()));
     setBarColor(glm::vec4(0, 0, 0, .5), m_tweakBars.back());
     setBarSize(glm::ivec2(250, 500));
     glm::ivec2 offset(10);
     setBarPosition(glm::ivec2(offset.x + 260 * (m_tweakBars.size() - 1), offset.y), m_tweakBars.back());
     addPropertyListToTweakBar(the_component->getPropertyList(), "", m_tweakBars.back());
 }
Esempio n. 5
0
void Progress::advance()
{
  if (value() == 0) {
    emit restart();
    return;
  }

  if (value() == 80)
    setBarColor("red1");

  KGameProgress::advance(-1);
}
Esempio n. 6
0
void Progress::rewind()
{
  setBarColor("green1");
  KGameProgress::setValue(300);
}
Esempio n. 7
0
Progress::Progress(QWidget *parent, const char *name)
	: KGameProgress(0, 300, 300, KGameProgress::Horizontal, parent, name)
{
  setBarColor("green1");
  setTextEnabled(false);
}