Exemple #1
0
void Highlight::setItem(QQuickItem *item)
{
    if (m_item)
        m_item->disconnect(this);

    if (item) {
        connect(item, SIGNAL(xChanged()), SLOT(adjust()));
        connect(item, SIGNAL(yChanged()), SLOT(adjust()));
        connect(item, SIGNAL(widthChanged()), SLOT(adjust()));
        connect(item, SIGNAL(heightChanged()), SLOT(adjust()));
        connect(item, SIGNAL(rotationChanged()), SLOT(adjust()));
        connect(item, SIGNAL(transformOriginChanged(TransformOrigin)),
                SLOT(adjust()));
    }
    QQuickWindow *view = item->window();
    QQuickItem * contentItem = view->contentItem();
    if (contentItem) {
        connect(contentItem, SIGNAL(xChanged()), SLOT(adjust()));
        connect(contentItem, SIGNAL(yChanged()), SLOT(adjust()));
        connect(contentItem, SIGNAL(widthChanged()), SLOT(adjust()));
        connect(contentItem, SIGNAL(heightChanged()), SLOT(adjust()));
        connect(contentItem, SIGNAL(rotationChanged()), SLOT(adjust()));
        connect(contentItem, SIGNAL(transformOriginChanged(TransformOrigin)),
                SLOT(adjust()));
    }
    m_item = item;
    setContentsSize(view->size());
    adjust();
}
void S60VideoPlayerSession::setVideoRenderer(QObject *videoOutput)
{
    DP0("S60VideoPlayerSession::setVideoRenderer +++");
    if (videoOutput != m_videoOutputControl) {
        if (m_videoOutputDisplay) {
            disconnect(m_videoOutputDisplay);
            m_videoOutputDisplay->disconnect(this);
            m_videoOutputDisplay = 0;
        }
        if (videoOutput) {
            if (S60VideoWidgetControl *control = qobject_cast<S60VideoWidgetControl *>(videoOutput))
                m_videoOutputDisplay = control->display();
            if (!m_videoOutputDisplay)
                return;
            m_videoOutputDisplay->setNativeSize(m_nativeSize);
            connect(this, SIGNAL(nativeSizeChanged(QSize)), m_videoOutputDisplay, SLOT(setNativeSize(QSize)));
            connect(m_videoOutputDisplay, SIGNAL(windowHandleChanged(RWindow *)), this, SLOT(windowHandleChanged()));
            connect(m_videoOutputDisplay, SIGNAL(displayRectChanged(QRect, QRect)), this, SLOT(displayRectChanged()));
            connect(m_videoOutputDisplay, SIGNAL(aspectRatioModeChanged(Qt::AspectRatioMode)), this, SLOT(aspectRatioChanged()));
            connect(m_videoOutputDisplay, SIGNAL(rotationChanged(qreal)), this, SLOT(rotationChanged()));
#ifndef VIDEOOUTPUT_GRAPHICS_SURFACES
            connect(m_videoOutputDisplay, SIGNAL(beginVideoWindowNativePaint()), this, SLOT(suspendDirectScreenAccess()));
            connect(m_videoOutputDisplay, SIGNAL(endVideoWindowNativePaint()), this, SLOT(resumeDirectScreenAccess()));
#endif
        }
        m_videoOutputControl = videoOutput;
        windowHandleChanged();
    }

    DP0("S60VideoPlayerSession::setVideoRenderer ---");
}
Exemple #3
0
void YaRotation::updateRotation()
{
	rotation_ += 20;
	if (rotation_ >= 360)
		rotation_ = 0;
	emit rotationChanged();
}
Exemple #4
0
void rotationWidget::mouseDoubleClickEvent(QMouseEvent *event){
  if (event->buttons() & Qt::LeftButton) {
    rot.resetRotation();
    emit update();
    emit rotationChanged(rot.getRotation());
  }
}
Exemple #5
0
void rotationWidget::mouseMoveEvent(QMouseEvent *event){
  if (event->buttons() & Qt::LeftButton) {
      rot.drag(event->pos().x(),event->pos().y());
      emit update();
      emit rotationChanged(rot.getRotation());
  }
}
void S60VideoDisplay::setRotation(qreal value)
{
    if (value != m_rotation) {
        m_rotation = value;
        emit rotationChanged(m_rotation);
    }
}
/*!
  Called when accelerometer \a reading changes.
  Returns false to prevent the reading from propagating.
*/
bool AccelerometerFilter::filter(QAccelerometerReading *reading)
{
    const qreal radians_to_degrees = 57.2957795;

    qreal rx = reading->x();
    qreal ry = reading->y();
    qreal rz = reading->z();

    qreal divider = sqrt(rx * rx + ry * ry + rz * rz);

#if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_6)
    // These devices has accelerometer sensors placed as portrait
    // orientation.
    const qreal newReadingWeight = 0.1f;

    qreal newValue = -(acos(rx / divider) * radians_to_degrees - 90);
#else
    // And these devices the accelerometer is placed
    // as landscape orientation.
    const qreal newReadingWeight = 0.2f;

    qreal newValue = acos(ry / divider) * radians_to_degrees - 90;
#endif

    // Low pass filtering
    qreal value =
            newValue * newReadingWeight + m_prevValue * (1 - newReadingWeight);

    if (fabs(value - m_prevValue) > 0.1f)
        emit rotationChanged(value);

    m_prevValue = value;

    return false;
}
void PaintedWindow::setRotation(qreal r)
{
    if (r != m_rotation) {
        m_rotation = r;
        emit rotationChanged(r);
    }
}
Exemple #9
0
/*!
    \qmlproperty real QtQuick::TouchPoint::rotation
    \since 5.9

    This property holds the angular orientation of this touch point. The return
    value is in degrees, where zero (the default) indicates the finger or token
    is pointing upwards, a negative angle means it's rotated to the left, and a
    positive angle means it's rotated to the right. Most touchscreens do not
    detect rotation, so zero is the most common value.

    \sa QTouchEvent::TouchPoint::rotation()
*/
void QQuickTouchPoint::setRotation(qreal r)
{
    if (_rotation == r)
        return;
    _rotation = r;
    emit rotationChanged();
}
Exemple #10
0
void CVX_External::reset()
{
	dofFixed=0;
	extForce = extMoment = Vec3D<float>();
	extTranslation = Vec3D<double>();
	extRotation = Vec3D<double>();
	rotationChanged();
}
Exemple #11
0
void CVX_External::setDisplacementAll(const Vec3D<double>& translation, const Vec3D<double>& rotation)
{
	dofSetAll(dofFixed, true);
	extTranslation = translation;
	extRotation = rotation;

	rotationChanged();
}
Exemple #12
0
void CVX_External::clearDisplacementAll()
{
	dofSetAll(dofFixed, false);
	extTranslation = Vec3D<double>();
	extRotation = Vec3D<double>();

	rotationChanged();
}
void AbstractContent::setRotation(qreal angle)
{
    if (m_rotationAngle != angle) {
        m_rotationAngle = angle;
        applyTransforms();
        emit rotationChanged();
    }
}
Exemple #14
0
void YaRotation::setEnabled(bool enable)
{
	if (enable)
		rotationTimer_->start();
	else
		rotationTimer_->stop();
	emit rotationChanged();
}
Exemple #15
0
 void Rotation::setRotation(EulerAngles const& _angles) {
   {
     QSignalBlocker blocker(this);
     x_->setValue(_angles.roll().degrees());
     y_->setValue(_angles.pitch().degrees());
     z_->setValue(_angles.yaw().degrees());
   }
   emit rotationChanged();
 }
//private
void PrivateQGraphicsObject::setMGObj(MapGraphicsObject * mgObj)
{
    _mgObj = mgObj;

    if (_mgObj == 0)
        return;

    //Connect signals/slots for all of the changes in the MapGraphicsObject that we must be able to handle
    connect(_mgObj,
            SIGNAL(enabledChanged()),
            this,
            SLOT(handleEnabledChanged()));
    connect(_mgObj,
            SIGNAL(opacityChanged()),
            this,
            SLOT(handleOpacityChanged()));
    connect(_mgObj,
            SIGNAL(parentChanged()),
            this,
            SLOT(handleParentChanged()));
    connect(_mgObj,
            SIGNAL(posChanged()),
            this,
            SLOT(handlePosChanged()));
    connect(_mgObj,
            SIGNAL(rotationChanged()),
            this,
            SLOT(handleRotationChanged()));
    connect(_mgObj,
            SIGNAL(visibleChanged()),
            this,
            SLOT(handleVisibleChanged()));
    connect(_mgObj,
            SIGNAL(zValueChanged()),
            this,
            SLOT(handleZValueChanged()));
    connect(_mgObj,
            SIGNAL(selectedChanged()),
            this,
            SLOT(handleMGSelectedChanged()));
    connect(_mgObj,
            SIGNAL(flagsChanged()),
            this,
            SLOT(handleMGFlagsChanged()));
    connect(mgObj,
            SIGNAL(keyFocusRequested()),
            this,
            SLOT(handleKeyFocusRequested()));

    //Get all of the info about the MGObject
    this->updateAllFromMG();

    connect(mgObj,
            SIGNAL(destroyed()),
            this,
            SLOT(deleteLater()));
}
void VideoEditor::setRotation(QVector3D rotation)
{
    if (m_video == NULL || m_video->rotation() == rotation)
        return;

    Tardis::instance()->enqueueAction(Tardis::VideoSetRotation, m_video->id(), m_video->rotation(), rotation);
    m_video->setRotation(rotation);
    emit rotationChanged(rotation);
}
void GeometryPropertiesWidget::frenchConnection()
{
    connect(&d->screenieModel, SIGNAL(positionChanged()),
            this, SLOT(updateUi()));
    connect(&d->screenieModel, SIGNAL(rotationChanged()),
            this, SLOT(updateUi()));
    connect(&d->screenieModel, SIGNAL(distanceChanged()),
            this, SLOT(updateUi()));
}
Exemple #19
0
void Scene3d::setRotation(double yaw, double pitch, double roll) {
  if ((yaw != mRotation[0]) || (pitch != mRotation[1]) ||
      (roll != mRotation[2])) {
    mRotation[0] = correctAngle(yaw);
    mRotation[1] = correctAngle(pitch);
    mRotation[2] = correctAngle(roll);
    emit rotationChanged(mRotation);
  }
}
Exemple #20
0
void Scene::setRotation(const Rotation& rotation) {
  Rotation corrected;
  for (int k = 0; k < 3; ++k)
    corrected[k] = Polar<double, 3>::correctAngle(rotation[k]);

  if (this->rotation != corrected) {
    this->rotation = corrected;
    emit rotationChanged(*this);
  }
}
void XFormView::reset()
{
    emit rotationChanged(0);
    emit scaleChanged(1000);
    emit shearChanged(0);
    ctrlPoints = QPolygonF();
    ctrlPoints << QPointF(250, 250) << QPointF(350, 250);
    pts->setPoints(ctrlPoints);
    pts->firePointChange();
}
Exemple #22
0
Box2DBody::Box2DBody(QQuickItem *parent) :
    QQuickItem(parent),
    mBody(0),
    mWorld(0),
    mSynchronizing(false),
    mInitializePending(false)
{
    setTransformOrigin(TopLeft);
    connect(this, SIGNAL(rotationChanged()), SLOT(onRotationChanged()));
}
void BoardObject::updatePositionAndRotation(int positionX,
                                            int positionY,
                                            int rotation) {
    this->_positionX = positionX;
    this->_positionY = positionY;
    this->_rotation = rotation;
    emit positionXChanged(positionX);
    emit positionYChanged(positionY);
    emit rotationChanged(rotation);
}
Exemple #24
0
CVX_External& CVX_External::operator=(const CVX_External& eIn)
{
	dofFixed = eIn.dofFixed;
	extForce = eIn.extForce;
	extMoment = eIn.extMoment;
	extTranslation = eIn.extTranslation;
	extRotation = eIn.extRotation;
	rotationChanged();
	return *this;
}
void MapGraphicsObject::setRotation(qreal nRotation)
{
    if (nRotation == _rotation)
        return;
    _rotation = nRotation;

    if (_constructed)
        this->rotationChanged();
    else
        QTimer::singleShot(1, this, SIGNAL(rotationChanged()));
}
Exemple #26
0
/**
* @brief cwCaptureItem::setRotation
* @param rotation
*
* This will automatically convert the rotation into a rotation between 0 to 360.0
*/
void cwCaptureItem::setRotation(double rotation) {
    rotation = fmod(rotation, 360.0);
    if(rotation < 0) {
        rotation = 360.0 + rotation;
    }

    if(Rotation != rotation) {
        Rotation = rotation;
        emit rotationChanged();
    }
}
Exemple #27
0
void Missile::setRotation(qreal rotation)
{
    if (rotation < 0) {
        rotation += M_PI * 2.0;
    }

    if (rotation > M_PI * 2.0) {
        rotation -= M_PI * 2.0;
    }

    m_rotation = rotation;
    emit rotationChanged();
}
Exemple #28
0
void QgsComposerItem::setRotation( double r )
{
    if ( r > 360 )
    {
        mRotation = (( int )r ) % 360;
    }
    else
    {
        mRotation = r;
    }
    emit rotationChanged( r );
    update();
}
Exemple #29
0
void CVX_External::clearDisplacement(dofComponent dof)
{
	dofSet(dofFixed, dof, false);

	if (dof & X_TRANSLATE) extTranslation.x = 0.0;
	if (dof & Y_TRANSLATE) extTranslation.y = 0.0;
	if (dof & Z_TRANSLATE) extTranslation.z = 0.0;
	if (dof & X_ROTATE) extRotation.x = 0.0;
	if (dof & Y_ROTATE)	extRotation.y = 0.0;
	if (dof & Z_ROTATE) extRotation.z = 0.0;

	rotationChanged();
}
Exemple #30
0
void CVX_External::setDisplacement(dofComponent dof, double displacement)
{
	dofSet(dofFixed, dof, true);
	if (displacement != 0.0f){
		if (dof & X_TRANSLATE) extTranslation.x = displacement;
		if (dof & Y_TRANSLATE) extTranslation.y = displacement;
		if (dof & Z_TRANSLATE) extTranslation.z = displacement;
		if (dof & X_ROTATE) extRotation.x = displacement;
		if (dof & Y_ROTATE)	extRotation.y = displacement;
		if (dof & Z_ROTATE) extRotation.z = displacement;
	}

	rotationChanged();
}