bugGNU Octave - Bugs: bug #59813, Build failure with Qt4

 
 

bug #59813: Build failure with Qt4

Submitter:  None
Submitted:  Mon 04 Jan 2021 06:12:25 AM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  Fixed Assigned to:  None
Originator Name:  Kyle Guinn Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 6.1.0
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 06 Jan 2021 10:17:07 PM UTC, comment #14: 

Thanks for the reminder.  I pushed it here:

http://hg.savannah.gnu.org/hgweb/octave/rev/0348f3f57e3c

John W. Eaton <jwe>
Group administrator
Wed 06 Jan 2021 10:03:46 PM UTC, comment #13: 

So is it okay to push this patch to stable now?

Rik <rik5>
Group administrator
Tue 05 Jan 2021 06:26:24 PM UTC, comment #12: 

Good, first of all, the font selection during the first start seems still to be working on the stable branch with Qt4. Thanks for testing.

Setting the size to the system wide font size (at least, this is the intention) was only added to the default branch since it is highly probable that this won't work as expected on some of the large variety of systems. Have you manually reduced the font size on your system from 12 to 9 or 10 resp.? Could you please open a separate bug report on this issue?

Torsten Lilge <ttl>
Group Member
Tue 05 Jan 2021 06:03:34 PM UTC, comment #11: 

I was afraid to ask this here, because of "off topic" ;-) Anyway, in 29158:f28c657c9f42 there was a change, to choose system wide font settings on virgin start. When I delete the ini file and start Octave from the development branch + Qt15, the automatic font setting is "DejaVus Sans Mono 12". However, my system setting is either 9 or 10 (Monospace). Something doesn't fit there. However, I haven't had time to do any further research as to why it doesn't match.

I don't know if this fix made it into the stable branch as well. But when I delete the ini file and run the stable branch + Qt4 (comment #9), the font setting is "Liberation Mono 10", as it was in older Octave versions. For me the font size of 10 is much better than 12. 12 is too big.

Hg200 <hg200>
Tue 05 Jan 2021 05:39:07 PM UTC, comment #10: 

Thanks for testing. What happens when you (temp.) rename octaves ini-file? Is the selected font in the command window and the editor suitable?

Torsten Lilge <ttl>
Group Member
Tue 05 Jan 2021 08:10:07 AM UTC, comment #9: 

This also compiles here. make check has "0" fails. GUI also starts and I can create plots.

Hg200 <hg200>
Tue 05 Jan 2021 07:32:29 AM UTC, comment #8: 

OP here.  The v2 patch builds fine for me with Qt4.

Anonymous
Tue 05 Jan 2021 06:19:33 AM UTC, comment #7: 

I have tested with Qt5.

Torsten Lilge <ttl>
Group Member
Tue 05 Jan 2021 01:25:56 AM UTC, comment #6: 

Please try the attached version of the patch instead.



(file #50650)

John W. Eaton <jwe>
Group administrator
Mon 04 Jan 2021 10:09:03 PM UTC, comment #5: 

My system has both Qt4 and Qt5. But it seems to fail. What i did was:


hg update stable
patch -p1 < ../qt4-diffs.txt
./configure --prefix=/home/Octave/ --with-qt=4
 make -j 12

Build Octave Qt GUI:                  yes (version: 4)



libgui/src/octave-dock-widget.cc: In member function ‘void octave::octave_dock_widget::handle_settings(const octave::gui_settings*)’:
libgui/src/octave-dock-widget.cc:515:40: error: no matching function for call to ‘QVariant::canConvert(QMetaType::Type&)’
  515 |     if (dock_geom.canConvert (rect_type))
      |                                        ^
In file included from /usr/include/QtGui/qaction.h:48,
                 from /usr/include/QtGui/QAction:1,
                 from libgui/src/octave-dock-widget.cc:30:
/usr/include/QtCore/qvariant.h:233:10: note: candidate: ‘bool QVariant::canConvert(QVariant::Type) const’
  233 |     bool canConvert(Type t) const;


I have in config.h:


/* Define to 1 if `QRect' is a member of `QMetaType'. */
#define HAVE_QMETATYPE_QRECT 1

/* Define to 1 if `QString' is a member of `QMetaType'. */
#define HAVE_QMETATYPE_QSTRING 1


Is it possible that this happens when both Qt versions are installed?

@Torsten: Did you test with 4 or 5? You write 5.

Hg200 <hg200>
Mon 04 Jan 2021 08:28:28 PM UTC, comment #4: 

Thanks for the patch and sorry for not having checked for Qt4 compatibility of my patches which have caused the issues.

I can confirm that the patch is working with Qt5.

Torsten Lilge <ttl>
Group Member
Mon 04 Jan 2021 05:28:19 PM UTC, comment #3: 

OTOH, even if it is deprecated, we did still aim to allow building Octave 6.x with Qt4.  I'm attaching a draft patch.  I can't easily test with Qt4 now, so it would be great if the OP or someone else with Qt4 can try building with this patch and report the results.  I'm testing that it doesn't break the Qt5 build now.

(file #50647)

John W. Eaton <jwe>
Group administrator
Mon 04 Jan 2021 04:32:06 PM UTC, comment #2: 

The NEWS text is supposed to convey that no developer time will be spent on Qt4 as it is no longer supported on the development branch and there are many other claims on the limited number of Octave volunteer's time.

However, a fully functioning patch might be reviewed and applied.  Otherwise, the user might simply need to maintain their own patch atop the Octave sources.

Rik <rik5>
Group administrator
Mon 04 Jan 2021 11:25:33 AM UTC, comment #1: 

From the NEWS file in Octave 6:

> - The use of Qt4 for graphics and the GUI is deprecated in Octave
>  version 6 and no further bug fixes will be made.  Qt4 support will be
>  removed completely in Octave version 7.


I'm not sure what that exactly means though. Is Octave 6 supposed to compile successfully still with Qt4?

In any case, it is preferred to check for features instead of versions. So, it is probably more likely that your patch will be accepted if it added a configure check for these features and used the result of this check in the code.

Markus Mützel <mmuetzel>
Group administrator
Mon 04 Jan 2021 06:12:25 AM UTC, original submission:  

Two small errors when trying to build with Qt4.  (Yes I know it's deprecated, but I'm a Slackware user that's patiently waiting for a new release that ships with Qt5 as default.)


  CXX      libgui/src/libgui_src_libgui_src_la-octave-dock-widget.lo
libgui/src/octave-dock-widget.cc: In member function ‘void octave::octave_dock_widget::handle_settings(const octave::gui_settings*)’:
libgui/src/octave-dock-widget.cc:507:47: error: no matching function for call to ‘QVariant::canConvert(QMetaType::Type)’
     if (dock_geom.canConvert (QMetaType::QRect))
                                               ^


It looks like QMetaType is new in Qt5.  Before that it was QVariant::Rect.


  CXX      libgui/src/libgui_src_libgui_src_la-resource-manager.lo
libgui/src/resource-manager.cc: In member function ‘QString octave::resource_manager::get_default_font_family()’:
libgui/src/resource-manager.cc:245:26: error: ‘systemFont’ is not a member of ‘QFontDatabase’
       QFont fixed_font = QFontDatabase::systemFont (QFontDatabase::FixedFont);
                          ^
libgui/src/resource-manager.cc:245:53: error: ‘FixedFont’ is not a member of ‘QFontDatabase’
       QFont fixed_font = QFontDatabase::systemFont (QFontDatabase::FixedFont);
                                                     ^


The systemFont stuff first appeared in Qt 5.2.  In the attached patch I've copied over the old octave-5.2.0 behavior as a replacement.  I don't know how correct it is, but it builds and runs for me.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #50650:  qt4-diffs-v2.txt added by jwe (7KiB - text/plain)
file #50647:  qt4-diffs.txt added by jwe (6KiB - text/plain)
file #50639:  qt4.patch added by None (1KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hg200 (Posted a comment)
  • -email is unavailable- added by ttl (Posted a comment)
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-01-07 rik5 StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2021-01-06 rik5 CategoryGUI Configuration and Build System
        StatusNone In Progress
    2021-01-05 jwe Attached File- Added qt4-diffs-v2.txt, #50650
    2021-01-04 jwe Attached File- Added qt4-diffs.txt, #50647
    2021-01-04 None Attached File- Added qt4.patch, #50639

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code