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

Already on GitHub? Sign in to your account

Support Qt 5 [$5] #252

Closed
brianolson opened this Issue Jan 26, 2013 · 22 comments

Comments

Projects
None yet
5 participants

TODO:

  • Fix Q_WS_ usage
  • Mac: Test on retina screen. Do we need to scale any graphics?
  • Quick test on Mac
  • Make Qt5 the default Mac development snapshot target
  • Quick test on Linux
  • Make Qt5 the default Linux development snapshot target
  • Quick test on Windows
  • Make Qt5 the default Windows development snapshot target
  • Bug: Drag&drop file in editor window drops the filename instead of the contents. Drop to other widgets work as expected. Only tested on OS X 10.9
  • Look more carefully at devicePixelRatio. See 57e2ecd#commitcomment-5533416 -> It was introduced in Qt 5.1.0
  • The Mac version is crashing with the current Qt-5.2.1 (https://bugreports.qt-project.org/browse/QTBUG-36820). This will be fixed in Qt-5.2.2 -> Fixed in 5.3.0

Notes:

Old text from @brianolson:
I just built on Mac with Qt 5.0. It seemed that on my MacOS 10.8 system g++ was broken and only Qt 5 supported clang on Mac. The good news is that it builds and basically works. There were a couple qmake changes that needed to happen in some build files, QMAKE_INCDIR_QT seems to have gone away and now there is just QMAKE_INCDIR.
I think future support on Mac might require Qt 5 to have a supported path on future versions of MacOS. Has anyone else tried Qt 5?

Did you help close this issue? Go claim the $5 bounty on Bountysource.

Member

donbright commented Jan 26, 2013

Thanks for testing this!!!

We just merged an experimental qt-5 patch for linux (based on having ubuntu's experimental qt5 in /opt ) but I dont know if Marius has tried anything on Mac . . . . (i dont have a Mac)

53c4954

The issue on linux i had was the setup ... you have a system with qt4 and qt5 - how to tell it which to use? I extended the 'clang vs gcc' scripting system we were using under linux, by setting environment variables. like so:

 source scripts/setenv-unibuild.sh qt5  # set QTDIR, QMAKESPEC, PATH, etc etc etc under bash
 qmake # should use qt5's qmake
 make 

Linux also has the QMAKE_INCDIR_QT vs QMAKE_INCDIR issue, and this patch detects that.

On Linux I did have an 'extremely slow OpenGL' problem and i havent looked into fixing it yet...

Owner

kintel commented Jan 28, 2013

brian: Did you compile Qt5 yourself?
I'm still struggling to get Qt built. It looks like Qt5 by default uses g++ to build (I'm building under Lion).

Owner

kintel commented Jan 30, 2013

Qt5 notes which affects OpenSCAD:
o 10.6+ required (10.7+ is strongly recommended since webkit won't create 10.6-compatible binaries on 10.7+ dev systems)
o clang is the default compiler

-> this also means that 32-bit apps are getting rare, so we should consider to stop building 32-bit binaries to ease build system maintenance

Owner

kintel commented Jan 30, 2013

Trying to build Qt with clang on 10.7:

$ clang --version
Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin11.4.2
Thread model: posix

Result:

In file included from qcocoaintegration.mm:44:
./qcocoawindow.h:52:28: error: extra qualification on member 'QCocoaWindow'
class QT_PREPEND_NAMESPACE(QCocoaWindow);
                           ^
../../../../include/QtCore/../../src/corelib/global/qglobal.h:84:39: note: expanded from macro 'QT_PREPEND_NAMESPACE'
# define QT_PREPEND_NAMESPACE(name) ::name

Ideas?
gcc didn't work either with a different error.
Internet isn't being very helpful.

Perhaps Qt5 is just a little bit too fresh to build from source.

kintel, I built using qt binaries from
http://qt-project.org/downloads
http://releases.qt-project.org/qt5/5.0.0/qt-mac-opensource-5.0.0-clang-offline.dmg
I'm on MacOS 10.8. A new XCode update just came out a few days ago, but I haven't installed it yet.

Owner

kintel commented Feb 4, 2014

Revisiting this: I fixed some minor issues for Mac. The Qt5 build works for me now.
I built Qt5 using my experimental homebrew setup at https://github.com/openscad/homebrew-tap

Needs a lot more testing, but the sooner we start building against Qt5 the better.

Owner

t-paul commented Feb 4, 2014

Both master and unstable seem to build fine with Qt5 on Linux (debian/qtbase5-dev 5.1.1+dfsg-6).

http://www.kdab.com/porting-from-qt-4-to-qt-5/ mentions: "In Qt 5, the Q_WS_* macros have been removed, so any code wrapped in them will never be compiled."

Contributor

GilesBathgate commented Feb 4, 2014

@t-paul Yep I got hit by that one. @kintel Did ask me for any pitfalls of moving to Qt5, I had forgotten about this one: GilesBathgate/RapCAD@33ce479

@kintel kintel added this to the 2014 Q1 milestone Feb 5, 2014

Member

donbright commented Feb 7, 2014

I don't know if the Mingw / MXE project has qt5, i have never tested the mingw cross build with qt5 , i dont know if it works.

Owner

kintel commented Feb 7, 2014

MXE is supposed to have Qt5. Needs testing, so let's wait until after the 2014.Q1 release before building binaries with Q5

@kintel kintel modified the milestones: 2014 QX, 2014 Q1 Feb 10, 2014

@brianolson brianolson added the Bounty label Mar 5, 2014

Owner

kintel commented Apr 25, 2014

I'm now building Mac snapshots using the new master branch and Qt5. I know that Windows snapshots have been using unstable for a while. @donbright is Windows already on Qt5?
@t-paul Is there anything missing in terms of using Qt5 as default for Linux as well?

Owner

t-paul commented Apr 25, 2014

I did not do much testing, but it did look ok building against the 5.1.1 installed on debian at that time. I just check, that debian jessie now has 5.2.1, I can give that a try...

Member

donbright commented Apr 25, 2014

building on qt5 can work for windows. MXE contains qt5.

my biggest question is what do you want to do about QT 4?

On Fri, Apr 25, 2014 at 1:02 AM, Marius Kintel notifications@github.comwrote:

I'm now building Mac snapshots using the new master branch and Qt5. I know
that Windows snapshots have been using unstable for a while. @donbrighthttps://github.com/donbrightis Windows already on Qt5?
@t-paul https://github.com/t-paul Is there anything missing in terms of
using Qt5 as default for Linux as well?


Reply to this email directly or view it on GitHubhttps://github.com/openscad/openscad/issues/252#issuecomment-41361437
.

Owner

kintel commented Apr 27, 2014

I'd say keep Qt4 compatibility as long as it's easy to maintain.

Member

donbright commented Apr 27, 2014

right, MXE win cross build now defaults to qt5.

qt5 can be selected on ubuntu 14.04 systems by the distro tools (apt-get install qt5-default) so i removed the old /opt/qt5 stuff from setenv-unibuild.sh as unneeded. people who want qt5 should upgrade to a distro that supports it. people who want qt4 can set their distro to use qt4 tools.

Member

donbright commented Apr 27, 2014

checked off the following with a few small commits ( using QT_SELECT for linux builds )

-Make Qt5 the default Linux development snapshot target
-Quick test on Windows
-Make Qt5 the default Windows development snapshot target
Owner

t-paul commented Apr 28, 2014

So should we switch uni-get-dependencies.sh to install qt5-default instead of qt4 to match the QT_SELECT=5 now too?

Owner

kintel commented Apr 28, 2014

I think so.

Member

donbright commented Apr 28, 2014

i dont agree. installing the 'qt5-default' package is essentially like changing a system-wide setting. some users might be unhappy with this if we do it automatically from a build-prep script.

Owner

t-paul commented Apr 28, 2014

Oh, it also sets it to be default for the system, I thought it's just the default dev package selection. So we need to add the qtbase5-dev, qtchooser, qt5-qmake, qtbase5-dev-tools? I can test that on my Ubuntu-VM...

Owner

t-paul commented Apr 29, 2014

Looks like installing qtbase5-dev is sufficient (Ubuntu 14.04).

kintel added a commit that referenced this issue May 12, 2014

Owner

kintel commented Jun 2, 2014

This looks relatively stable now, as a core feature. Some instabilities still exist, but Recommending 5.3+ would be a start.

@kintel kintel closed this Jun 2, 2014

@brianolson brianolson added the Bounty label Jun 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment