There is a ghost widget!!!!!!
-
Hi
i made a RTSP video player with Qmediaplayer and QvideoWidget, with qtcreator i set all object with mouse and tablet tracking on.
mouseMoveEvent only triggered if i use a mouse right click at the same time.
After too much hours of investigation i do this :void RtspWindow::showEvent(QShowEvent *event) { videoWidget->setObjectName("videoWidget"); //there is a ghost widget!!!!!! QList<QWidget *> widgets = RtspWindow::findChildren<QWidget *>(); foreach (QWidget *var, widgets) { qDebug() << var->objectName() << var->hasMouseTracking() << var->size(); if(var->size() == videoWidget->size()) var->setMouseTracking(true); } }
output give me :
"videoWidget" true QSize(960, 594) "" false QSize(960, 594) "PanTilCmd" true QSize(80, 80) "gridLayoutWidget" false QSize(82, 82) "BtnTopLeft" true QSize(22, 22) "pushButton_7" true QSize(22, 22) "pushButton" true QSize(22, 22)
as we can see, there is a widget without name, with the same size, setting mousetraching solved my issue, but how and why this "gost"?
the player add new instance after play ?
-
@surfzoid said in There is a ghost widget!!!!!!:
QvideoWidget
I would guess it's the internal windowContainer for the QVideoWindow: https://code.qt.io/cgit/qt/qtmultimedia.git/tree/src/multimediawidgets/qvideowidget.cpp?h=dev#n64
-
@Christian-Ehrlicher
this is very easy to manage........ -
@Christian-Ehrlicher
in the same strange way, i have an void :void QtVsPlayer::FullScr() { if (QtVsPlayer::isFullScreen()) { QtVsPlayer::showNormal(); this->ui->menubar->setVisible(true); if (!Zoomed) this->ui->statusbar->setVisible(true); } else { QtVsPlayer::showFullScreen(); this->ui->menubar->setVisible(false); this->ui->statusbar->setVisible(false); } return; }
this void work, i have fullscreen video.
now in mousemove event i haveif (!this->ui->actionMasquer_les_controles->isChecked() and WVideoCtrls->isHidden() and this->ui->actionAuto_hide_controls->isChecked()) { if(!Zoomed and QtVsPlayer::isFullScreen() == false) ui->statusbar->setVisible(true); WVideoCtrls->show(); WVideoCtrls->activateWindow(); WVideoCtrls->raise(); this->centralWidget()->lower(); this->centralWidget()->stackUnder(WVideoCtrls); } if (QtVsPlayer::cursor() == Qt::BlankCursor) { QtVsPlayer::unsetCursor(); } return;
the goal is to display videocontrols, like play, pause and so on, but not the status bar in full screen, but it is shown, zoomed is false but isfullscreen is no such value