Results 1 to 4 of 4

Thread: qt4 uic uses qt5 function

  1. #1
    Join Date
    Jun 2015
    Location
    California, USA
    Posts
    61
    Thanks
    43
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11

    Default qt4 uic uses qt5 function

    I recently unchecked 'translatable' for the currentText property of a combobox in the ui designer.
    Someone else noted that Qt 4.8.6 for Ubuntu decided to to create a ui_ file that has setCurrentText, which is not in Qt4;
    therefore, it fails to build.

    Is this a Qt problem, Ubuntu package issue or am I missing something?

    The only solution I can think of is to manually remove the currentText property from the .ui file.

    https://github.com/LibreCAD/LibreCAD/issues/697

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: qt4 uic uses qt5 function

    It is possible that the version of Qt Designer / Qt Creator that is being used to create the UI file is a Qt5 version. Look in the install directory to see if it contains Qt5 libraries. If you have both Qt4 and Qt5 versions installed, make sure that the Qt4 version of Qt Designer is the one being used for the Qt4 UI editing.

  3. #3
    Join Date
    Jun 2015
    Location
    California, USA
    Posts
    61
    Thanks
    43
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11

    Default Re: qt4 uic uses qt5 function

    I'm using Qt 5.6.0

    The person reporting the problem is simply trying to build using Qt 4.8.6

    I also thought that they might be using the Qt5 uic somehow... but they don't think so.


    Added after 9 minutes:


    I would expect the Qt4 uic to ignore the currentText property.
    Why would the Qt4 uic create ui_ files that use a Qt5 function (setCurrentText)?
    This seems like a Qt bug, unless the reporter's Ubuntu package is using the Qt5 uic.
    Last edited by ravas; 16th April 2016 at 23:40.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: qt4 uic uses qt5 function

    My guess would be that UIC doesn't necessarily know the classes, i.e. it has to be able to deal with custom widgets, or widgets derived from standard widgets ("promote widget" functionality in designer).

    So when it encounters a property value assignment, it might simply assume that the setter for the property is set + property name as this is true for all of Qt's built-in properties.

    So in this case the problem is that the developer used a Qt5 based designer and set a property value for something that is not a settable property in Qt4.
    The fix is to not do that.

    To avoid that in the future, using the Qt4 based designer would be recommendable.

    Cheers,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    ravas (17th April 2016)

Similar Threads

  1. Replies: 2
    Last Post: 2nd December 2013, 05:43
  2. pass member function as argument int template function
    By bibhukalyana in forum General Programming
    Replies: 1
    Last Post: 12th March 2013, 08:05
  3. Replies: 11
    Last Post: 5th September 2012, 21:47
  4. Replies: 4
    Last Post: 2nd August 2012, 08:42
  5. Replies: 0
    Last Post: 10th March 2010, 09:13

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.