void ResizeAwareQuickWidget::updateWorldSize(qreal aWidthInMeter, qreal aHeightInMeter) { DEBUG1ENTRY; theWorldWidthInMeters = aWidthInMeter; theWorldHeightInMeters= aHeightInMeter; emit aspectRatioChanged(); emit resizeEvent(nullptr); }
/*! * Sets the projection's aspect ratio to \a aspectRatio. This triggers a projection * matrix update. * * \note this has no effect if the projection type is not * Qt3DCore::QCameraLens::PerspectiveProjection. */ void QCameraLens::setAspectRatio(float aspectRatio) { Q_D(QCameraLens); if (qFuzzyCompare(d->m_aspectRatio, aspectRatio)) return; d->m_aspectRatio = aspectRatio; emit aspectRatioChanged(aspectRatio); d->updateProjectionMatrix(); }
/*! \internal */ QCamera::QCamera(QCameraPrivate &dd, QNode *parent) : QEntity(dd, parent) { QObject::connect(d_func()->m_lens, SIGNAL(projectionTypeChanged()), this, SIGNAL(projectionMatrixChanged())); QObject::connect(d_func()->m_lens, SIGNAL(nearPlaneChanged()), this, SIGNAL(nearPlaneChanged())); QObject::connect(d_func()->m_lens, SIGNAL(farPlaneChanged()), this, SIGNAL(farPlaneChanged())); QObject::connect(d_func()->m_lens, SIGNAL(fieldOfViewChanged()), this, SIGNAL(fieldOfViewChanged())); QObject::connect(d_func()->m_lens, SIGNAL(aspectRatioChanged()), this, SIGNAL(aspectRatioChanged())); QObject::connect(d_func()->m_lens, SIGNAL(leftChanged()), this, SIGNAL(leftChanged())); QObject::connect(d_func()->m_lens, SIGNAL(rightChanged()), this, SIGNAL(rightChanged())); QObject::connect(d_func()->m_lens, SIGNAL(bottomChanged()), this, SIGNAL(bottomChanged())); QObject::connect(d_func()->m_lens, SIGNAL(topChanged()), this, SIGNAL(topChanged())); QObject::connect(d_func()->m_lens, SIGNAL(projectionMatrixChanged()), this, SIGNAL(projectionMatrixChanged())); QObject::connect(d_func()->m_lookAt, SIGNAL(positionChanged()), this, SIGNAL(positionChanged())); QObject::connect(d_func()->m_lookAt, SIGNAL(upVectorChanged()), this, SIGNAL(upVectorChanged())); QObject::connect(d_func()->m_lookAt, SIGNAL(viewCenterChanged()), this, SIGNAL(viewCenterChanged())); QObject::connect(d_func()->m_transform, SIGNAL(matrixChanged()), this, SIGNAL(matrixChanged())); d_func()->m_transform->addTransform(d_func()->m_lookAt); addComponent(d_func()->m_lens); addComponent(d_func()->m_transform); }
X11Renderer::X11Renderer(VideoWidget *videoWidget) : AbstractRenderer(videoWidget) { m_renderWidget = new OverlayWidget(videoWidget, this); videoWidget->backend()->logMessage("Creating X11 overlay renderer"); QPalette palette; palette.setColor(QPalette::Background, Qt::black); m_videoWidget->setPalette(palette); m_videoWidget->setAutoFillBackground(true); m_renderWidget->setMouseTracking(true); m_videoSink = createVideoSink(); aspectRatioChanged(videoWidget->aspectRatio()); setOverlay(); }
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 ---"); }
void VideoItem::setAspectRatio(qreal aspectRatio) { m_aspect_ratio = aspectRatio; emit aspectRatioChanged(); }
void MainWindow::aspectChanged(double d) { qDebug() << "MainWindow::aspectChanged(): "<<d; m_aspect = d; emit aspectRatioChanged(d); }
void NetworkClient::processCommand(OutputServer::Command cmd, QVariant a, QVariant b, QVariant c) { if(!m_inst) return; switch(cmd) { case OutputServer::SetSlideGroup: log("[INFO] Downloading new Slide Group from Server ..."); cmdSetSlideGroup(a,b.toInt()); break; case OutputServer::SetSlide: log(QString("[INFO] Changing to Slide # %1").arg(a.toInt())); m_inst->setSlide(a.toInt()); break; case OutputServer::AddFilter: log(QString("[INFO] Added Filter # %1").arg(a.toInt())); cmdAddfilter(a.toInt()); break; case OutputServer::DelFilter: log(QString("[INFO] Removed Filter # %1").arg(a.toInt())); cmdDelFilter(a.toInt()); break; // case OutputServer::FadeClear: // log(QString("[INFO] Background-Only (\"Clear\") Frame %1").arg(a.toBool() ? "On":"Off")); // m_inst->fadeClearFrame(a.toBool()); // break; case OutputServer::FadeBlack: log(QString("[INFO] Black Frame %1").arg(a.toBool() ? "On":"Off")); m_inst->fadeBlackFrame(a.toBool()); break; case OutputServer::SetBackgroundColor: m_inst->setBackground(QColor(a.toString())); break; case OutputServer::SetOverlaySlide: log(QString("[INFO] Downloading new Overlay Slide from Server...")); cmdSetOverlaySlide(a); break; case OutputServer::SetLiveBackground: cmdSetLiveBackground(a.toString(),b.toBool()); break; case OutputServer::SetTextResize: log(QString("[INFO] Set Text Resize: %1").arg(a.toBool())); m_inst->setAutoResizeTextEnabled(a.toBool()); break; case OutputServer::SetFadeSpeed: log(QString("[INFO] Set Fade Speed to %1 ms").arg(a.toInt())); m_inst->setFadeSpeed(a.toInt()); break; case OutputServer::SetFadeQuality: log(QString("[INFO] Set Fade Quality to %1 fps").arg(a.toInt())); m_inst->setFadeQuality(a.toInt()); break; case OutputServer::SetAspectRatio: log(QString("[INFO] Set Aspect Ratio %1").arg(a.toDouble())); emit aspectRatioChanged(a.toDouble()); break; case OutputServer::SetSlideObject: log(QString("[INFO] Downloading new out-of-group Slide from Server...")); cmdSetSlideObject(a); break; default: qDebug() << "Command Not Handled: "<<(int)cmd; log(QString("[DEBUG] Unknown Command: '%1'").arg(cmd)); }; }