News:

--

Main Menu

QT4 & QT5

Started by mean, February 08, 2015, 03:56:23 PM

Previous topic - Next topic

mean

Current git can be built using either QT4 and QT5
QT5 works slightly worse as some needed functions have been obsoleted
Important : dont mix them, you'll have issue, especially plugins

sl1pkn07

How to switch between both?  if have Qt4 and Qt5 in same time

Jan Gruuthuse

QuoteThe Qt Chooser provides a wrapper to switch between versions of Qt
development binaries when multiple versions like 4 and 5 are installed
or local Qt builds are to be used.

If you wish to use Qt development binaries with the default PATH and
without special parameters, you need to additionally install either
qt4-default or qt5-default package to provide the default configuration.

Probably your partial answer: http://manpages.ubuntu.com/manpages/utopic/man1/qtchooser.1.html

sl1pkn07

#3
yes. i know. QT_SELECT=4 or QT_SELECT=5 make nothing

cmake always prefeer Qt4 over Qt5

i mean, always search first Qt4 and if not found, search Qt5. but howto select directly Qt5?

-DQT4=OFF directly fail


- Checking Qt
-- Checking for Qt 4
-- *****************
Disabled per request


CMake Error at CMakeLists.txt:19 (MESSAGE):
  Qt NOT FOUND


-- Configuring incomplete, errors occurred!

Jan Gruuthuse

#4
Have you installed qt5-default? My understanding for now: you either have qt4-default or qt5-default installed to show preference? (not both)
qt5-default
QuoteThis package sets Qt 5 to be the default Qt version to be used when
using development binaries like qmake. It provides a default
configuration for qtchooser, but does not prevent alternative Qt
installations from being used.

sl1pkn07

Have a installed BOTH Qt versions, 'qt5-default' or 'qt4-default' don't exist in Archlinux, that is select by QT_SELECT=4 or QT_SELECT=5


â”Å'â”â,¬Ã¢â€Â¤[$]|[sl1pkn07]|[sL1pKn07]|[/usr/lib]|
â””â”â,¬Ã¢â€â,¬Ã¢â€â,¬Ã¢â€¢Â¼  qtchooser
Usage:
  qtchooser { -l | -list-versions | -print-env }
  qtchooser -install [-f] [-local] <name> <path-to-qmake>
  qtchooser -run-tool=<tool name> [-qt=<Qt version>] [program arguments]
  <executable name> [-qt=<Qt version>] [program arguments]

Environment variables accepted:
QTCHOOSER_RUNTOOL  name of the tool to be run (same as the -run-tool argument)
QT_SELECT          version of Qt to be run (same as the -qt argument)

â”Å'â”â,¬Ã¢â€Â¤[$]|[sl1pkn07]|[sL1pKn07]|[/usr/lib]|
â””â”â,¬Ã¢â€â,¬Ã¢â€â,¬Ã¢â€¢Â¼  qtchooser -l
4
5
default
â”Å'â”â,¬Ã¢â€Â¤[$]|[sl1pkn07]|[sL1pKn07]|[/usr/lib]|
â””â”â,¬Ã¢â€â,¬Ã¢â€â,¬Ã¢â€¢Â¼  qtchooser -print-env
QT_SELECT="default"
QTTOOLDIR="/usr/lib/qt/bin"
QTLIBDIR="/usr/lib"
â”Å'â”â,¬Ã¢â€Â¤[$]|[sl1pkn07]|[sL1pKn07]|[/usr/lib]|
â””â”â,¬Ã¢â€â,¬Ã¢â€â,¬Ã¢â€¢Â¼  QT_SELECT=4 qtchooser -print-env
QT_SELECT="4"
QTTOOLDIR="/usr/lib/qt4/bin"
QTLIBDIR="/usr/lib"
â”Å'â”â,¬Ã¢â€Â¤[$]|[sl1pkn07]|[sL1pKn07]|[/usr/lib]|
â””â”â,¬Ã¢â€â,¬Ã¢â€â,¬Ã¢â€¢Â¼  QT_SELECT=default qtchooser -print-env
QT_SELECT="default"
QTTOOLDIR="/usr/lib/qt/bin"
QTLIBDIR="/usr/lib"
â”Å'â”â,¬Ã¢â€Â¤[$]|[sl1pkn07]|[sL1pKn07]|[/usr/lib]|
â””â”â,¬Ã¢â€â,¬Ã¢â€â,¬Ã¢â€¢Â¼ 


by default is Qt5 installation. but the Cmake search first the Qt4 installation, and then (if not found Qt4) search Qt5, but as found Qt4 first ...

Jan Gruuthuse


sl1pkn07

#7

â””â”â,¬Ã¢â€â,¬Ã¢â€â,¬Ã¢â€¢Â¼  ls /etc/xdg/qtchooser/
total 16
drwxr-xr-x  2 root root 4096 dic 13 20:29 .
drwxr-xr-x 11 root root 4096 feb  8 14:55 ..
-rw-r--r--  1 root root   26 dic 13 18:50 4.conf
-rw-r--r--  1 root root   25 dic 13 18:50 5.conf
lrwxrwxrwx  1 root root   25 dic 13 18:50 default.conf -> /etc/xdg/qtchooser/5.conf


still search qt4 (with expected behavior: found it), but cannot swich to search Qt5 directly

I need for package management. user side config not allowed (like you arch wiki solution)(because all users hace their own config)

https://aur.archlinux.org/packages/avidemux-git/ (without support last git Qt5 changes)

greetings

mean

edit cmake/admCheckQt5.cmake
and remove the
   SET(QT5_CHECKED 1)
That is at line 4

sl1pkn07

Thanks Mean. now can build the Qt5 version when have installed both Qts (Qt4/Qt5) in same time

is possible add a Qt selector as cmake flag?

for example add -DUSE_QT=4/-DUSE_QT=5 for use one or other?

greetings

mean

yes, it is on the todo list + repair translations
The QT5 as of now might work worse than qt4 with regard to display

sl1pkn07

oks. thanks for your effort

greetings