0

I'm trying to setup a very basic QVideoWidget in QT6 (6.4.0 to be precise), and i've managed to get it working but I keep getting this annoying warning message and i'm not sure why or what's causing it. I cannot find anything about this online

You can refer to my example code here I use on Windows 10:

int main(int aArgc, char *aArgv[]) {
    QApplication myApplication{aArgc, aArgv};

    QMainWindow myMainWindow;

    QVideoWidget myVideoWidget{&myMainWindow};
    myVideoWidget.setGeometry(200, 200, 300, 300);
    
    myMainWindow.show();

    return myApplication.exec();
}

Something critical to note is I only get this error message when I expand the window to see the video widget, there is no warning message before that!

I want to understand what I am doing wrong to try eliminate any un-needed console output. Any help or pointers in the right direction is infinitely appreciated, thanks!

NightShade
  • 422
  • 5
  • 19
  • One technique I always find useful is to grep through the Qt source code for the error message, so you can see what is causing it. Once there, you can insert code to print a stack trace right after that error message is printed, and recompile Qt with that change; then when you reproduce the fault you can see the entire chain of calls that led to the message being printed. (In this case, it appears it occurs because `m_window` is NULL, so you'd want to track down why that is the case) – Jeremy Friesner Apr 02 '23 at 02:17
  • Thanks, ill try give a go later perhaps .. it might be worth me trying to do this with qmake, since I do some hacky things to compile with and use all my projects with bazel , which is very elegant. I'll also try another operating system later to see if the same issue exists there. Thanks for the suggestion though – NightShade Apr 02 '23 at 02:28
  • For what its worth I think it might be a bug, I found this commit which seems to suggest it will be fixed in 6.5.0: https://github.com/qt/qtmultimedia/commit/5a29082016c3661e9e87174a1e3598f896e7f7f7 – NightShade Apr 02 '23 at 03:36

0 Answers0