[Interest] QT Android: qApp->applicationName() returning lib name even after settings QCoreApplicaton::setApplication name

Benjamin TERRIER b.terrier at gmail.com
Thu Sep 29 22:41:43 CEST 2016


Hi,

QGuiApplication::setApplicationName() does not exist. If you call it
you will call QCoreApplication::setApplicationName().
So that is not your problem.

One explanation for your "bug" would be that you call
qApp->applicationName before you call
QCoreApplication::setApplicationName.
To check, I suggest you call QCoreApplication::setApplicationName in
your main() before doing anything else.

BR,

Benjamin

2016-09-29 22:04 GMT+02:00 Nuno Santos <nunosantos at imaginando.pt>:
> Thiago,
>
> Thanks for your reply.
>
> Is there any specific place to call this? I’m calling at my main controller constructor
>
> This is my main.cpp
>
> int main(int argc, char **argv)
> {
>     QGuiApplication app(argc, argv);
>
>     Controller controller(&app);
>
>     QQmlApplicationEngine engine;
>     engine.rootContext()->setContextProperty("controller", &controller);
>     engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
>
>     return app.exec();
> }
>
> This is controller constructor:
>
> Controller::Controller(QObject *parent) :
>     QObject(parent)
> {
>     QCoreApplication::setOrganizationName("Imaginando");
>     QCoreApplication::setApplicationName("TKFX");
> }
>
> Since my app is contracted with QGuiApplication, should I call QGuiApplication::setApplicationName instead? Might that be the problem?
>
> Thanks,
>
> Regards,
>
> Nuno
>
>> On 29 Sep 2016, at 19:48, Thiago Macieira <thiago.macieira at intel.com> wrote:
>>
>> On quinta-feira, 29 de setembro de 2016 18:57:01 PDT Nuno Santos wrote:
>>> Hi,
>>>
>>> I’m facing myself with a simple problem.
>>>
>>> I’m settings QCoreApplication::setApplication(NAME) but when I ask for
>>> qApp->applicationName, the result is a libTARGET.so
>>>
>>> Isn’t it supposed to set the name to NAME?
>>
>> It is and it does that. Your problem is elsewhere.
>>
>> --
>> Thiago Macieira - thiago.macieira (AT) intel.com
>>  Software Architect - Intel Open Source Technology Center
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list