I want to use WebGL in QtWebEngineWidgets.QWebEngineView under Windows with my Qt 5.9.2.
But when I try to load webglreport.com, in QWebEngineView it tells me, that "This browser supports WebGL 2, but it is disabled or unavailable."
How can I fix it?
Here's my code:
PyQt:
import os, sys
from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
# app.setAttribute(QtCore.Qt.AA_UseOpenGLES) # nothing happens, you can comment it out
view = QtWebEngineWidgets.QWebEngineView()
# view.settings().setAttribute(QtWebEngineWidgets.QWebEngineSettings.WebGLEnabled, True) # does not help too = (((
view.load(QtCore.QUrl("http://webglreport.com/?v=2"))
view.show()
sys.exit(app.exec_())
# And here WebGL Report will tell me: "This browser supports WebGL 2, but it is disabled or unavailable."
# How can I cope with it???
C++ Qt:
#include <QApplication>
#include <QtWebEngineWidgets/QWebEngineView>
#include <QUrl>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWebEngineView view;
view.load(QUrl("http://webglreport.com/"));
view.show();
return a.exec();
}
Binary Packages
Wheels are provided for Python v3.5 and later for 64-bit Linux, macOS and 32-bit and 64-bit Windows. These include copies of the corresponding Qt libraries.
Note that the minimum version of macOS supported is determined by the version of Qt included in the wheel.
Note that for v5.11 and later the 32-bit Windows wheels do not contain the WebEngine modules.
pyqt download
Related
Here very strange situation.
Fresh install Debian Sid, XFCE4, nvidia proprietary driver 340.108 from Sid repo(maybe this proprietary driver have bug?)
c2d, gf9800gtx, 4gb ram, hdd
Now when i try start [b]any Qt software almost all[/b] give here Segmentation fault
Example Doomseeker, it crashes at start, BUT! working good through
gdb ./doomseeker
strace ./doomseeker
Same is with Qbittorrent
https://imgur.com/a/SYgqHZD
and 2048-Qt
https://imgur.com/SUefK7P
Only one Qt application starting normally - CMake GUI
Segmentation fault
#include <QApplication>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
return 0;
}
Please, can you give answer why it happens?
And if its possible solve this?
Windows 10 and Qt Creator MSVC2015_64,I compile and run an example of QWebEngineView. just like this:
#include "mainwindow.h"
#include <QApplication>
#include <QWebEngineView>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWebEngineView *view = new QWebEngineView();
view->load(QUrl("http://qt-project.org/"));
view->show();
return a.exec();
}
but this code can not show the view,it give some message:
[2460:3120:0718/170222.823:INFO:dxva_video_decode_accelerator_win.cc(1120)] mf.dll is required for hardware video decoding
[2460:3120:0718/170222.823:INFO:dxva_video_decode_accelerator_win.cc(1120)] mf.dll is required for hardware video decoding
[2460:3120:0718/170223.229:ERROR:gl_context_wgl.cc(78)] Could not share GL contexts.
[2460:3120:0718/170223.229:ERROR:gl_context_wgl.cc(78)] Could not share GL contexts.
How to solve it?
Which Windows Version are you running?
The mf.dll is part of Windows 6/7/8/10 (and therefore not run on Windows XP). If you are running Windows XP, you have to confile Qt with the configure option "-target xp" for option "-no-wmf-backend" to be compatible with Windows XP.
If you are running a modern version,then try it by installing Windows Live Essentials and the Media Feature Package
I'm attempting a QSqlDatabase hello world application using PostgreSQL. My environment is as follows: Windows 7 64-bit, Qt 4.8.2, PostgreSQL 9.0.13. The following code compiles, but will not debug, i.e. when I place a break on the QSqlDatabase::drivers() line, but the code exits with an exception. The application runs as expected when I comment out this line. Any suggestions?
#include <QApplication>
#include <QMainWindow>
#include <QtSql/QtSql>
#include <QtSql/QSqlDatabase>
int main(int argc, char *argv[])
{
QApplication prog(argc, argv);
QMainWindow *mainWin = new QMainWindow;
QStringList drvlst = QSqlDatabase::drivers(); // <-- problem!
mainWin->show();
return prog.exec();
}
Another example of DLL hell and how Dependency Walker can be a great tool for diagnosing potential bugs of this nature. Again, in this case, the linker was traversing the PATH environment variable to find QTSQLD4.DLL library dependencies. The linker found the openVPN SSLEAY32.DLL (which is actually 64 bit) instead of the postgreSQL version of SSLEAY32.DLL. Moving the openVPN url to the end of the PATH environment variable resolved this problem.
I would like to use an QT as an user interface for my mobile platform. I have a sensor package consist of IMU , Laser, Kinect and wheel encoders. Would like to have an input button that run a rose node than do something with the data and gives an output results. I was told that should set up like any other Qt + CMake project.
I have used the simple example
#include "QDebug"
#include "ros/ros.h"
int main(int argc, char** argv)
{
ros::init(argc, argv, "Qt_test");
qDebug()<<"Hello world";
return 0;
}
Than successfuly made the CmakeList file. I could compile it with make. But when I tried to run it with `./test_qt` I got this error
bash: ./test_qt: No such file or directory
An help
Thanks
You must use some package like this http://wiki.ros.org/qt_tutorials?distro=hydro.
And using cmake for build your project. In the case who you want use qtcreator you must call the ide by a command-line. But before, your bash must know the path of ROS installation.
1 - type that in your bash: source devel.setup.bash
2 - create your qtRos node/package in your catkin workspace.
3 - call qtcreator in command line
I run a Qt application, what I want to know is this running binary file name.
I must (partially) disagree with the other comments that it is not a Qt question: There is a Qt method QCoreApplication::applicationFilePath() which gives the directory+filename of the executable.
On Linux this will try to use /proc, and on Windows perhaps GetModuleFileName(). According to the docs it will fall back to argv[0].
You could then use QFileInfo to split it into an executable name and a directory.
QFileInfo(QCoreApplication::applicationFilePath()).fileName()
The Qapplication parses the commandline arguemnts, the first entry is the name of the executable - this is roughly the same as argv[0] in standard C but has a few extra complexities on windows if you have a Unicode build or if the application is started as a service
See http://doc.qt.io/qt-5/qcoreapplication.html#arguments
Again not really a Qt question. To find the name of the binary file executed it would be something like.
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
cout << argv[0] << endl;
return 0;
}