Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting QT_DEBUG_PLUGINS fails

I have read this blogpost http://www.ics.com/blog/qt-tips-and-tricks-part-1 and tried to enable plugin debugging as described.

I've put this line in my main.cpp:

qputenv(QT_DEBUG_PLUGINS, 1);

But if I try to compile I'm getting this error:

.../src/main.cpp:14: error: 'QT_DEBUG_PLUGINS' was not declared in this scope
qputenv(QT_DEBUG_PLUGINS, -1);

What is the problem here and how do I have to do it right?

qputenv("QT_DEBUG_PLUGINS", QByteArray("1"));

But I don't get any additional output.

I'm using Qt5.5.1 with QtCreator 3.6 under KUbuntu 15.10.

like image 764
avb Avatar asked Sep 16 '25 16:09

avb


1 Answers

You're supposed to set env variable from outside your program, not from inside! It's very likely the plugin loading you're interested into already happened by the time you reach that line. Try putting it before creating a Q*Application object. – peppe

That's it. It was definitely set before plugin loading, but it seems to be important to set it before creating Q*Application as you wrote. Thank you. – avb

like image 123
Armali Avatar answered Sep 19 '25 06:09

Armali