コード例 #1
0
void DeclarativeProgressBar::setMaximum(int maximum)
{
	STYLE_OPTION(QStyleOptionProgressBarV2);
	option->maximum = maximum;
	emit maximumChanged(maximum);
	update();
}
コード例 #2
0
ファイル: scene.cpp プロジェクト: axelerator/adgr
/*!
    \fn Scene::createCausticsMap()
 */
void Scene::createCausticsMap()
{
  const long PHOTON_COUNT = settings.getCausticsPhotonCount();
  double colorSum = 0;
  currentProgress = 0;
  emit maximumChanged(PHOTON_COUNT/100);
  for (int i=0; i < lights.size(); ++i ) {
    colorSum += lights[i]->getAverageColor();
  }
  if (causticsMap != 0) {
    delete causticsMap;
  }
  causticsMap = new PhotonMap(PHOTON_COUNT);
  emmissionTarget = causticsMap;

  for (int i=0; i < lights.size(); ++i ) {
    long currPhotonCount = (int)(PHOTON_COUNT * ( lights[i]->getAverageColor() / colorSum));
    connect(lights[i], SIGNAL(photonEmitted()), this, SLOT(progress()));
    lights[i]->emitCausticPhotons(currPhotonCount);
    causticsMap->scale_photon_power(1.0/currPhotonCount);
    disconnect(lights[i]);
  }

  causticsMap->balance();
  causticsMap->generateVertexArray(settings.getCausticsPhotonCount() / lights.size());
}
コード例 #3
0
void QRangeModel::setRange(qreal min, qreal max)
{
    Q_D(QRangeModel);

    bool emitMinimumChanged = !qFuzzyCompare(min, d->minimum);
    bool emitMaximumChanged = !qFuzzyCompare(max, d->maximum);

    if (!(emitMinimumChanged || emitMaximumChanged))
        return;

    const qreal oldValue = value();
    const qreal oldPosition = position();

    d->minimum = min;
    d->maximum = qMax(min, max);

    // Update internal position if it was changed. It can occurs if internal value changes, due to range update
    d->pos = d->equivalentPosition(d->value);

    if (emitMinimumChanged)
        emit minimumChanged(d->minimum);
    if (emitMaximumChanged)
        emit maximumChanged(d->maximum);

    d->emitValueAndPositionIfChanged(oldValue, oldPosition);
}
コード例 #4
0
ファイル: scene.cpp プロジェクト: axelerator/adgr
void Scene::renderMap() {
  viewportCam.renderMap(settings.getWidth(), settings.getHeight());

  emit maximumChanged(100);
  connect(&viewportCam, SIGNAL(progressChanged(int)), this, SLOT(updateRendering(int )));
  connect(&viewportCam, SIGNAL(done(const LayeredImage&)), this, SLOT(emitRenderingMapDone(const LayeredImage&)));
}
コード例 #5
0
void QRealProperty::setMaximum(qreal maximum)
{
    if (qSafeFuzzyCompare(_maximum, maximum))
    {
        _maximum = maximum;
        emit maximumChanged();
    }
}
コード例 #6
0
void QDeclarativeNdefFilter::setMaximum(int value)
{
    if (m_maximum == value)
        return;

    m_maximum = value;
    emit maximumChanged();
}
コード例 #7
0
void PanelSuperList::on_pushButtonMaximum_pressed() {
    DialogSetMaximum dialog(list()->getModel(), m_maximum);
    if (dialog.exec() == QDialog::Accepted) {
        int newSize = dialog.maximum();
        list()->setMaximum(newSize);
        emit maximumChanged();
    }
}
コード例 #8
0
void QQuickDragAxis::setMaximum(qreal maximum)
{
    if (m_maximum == maximum)
        return;

    m_maximum = maximum;
    emit maximumChanged();
}
コード例 #9
0
/*!
    \qmlproperty real Ratings::maximum

    This property holds the maximum rating value.
*/
void QDeclarativeRatings::setMaximum(qreal max)
{
    if (m_ratings.maximum() == max)
        return;

    m_ratings.setMaximum(max);
    emit maximumChanged();
}
コード例 #10
0
ファイル: kscrollbar.cpp プロジェクト: kxtry/kxfw
/*!
  Sets the maximum value of the scrollbar to the given \a maximum.
  \sa maximum()
 */
void KScrollBar::setMaximum(qreal maximum)
{
    if (maximum != m_maximum) 
	{
        m_maximum = maximum;
        emit maximumChanged(maximum);
        setValue(m_value);
		updateSlider();
    }
}
コード例 #11
0
ファイル: scene.cpp プロジェクト: axelerator/adgr
/*!
    \fn Scene::render(RenderArea *canvas)
 */
void Scene::render() {
  for (int i = 0; i < lights.size(); ++i) {
      Light *l = (lights.at(i));
      l->setSampleCount(settings.getAreaLightResolution());
  }
  viewportCam.render(settings.getWidth(), settings.getHeight());

  emit maximumChanged(100);
  connect(&viewportCam, SIGNAL(progressChanged(int)), this, SLOT(updateRendering(int )));
  connect(&viewportCam, SIGNAL(done(const LayeredImage&)), this, SLOT(emitRenderingDone(const LayeredImage&)));
}
コード例 #12
0
ファイル: qstyleitem.cpp プロジェクト: kbenne/Sandbox
QStyleItem::QStyleItem(QQuickPaintedItem *parent)
    : QQuickPaintedItem(parent),
    m_styleoption(0),
    m_itemType(Undefined),
    m_sunken(false),
    m_raised(false),
    m_active(true),
    m_selected(false),
    m_focus(false),
    m_hover(false),
    m_on(false),
    m_horizontal(true),
    m_sharedWidget(false),
    m_minimum(0),
    m_maximum(100),
    m_value(0),
    m_step(0),
    m_paintMargins(0),
    m_contentWidth(0),
    m_contentHeight(0)

{
    if (!qApp->style()) {
        qWarning("\nError: No widget style available. \n\nQt Desktop Components "
               "currently depend on the widget module to function. \n"
               "Use QApplication when creating standalone executables.\n\n");
        exit(-1);
    }
    m_font = qApp->font();
    setFlag(QQuickItem::ItemHasContents, true);
    setSmooth(false);

    connect(this, SIGNAL(enabledChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(infoChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(onChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(selectedChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(textChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(raisedChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(sunkenChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(hoverChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(maximumChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(minimumChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(valueChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(horizontalChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeControlChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(hasFocusChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeControlChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(elementTypeChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(textChanged()), this, SLOT(updateSizeHint()));
    connect(this, SIGNAL(contentWidthChanged(int)), this, SLOT(updateSizeHint()));
    connect(this, SIGNAL(contentHeightChanged(int)), this, SLOT(updateSizeHint()));
}
コード例 #13
0
void CLSValueSetpointEditor::setMaximum(double newMax)
{
	if (maximum_ != newMax || !maximumSet_) {
		maximumSet_ = true;
		maximum_ = newMax;

		emit maximumChanged(maximum_);
	}

	updateInputStatus();
}
コード例 #14
0
void Importer::start(const KUrl::List& list, const KUrl& destination)
{
    d->mUrlList = list;
    d->mImportedUrlList.clear();
    d->mSkippedUrlList.clear();
    d->mRenamedCount = 0;
    d->mProgress = 0;
    d->mJobProgress = 0;

    emitProgressChanged();
    maximumChanged(d->mUrlList.count() * 100);

    if (!d->createImportDir(destination)) {
        kWarning() << "Could not create import dir";
        return;
    }
    d->importNext();
}
コード例 #15
0
QStyleItem::QStyleItem(QDeclarativeItem *parent)
    : QDeclarativeItem(parent),
    m_dummywidget(0),
    m_styleoption(0),
    m_type(Undefined),
    m_sunken(false),
    m_raised(false),
    m_active(true),
    m_selected(false),
    m_focus(false),
    m_on(false),
    m_horizontal(true),
    m_sharedWidget(false),
    m_minimum(0),
    m_maximum(100),
    m_value(0),
    m_paintMargins(0)
{
    setFlag(QGraphicsItem::ItemHasNoContents, false);
    setCacheMode(QGraphicsItem::DeviceCoordinateCache);
    setSmooth(true);

    connect(this, SIGNAL(infoChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(onChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(selectedChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(textChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(raisedChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(sunkenChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(hoverChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(maximumChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(minimumChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(valueChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(horizontalChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeControlChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(focusChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(activeControlChanged()), this, SLOT(updateItem()));
    connect(this, SIGNAL(elementTypeChanged()), this, SLOT(updateItem()));
}
コード例 #16
0
void TTKCircleProgressWidget::setMaximum(int maximum)
{
    if(maximum < 0)
    {
        maximum = 0;
    }

    if(m_maximum != maximum)
    {
        m_maximum = maximum;
        update();
        emit maximumChanged(maximum);

        if(m_maximum == 0)
        {
            m_infiniteAnimation->start();
        }
        else
        {
            m_infiniteAnimation->stop();
        }
    }
}
コード例 #17
0
void VideoJobManager::slotMaximum(int value)
{
		emit maximumChanged(value);
}
コード例 #18
0
int QRangeModel::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: valueChanged((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        case 1: positionChanged((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        case 2: stepSizeChanged((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        case 3: invertedChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 4: minimumChanged((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        case 5: maximumChanged((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        case 6: positionAtMinimumChanged((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        case 7: positionAtMaximumChanged((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        case 8: toMinimum(); break;
        case 9: toMaximum(); break;
        case 10: setValue((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        case 11: setPosition((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        case 12: { qreal _r = valueForPosition((*reinterpret_cast< qreal(*)>(_a[1])));
            if (_a[0]) *reinterpret_cast< qreal*>(_a[0]) = _r; }  break;
        case 13: { qreal _r = positionForValue((*reinterpret_cast< qreal(*)>(_a[1])));
            if (_a[0]) *reinterpret_cast< qreal*>(_a[0]) = _r; }  break;
        default: ;
        }
        _id -= 14;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< qreal*>(_v) = value(); break;
        case 1: *reinterpret_cast< qreal*>(_v) = minimum(); break;
        case 2: *reinterpret_cast< qreal*>(_v) = maximum(); break;
        case 3: *reinterpret_cast< qreal*>(_v) = stepSize(); break;
        case 4: *reinterpret_cast< qreal*>(_v) = position(); break;
        case 5: *reinterpret_cast< qreal*>(_v) = positionAtMinimum(); break;
        case 6: *reinterpret_cast< qreal*>(_v) = positionAtMaximum(); break;
        case 7: *reinterpret_cast< bool*>(_v) = inverted(); break;
        }
        _id -= 8;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setValue(*reinterpret_cast< qreal*>(_v)); break;
        case 1: setMinimum(*reinterpret_cast< qreal*>(_v)); break;
        case 2: setMaximum(*reinterpret_cast< qreal*>(_v)); break;
        case 3: setStepSize(*reinterpret_cast< qreal*>(_v)); break;
        case 4: setPosition(*reinterpret_cast< qreal*>(_v)); break;
        case 5: setPositionAtMinimum(*reinterpret_cast< qreal*>(_v)); break;
        case 6: setPositionAtMaximum(*reinterpret_cast< qreal*>(_v)); break;
        case 7: setInverted(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 8;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 8;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 8;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}