Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Support Qt 5 [$5] #252

Closed
brianolson opened this Issue · 22 comments

5 participants

@brianolson

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.

@donbright
Collaborator

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...

@kintel
Owner

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).

@kintel
Owner

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

@kintel
Owner

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.

@brianolson

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.

@kintel
Owner

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.

@t-paul
Owner

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."

@GilesBathgate

@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
@donbright
Collaborator

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.

@kintel
Owner

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 milestone: 2014 QX, 2014 Q1
@kintel kintel referenced this issue from a commit
@kintel kintel ifdef Qt5 method 57e2ecd
@brianolson brianolson added the Bounty label
@kintel
Owner

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?

@t-paul
Owner

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...

@donbright
Collaborator
@kintel
Owner

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

@donbright
Collaborator

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.

@donbright
Collaborator

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
@t-paul
Owner

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

@kintel
Owner

I think so.

@donbright
Collaborator

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.

@t-paul
Owner

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...

@t-paul
Owner

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

@kintel
Owner

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
@brianolson brianolson added the Bounty label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.