Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. There is a ghost widget!!!!!!

There is a ghost widget!!!!!!

Scheduled Pinned Locked Moved Unsolved General and Desktop
widgetqmediaplayerqvideowidget
4 Posts 2 Posters 612 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    surfzoid
    wrote on 17 Jan 2023, 10:05 last edited by
    #1

    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 ?

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 17 Jan 2023, 16:54 last edited by
      #2

      @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

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      S 2 Replies Last reply 18 Jan 2023, 19:12
      0
      • C Christian Ehrlicher
        17 Jan 2023, 16:54

        @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

        S Offline
        S Offline
        surfzoid
        wrote on 18 Jan 2023, 19:12 last edited by
        #3

        @Christian-Ehrlicher
        this is very easy to manage........

        1 Reply Last reply
        0
        • C Christian Ehrlicher
          17 Jan 2023, 16:54

          @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

          S Offline
          S Offline
          surfzoid
          wrote on 18 Jan 2023, 19:28 last edited by
          #4

          @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 have

          
              if (!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

          1 Reply Last reply
          0

          3/4

          18 Jan 2023, 19:12

          • Login

          • Login or register to search.
          3 out of 4
          • First post
            3/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved