Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-63320

QtDesigner does not create correct relative file path for icons in ui files

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: Not Evaluated Not Evaluated
    • None
    • 5.8.0, 5.9.1
    • Tools: Designer
    • None
    • macOS

      When using a file path icon from QtDesigner (ie, not a qrc resource nor a theme name), this produce wrong file path on macOS.

      For some reason, QtDesigner try to translate the file path relative to something (the app ?) instead of keeping the file path absolute and this relative file path is wrong.

      It seems it forget to prepend 3 cd up (coming from the macOS bundle).

       

      Original filepath: 

      /Users/pasnox/Pictures/Avatars/minitel.png - works

      QtDesigner filepath: 

      ../../../../../Users/pasnox/Pictures/Avatars/minitel.png - does not works

      Manually fixed filepath: 

      ../../../../../../../../Users/pasnox/Pictures/Avatars/minitel.png - works

       

      The uic generated code:

      QIcon icon;
      icon.addFile(QStringLiteral("../../../../../Users/pasnox/Pictures/Avatars/minitel.png"), QSize(), QIcon::Normal, QIcon::Off);
      setWindowIcon(icon);
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kleint Friedemann Kleint
            filipe.azevedo Filipe Azevedo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes