[SOLVED] Problem with Icon and Plist



  • Hello all!

    I am having a problem with Icon and Plist in Mac

    When I use just the icon in .pro my app shows the icon normally
    @
    #-------------------------------------------------

    Project created by QtCreator 2013-07-17T11:28:39

    #-------------------------------------------------

    QT += core gui
    QT += xml
    QT += printsupport

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = SwotGut
    TEMPLATE = app

    SOURCES += main.cpp
    mainwindow.cpp
    spinboxdelegate.cpp
    desabilitaselecaodelegate.cpp

    HEADERS += mainwindow.h
    spinboxdelegate.h
    desabilitaselecaodelegate.h

    FORMS += mainwindow.ui

    RESOURCES +=
    icones.qrc

    macx{
    ICON = icone.icns
    }
    @

    But when I define the Plist file, the icon does not appear when I run the app
    @
    #-------------------------------------------------

    Project created by QtCreator 2013-07-17T11:28:39

    #-------------------------------------------------

    QT += core gui
    QT += xml
    QT += printsupport

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = SwotGut
    TEMPLATE = app

    SOURCES += main.cpp
    mainwindow.cpp
    spinboxdelegate.cpp
    desabilitaselecaodelegate.cpp

    HEADERS += mainwindow.h
    spinboxdelegate.h
    desabilitaselecaodelegate.h

    FORMS += mainwindow.ui

    RESOURCES +=
    icones.qrc

    macx{
    QMAKE_INFO_PLIST = SwotGut.plist
    ICON = icone.icns
    }
    @


  • Lifetime Qt Champion

    Hi,

    Are you defining CFBundleIconFile in your plist ?


  • Moderators

    Did you make sure to put icone.icns in the Resources folder in your bundle? And did you rename your plist to Info.plist and place it in the Contents folder of the bundle?

    I.e.

    @
    SwotGot
    -> Contents
    -> Resources
    -> icone.icns
    -> Info.plist
    @



  • Yes. I figured it out. I changed the icon name in plist archive.

    Thanks.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.