Results 1 to 9 of 9

Thread: qmake doesn't like image files starting with "r"

  1. #1
    Join Date
    Mar 2007
    Posts
    58
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default qmake doesn't like image files starting with "r"

    Qt 4.2.3 Windows open source edition.

    In my *.pro file I have something like this:

    IMAGES = icons/icon1.png \
    icons/resize.png \
    ....

    Well, make fails with a "missing separator" error. This is because qmake created a wrong Makefile.Release.

    In the Makefile.Release, instead of icons\resize.png appears:
    icons
    esize.png

    It seems that the "\r" characters in "icons\resize" is interpreted as a line break.

    This problem happens too with filenames starting with "t" and "n" (\t \n).

    So I can't have any files starting with "r", "t" or "n" in the IMAGES section of the pro file.

    I tried writing it "icons\resize.png", "icons//resize.png", "icons\\resize.png", nothing... the same result.

    Is this a bug or am I doing something wrong?

    (This problem doesn't occur in linux)

  2. #2
    Join Date
    Feb 2007
    Location
    Philadelphia, USA
    Posts
    255
    Thanks
    43
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qmake doesn't like image files starting with "r"

    I believe that "IMAGES" is not a qmake variable for qt4.
    Use RESOURCES instead.

    For example,
    RESOURCES += myresources.qrc
    and then in myresources.qrc you could have something like
    Qt Code:
    1. <RCC>
    2. <qresource prefix="/" >
    3. <file>icons/icon1.png</file>
    4. <file>icons/resize.png</file>
    5. </qresource>
    6. </RCC>
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Mar 2007
    Posts
    58
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake doesn't like image files starting with "r"

    Yes, but I'm developing a Qt 3 program which I need to compilable with Qt 4 too.

    So I need to use IMAGES.

  4. #4
    Join Date
    Feb 2007
    Location
    Philadelphia, USA
    Posts
    255
    Thanks
    43
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qmake doesn't like image files starting with "r"

    You can split into two cases using something like:

    Qt Code:
    1. QT_VERSION=$$[QT_VERSION]
    2. contains( QT_VERSION, "^4.*" ) {
    3. RESOURCES += ...
    4. }
    5. else {
    6. IMAGES += ...
    7. }
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake doesn't like image files starting with "r"

    Use forward slashes (/) instead of backward slashes (\) as path separators, for instance "images/resize.png".

  6. #6
    Join Date
    Mar 2007
    Posts
    58
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake doesn't like image files starting with "r"

    Actually I already use forward slashes (/) for paths (the program is developed in linux) but qmake converts them to "\" when creates the makefile.

    qmake in linux (using the same version, 4.2.3) works perfectly. It seems to be a bug in the windows version of qmake.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake doesn't like image files starting with "r"

    Does qmake from Qt3 convert slashes to backslashes as well?

  8. #8
    Join Date
    Mar 2007
    Posts
    58
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qmake doesn't like image files starting with "r"

    I don't have Qt 3 in Windows.

    In Linux, of course, it does not.

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake doesn't like image files starting with "r"

    So if you don't compile with Qt3 under Windows, maybe you could simply wrap your IMAGES variable into a scope that Windows will ignore?

    unix {
    IMAGES += ...
    }

Similar Threads

  1. Replies: 4
    Last Post: 7th April 2010, 23:09
  2. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  3. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15
  4. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36
  5. QMake / headers / lot of files
    By jcr in forum Qt Programming
    Replies: 7
    Last Post: 10th January 2006, 12:06

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
  •  
Qt is a trademark of The Qt Company.