Solved QGraphicsVideoItem mirror ?
-
QGraphicsScene *scene = new QGraphicsScene; QGraphicsVideoItem *GVI = new QGraphicsVideoItem; GVI->setSize(QSizeF(800,600)); scene->addItem(GVI); ui->graphicsView->setScene(scene); QMediaPlayer *player = new QMediaPlayer; player->setVideoOutput(GVI); //GVI.scale(-1,1); // QT_DEPRECATED_SINCE(5, 0) ? GVI->setTransform(QTransform::fromScale(-1, 1)); // QMediaPlayer stopped and can not play anymore
-
Hi,
What version of Qt ?
What OS ?
What video file format ?
What is exactly the question ? -
@sonichy Does the sound stop too? When I tried, the mediaplayer does not stop, but the video moved to somewhere invisible.
Try//the center of video qreal x = GVI->boundingRect().width() / 2.0; qreal y = GVI->boundingRect().height() / 2.0; GVI->setTransform(QTransform().translate(x, y).scale(-1, 1).translate(-x, -y), true);
-
@Bonnie It seems must use this format:
setTransform(QTransform().translate(x, y).scale(-1, 1).translate(-x, -y),