Qt5 not cooked....



  • I can't get the 'stable' tree to build on Mac 10.7.4, XCode 4.3.3. On Linux (Ubuntu 12.10, g++ 4.7.2), it builds, but the example tree is missing & trying to bring over Qt4 examples fails (see prior message.)

    Back to 4.8 until this really stabilizes out, I guess, & the example tree is filled in...


  • Moderators

    Qt 5 contains some changes and new features that make it incompatible with Qt 4, so you cannot "bring over" Qt 4 examples, unfortunately.

    Could you make do with the pre-compiled examples (http://qt-project.org/downloads ), or the written examples (http://qt-project.org/doc/qt-5.0/qtdoc/qtexamplesandtutorials.html )?



  • "Qt 5 contains some changes and new features that make it incompatible with Qt 4, so you cannot “bring over” Qt 4 examples, unfortunately."

    That does appear to be the case... implications for upgrading... hope this isn't going to be as bad as the 3 - 4 upgrade...

    I want to be able to build the examples. The writeups are a pain - not interested in cutting and pasting into project files. I need to get to work, not spend days fiddling with trying to pull all the pieces together to get a build.

    If the writeups exist, can't those sources be tar'ed up and made available somewhere?



  • What I found out is that opening an old project, setting up the new build settings and whatnot to Qt5, and the project fails with a score of errors.

    Starting a new project, copy and paste all files from the old project with no change at all - everything works just fine.


  • Moderators

    [quote author="rickbkis" date="1356793389"]"Qt 5 contains some changes and new features that make it incompatible with Qt 4, so you cannot “bring over” Qt 4 examples, unfortunately."

    That does appear to be the case... implications for upgrading... hope this isn't going to be as bad as the 3 - 4 upgrade...[/quote]There was a conscious effort to make the Qt 4 - 5 transition much nicer than the Qt 3 - 4 one, so there should be less effort required :)

    All the information you need should be available at http://qt-project.org/doc/qt-5.0/qtdoc/portingguide.html

    [quote]I want to be able to build the examples. The writeups are a pain - not interested in cutting and pasting into project files. I need to get to work, not spend days fiddling with trying to pull all the pieces together to get a build.

    If the writeups exist, can't those sources be tar'ed up and made available somewhere?[/quote]They are. If you download the pre-compiled library from http://qt-project.org/downloads , you'll find an "examples" folder containing all the official examples. In the git repo, each module also has an "examples" folder (e.g. https://qt.gitorious.org/qt/qtbase/trees/stable/examples ).

    The example subfolders contain projects that are ready-to-build; once you have Qt up and running, just load a .pro file and compile away.

    [quote author="utcenter" date="1356794298"]What I found out is that opening an old project, setting up the new build settings and whatnot to Qt5, and the project fails with a score of errors.

    Starting a new project, copy and paste all files from the old project with no change at all - everything works just fine.[/quote]Yes, that's because Qt Creator generates a Qt5-ready .pro file for you. That file contains, among other things, info on which modules to load. For a particular project, if simply copying+pasting the old code into a new project works, that means you should be able to finish the port by simply changing a few lines in your old .pro file



  • Well, shouldn't Creator fix the PRO file automatically or something?

    Perhaps a "Import Qt4 project" functionality that cares of those things.


  • Moderators

    [quote author="utcenter" date="1356796408"]Well, shouldn't Creator fix the PRO file automatically or something?

    Perhaps a "Import Qt4 project" functionality that cares of those things.[/quote]I don't think that's a viable option. My previous comment was only for the special case where you don't need to modify your source code at all, but there are plenty of cases where your source code will need modifications.

    Modifying your code for you is outside the scope of Qt Creator's role as an IDE, and it's unprofessional to provide a "Port Qt 4 Project to Qt 5" feature that only works some of the time.



  • But is it more unprofessional than providing nothing at all? Especially since it is actually doable, unlike porting the actual source code.

    This is the one and only line that fixed the project to be Qt5 compatible:

    @greaterThan(QT_MAJOR_VERSION, 4): QT += widgets@


  • Moderators

    [quote author="utcenter" date="1356798564"]But is it more unprofessional than providing nothing at all? Especially since it is actually doable, unlike porting the actual source code.

    This is the one and only line that fixed the project to be Qt5 compatible:

    @greaterThan(QT_MAJOR_VERSION, 4): QT += widgets@[/quote]That works for a "Qt Gui Application" only, but not the other project types supported by Qt Creator. IMHO, it doesn't make sense to bundle a tool that only works on a small subset of possibilities -- you'd then have to explain to users when they can/can't use the tool. And if users has to read something, why not let them read a short guide on how to port it themselves (which Qt does already provide, so it's not "nothing at all")?

    I do agree with you that automated porting would be very nice, but it's not the role of Qt Creator. We're going off-topic now, but someone made a start on a standalone tool for source code porting: http://www.kdab.com/automated-porting-from-qt-4-to-qt-5/


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.