Why PyQt 4.9 dont have WebKit - pyqt4

I installed Qt 4.8 which have the support of QtWebkit. After that i tried installing PyQt-4.9. on my CentOS Server. I dont understand why the QtWebkit library is not installed. The Source package does not contain the package at all.
Can any one help me finding a PyQt source with Webkit?..
Right now i cant do from PyQt4.QtWebKit import QWebPage

try check you dev package of Qt4 on system.
i compile PyQt5 on Debian, but can find QtWebKit.
then i install libqt5webkit5-dev and compile PyQt5 again.
maybe helps.

Related

PyQt5: Cannot create cross-platform QtWebKitWidget application

I've developed a PyQt5 application on Linux (Ubuntu 16.04 LTS) that uses a QtWebKitWidget (QtWebView). It works great on Linux. I'm trying to package it for distribution for Windows using cx_Freeze, but the resulting application stops execution at launch with the PyQt5 error message "Import Error: Cannot import name 'QtWebKitWidgets.'"
I read that QtWebKitWidgets was deprecated from PyQt5 as of Qt 5.6, and that I should now use QtWebEngineWidgets instead. Fair enough. But I can't seem to install QtWebEngineWidgets on Ubuntu. I've installed Qt Creator 5.10 (most recent as of Dec 2017), and tried to include QtWebEngine via the oinline installation wizard, but the QtWebView widget is not listed in the toolbox.
My question: how can I use a PyQt5 WebView widget that will be cross-platform? If I use QtWebKit, it works on Linux but not on Windows. If I use QtWebEngine, it should work on Windows but not Linux.
What do I need to install on both platforms?
(Thanks in advance.)

How can I make an executable for python3 if I am using PyQt5?

I tried to make the executable with cxFreeze, but it sends me the error that it does not find the module called Codecs, could someone help me to create the executable with either cxFreeze or with any other tool?
Well without further details we can't help much. However the codecs problem is common in cx_Freeze and this was fixed in the latest version. You should update cx_Freeze to version 5.1 and your problem should be fixed.
Source: https://github.com/anthony-tuininga/cx_Freeze/issues/325

In Linux Mint 17.2 (i.e. Ubuntu 14.04), how to make qt 5.4 as the default qt5 library version of programs?

I install the latest qt version from the official website http://www.qt.io/qt5-4/ successfully. I follow this tutorial http://sysads.co.uk/2014/05/install-qt-5-3-ubuntu-14-04 and install the qt 5.4 version. Besides, I have the Ubuntu repository version of qt 5.2.1 installed.
Now I want to make the default version of 5.4 due to a program can't work well in the old qt5 version. That is to say, when I start a program which need to use qt5 library the program will use the version 5.4 rather than the version qt 5.2. Though I have installed the version 5.4 and 5.2, the program still use qt 5.2 version.
I try to use qtchooser to choose the 5.4 version as the default option, however, the program installed in the system still use the qt 5.2 library.
I endeavor to modify the related files regarding qtchooser, nothing changes.
If the library version is not in some regular repository, I would strongly suggest not relying on the user to install it somehow from an "unofficial" install location. Or provide a package for the library version yourself to install alongside your application. But don't replace the system Qt version. That would be Bad®.
Instead, either compile your program with a specific rpath, or wrap your program in scripts that use something like LD_PRELOAD and/or LD_LIBRARY_PATH to load the library version you're shipping in your application package.
Both ways are clunky, and I would try to at least work around the Qt version bug if at all possible.
The latest Qt version (non-alpha) actually is Qt 5.5.
If you install it through the installer provided by Qt, you should change the default Qt version by editing/creating:
/etc/xdg/qtchooser/default.conf
which should contain first the bin directory, then the lib directory, for example:
/opt/Qt/5.5/gcc_64/bin
/opt/Qt/5.5/gcc_64/lib
At least this works for the qmake version. Otherwise you might need to change LD_LIBRARY_PATH as commented by rubenvb.

Qt5 on Linux - where is Linguist?

I'm using Linux Mint 16 and I got a problem.
I installed Qt Creator 5.2.1 from binary package, downloaded from Qt site. I don't have Qt Linguist... Also, I have installed qtcreator and qt5-dev-tools (or similar name) from repository, still no Linguist. Where I can download it?
I prefer binary version from Qt site because it's newer than version from repository.
It should be in the bin folder. You can always do this to figure it out:
find $installdir/ -name \*linguist\*
By the way, there is also another option: install Archlinux and get all the fancy latest stuff. ;-)

Any tips on compiling PyQt for Centos 5.5?

I have installed a bunch of qt packages - qt, qt-devel, qt4, qt4-devel, sip but can't get latest PyQt4 to compile.
I've pointed the configure script at my qt4lib as such
python configure.py -q /usr/lib64/qt4/bin/qmake --verbose
but getting errors like
DBus v1 does not seem to be installed.
cfgtest_QtHelp.cpp:1:25: error: qhelpengine.h: No such file or directory
sip: /mnt/hgfs/rnp_repos/PyQt-x11-gpl-4.8.1/sip/QtCore/qabstractitemmodel.sip:156: syntax error
Error: Unable to create the C++ code.
EDIT: Found out that SIP v4.11.2 is required for PyQt 4.8 but still can't make without errors. At least python configure.py finishes now.
Any tips?
Grab the PyQt4 SRPM from Fedora and rebuild using mock. You may need to look a few versions back for one that will compile against the version of Qt 4 in CentOS.
I've just successfully compiled PyQt 4.8 on Centos 5.5. I went down the route of building Qt4 from source - using qt-everywhere-opensource-src-4.7.1.tar.gz from Nokia.
Had to obtain various *-devel packages before Qt's ./configure would complete - see http://doc.qt.nokia.com/4.7/requirements-x11.html (don't worry about the version numbers being slightly lower than required).
Also I used Python 2.6 from the EPEL 5 repository (python26-devel). Just remember when building PyQt to run python26 configure.py (and not the default Python). I don't know if this will improve your mileage in building PyQt but we're porting an application from Windows which was already using 2.6 so this route was necessary for me.
Not going to post my entire .bash_history here (much trial and error!) but if you're trying this and get stuck please ask a question.

Resources