Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"QWidget: Must construct a QApplication before a QWidget" when using VlcWidgetVideo class #272

Open
brianuuu opened this issue Jan 12, 2021 · 2 comments

Comments

@brianuuu
Copy link

So I did it in 2 ways, one is to promote a QWidget to the VlcWidgetVideo with path VLCQtWidgets/WidgetVideo.h (I have already included the path in .pro). The other way is I initialize it dynamically in code

m_video = new VlcWidgetVideo(this);
ui->verticalLayout->addWidget(m_video);

Both gives me the same error when I launch the program,
QWidget: Must construct a QApplication before a QWidget
How do I solve this problem? I tried insert breakpoint in main.cpp and when m_video is constructed, QApplication is definitely constructed before m_video

Another thing to note is when I create VlcInstance, it gives me this warning:
QObject: Cannot create children for a parent that is in a different thread. (Parent is MainWindow(0x73fe00), parent's thread is QThread(0x1e41c7b8), current thread is QThread(0x1fbd3b08)
Is it because VLC-Qt is running on a different thread and that thread doesn't have QApplication?

@gregorsimoncic
Copy link

Hi brianuuu, is it possible that you have solved this issue, somehow? I am also facing this issue. Thanks.

@brianuuu
Copy link
Author

For this no, I used the code from here and replace the dll and libraries from the latest VLC player and it worked for me https://wiki.videolan.org/LibVLC_SampleCode_Qt/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants