bugGNU Octave - Bugs: bug #40252, Make GUI compatible with both Qt4...

 
 

bug #40252: Make GUI compatible with both Qt4 and Qt5

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Sat 12 Oct 2013 07:40:35 PM UTC  
 
Category: Configuration and Build SystemSeverity: 2 - Minor
Priority: 5 - NormalItem Group: Feature Request
Status: PostponedAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating System: Any

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sat 21 Feb 2015 10:11:35 PM UTC, comment #10:

Yeah, that's probably a good idea.

I don't even see a moc-qt5 on my Debian system with both Qt4 and Qt5. Instead Debian uses a package called qtchooser to dispatch to one of the two versions.

Mike Miller <mtmiller>
Project Member
Sat 21 Feb 2015 10:06:54 PM UTC, comment #9:

Currrently, configure looks for qmake-qt5, then qmake-qt4 and then qmake, the same with the other qxxxx tools.

Since it is not working for qt5 (yet) should qt5 be taken from the configure checks?

John Donoghue <lostbard>
Project Member
Sat 21 Feb 2015 08:25:20 PM UTC, comment #8:

I've got this partially done, but the hard part of this bug is the configuration part. When do we decide to use Qt 4 or Qt 5? Automatically prefer Qt 4 and fall back to Qt 5 if 4 isn't working, or vice versa? Or supply a user option to pick one or the other?

We will need different sets of pkg-config modules for each (e.g. QtGui vs Qt5Gui), potentially different sets of helper programs (e.g. moc-qt4, moc-qt5, or just moc).

Since I think all distributions will continue to have Qt 4 for a long time to come, I'm going to put this off until after the 4.0 release.

Mike Miller <mtmiller>
Project Member
Tue 03 Feb 2015 04:30:25 PM UTC, comment #7:

Thanks, I will do what I can.

I don't think any distros are shipping Qt 5 to the exclusion of Qt 4, but please do comment here if I'm wrong. Fedora 21, Ubuntu 14.10, and RHEL 7 all offer Qt 5 as an option, but Qt 4.8 is also provided. So I don't think it's as important as other bugs, but would be nice to release with at least the possibility to build against Qt 5.

Mike Miller <mtmiller>
Project Member
Tue 03 Feb 2015 04:00:31 PM UTC, comment #6:

@Mike: I marked this bug as In Progress. I just checked and Fedora 21 and Ubuntu 14.10 are both shipping with Qt5 so I think this is important to resolve for the next release.

Rik <rik5>
Project Administrator
Tue 03 Feb 2015 04:43:25 AM UTC, comment #5:

I revisited this bug again for a little bit tonight. I made some headway, and finally got Octave to build against Qt 5.3.

Attaching a diff of all the quick-n-dirty changes I had to make. Some of these are backwards compatible with Qt 4, some of these are new or renamed functions in Qt 5, some will need #ifdefs, etc. But it does compile and the GUI does come up.

I'm willing to pick this up again and work out the remaining issues, just wanted to share what I have for now.

Also worth noting that I had to manually mess with the include and library flags. So configure.ac will need some work as well, not included in this diff at all yet.

(file #32978)

Mike Miller <mtmiller>
Project Member
Sun 07 Dec 2014 07:06:03 AM UTC, comment #4:

Until this is done, can the Qt5 detection in configure.ac be turned off?

http://slackbuilds.org/slackbuilds/14.1/academic/octave/patches/no-qt5.diff

Anonymous
Sat 02 Nov 2013 01:32:46 AM UTC, comment #3:

Many more errors, a handful of member functions have been deprecated or removed with Qt5. I haven't gotten all the way through it yet, but here's a sample of what I've worked through so far:

And the appropriate pkg-config modules are (at least on Debian):

Marking as postponed for now, this looks pretty disruptive and unnecessary at this point in time.

Mike Miller <mtmiller>
Project Member
Fri 01 Nov 2013 08:15:41 PM UTC, comment #2:

Off the top of my head, I remember that the pkg-config files are named Qt5Gui, etc. I don't have it in front of me at the moment to check what else there was. I got around the different build flags by setting the QT_CPPFLAGS and QT_LIBS manually to get to the point I did before. I will try to recreate that build with your fix a little later today and see how far it gets me this time.

I can at least try to get a better idea of the full scope of what is needed so you can decide if this is something you want to try to address before the release. I saw this as more of a down-the-road goal, I don't know of any distros that are using Qt5 by default yet.

Mike Miller <mtmiller>
Project Member
Fri 01 Nov 2013 08:00:40 PM UTC, comment #1:

I fixed the include statements in this changeset:

http://hg.savannah.gnu.org/hgweb/octave/rev/2de613986374

What are the other issues? Woud you like to add them here or open separate reports about them?

John W. Eaton <jwe>
Project Administrator
Sat 12 Oct 2013 07:40:35 PM UTC, original submission:

The GUI does not compile with Qt5 currently. There are several issues ranging from include file compatibility to detecting the helper utilities and CPPFLAGS and LIBS correctly in configure.ac.

I got as far as hacking the results of configure to look at the right paths, but the changes in header files between Qt4 and Qt5 is blocking me from getting any further. The recommendations I've seen for compatibility are to not include the Qt module in #include statements, so for example use

instead of

We have quite a few of the latter variety of includes, especially in the libqterminal directory.

Mike Miller <mtmiller>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #32978:  oct-qt5.diff added by mtmiller (12kB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by lostbard (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by mtmiller (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 21 Feb 2015 08:25:20 PM UTCmtmillerStatusIn Progress=>Postponed
    Tue 03 Feb 2015 04:00:31 PM UTCrik5StatusPostponed=>In Progress
    Tue 03 Feb 2015 04:43:25 AM UTCmtmillerAttached File-=>Added oct-qt5.diff, #32978
    Sat 02 Nov 2013 01:32:46 AM UTCmtmillerStatusNone=>Postponed
    Sat 02 Nov 2013 01:32:45 AM UTCmtmillerSeverity3 - Normal=>2 - Minor

    Back to the top


    Powered by Savane 3.1-cleanup