Results 1 to 2 of 2

Thread: Pick correct include file between Qt4 and Qt5

  1. #1
    Join Date
    Jan 2012
    Posts
    10
    Thanks
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Pick correct include file between Qt4 and Qt5

    Hello,

    I want to load the correct qwt.prf file based on the Qt version. The following code in the .pro file loads both the Qt4 and Qt5 files.
    Qt Code:
    1. lessThan(QT_MAJOR_VERSION, 5) {
    2. message("qt4")
    3. include (/usr/share/qt4/mkspecs/features/qwt.prf)
    4. }
    5.  
    6.  
    7. greaterThan(QT_MAJOR_VERSION, 4) {
    8. message("qt5")
    9. include (/usr/lib64/qt5/mkspecs/features/qwt.prf)
    10. }
    To copy to clipboard, switch view to plain text mode 

    Is there any way to make this work?

  2. #2
    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: Pick correct include file between Qt4 and Qt5

    If two sections are exclusive with each other, you can do "else"

    Qt Code:
    1. lessThan(QT_MAJOR_VERSION, 5) {
    2. } else {
    3. }
    To copy to clipboard, switch view to plain text mode 

    Cheers,
    _

Similar Threads

  1. Replies: 2
    Last Post: 21st March 2014, 18:53
  2. Replies: 1
    Last Post: 23rd May 2011, 04:53
  3. Replies: 0
    Last Post: 23rd March 2011, 10:34
  4. Replies: 3
    Last Post: 1st November 2010, 16:33
  5. Replies: 4
    Last Post: 9th May 2010, 16:18

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.