Discussion:
No output from qDebug in run tool subwindow
Hartmut Riesenbeck
2018-06-14 11:02:50 UTC
Permalink
Hi all,

Since update to KDevelop 5.2.3 there is no output from qDebug() in the run
tool output subwindow for normal program execution of cmake projects. In
debug mode qDebug prints to the debug subwindow. If I start the program in the
konsole subwindow it also prints the qDebug output correctly.

Interestingly, it works for qmake projects as expected.

Is qDebug output configurabel somehow? Or is the wanted behavior of KDevelop?
I tryed already to play with QT_LOGGING_RULES env var. But that changed
nothing.

Thanks
Hartmut
Kevin Funk
2018-06-14 11:42:36 UTC
Permalink
Post by Hartmut Riesenbeck
Hi all,
Since update to KDevelop 5.2.3 there is no output from qDebug() in the run
tool output subwindow for normal program execution of cmake projects. In
debug mode qDebug prints to the debug subwindow. If I start the program in
the konsole subwindow it also prints the qDebug output correctly.
Heya Hartmut,

this is odd. Can you share the source code of the project where this is
happening? Does it happen for all CMake-based projects for you?

Note: This works fine for me.

Regards,
Kevin
Post by Hartmut Riesenbeck
Interestingly, it works for qmake projects as expected.
Is qDebug output configurabel somehow? Or is the wanted behavior of
KDevelop? I tryed already to play with QT_LOGGING_RULES env var. But that
changed nothing.
Thanks
Hartmut
--
Kevin Funk | ***@kde.org | http://kfunk.org
Hartmut Riesenbeck
2018-06-14 13:31:01 UTC
Permalink
Post by Kevin Funk
this is odd. Can you share the source code of the project where this is
happening? Does it happen for all CMake-based projects for you?
Heya Kevin,

I noticed this behavior in all my other CMake-based projects. I created
already a little test project which shows the problem.

-- CMakeLists.txt --------------------------

cmake_minimum_required(VERSION 2.8.11)
project(qdebug_test)
find_package(Qt5Core CONFIG REQUIRED)
add_executable(qdebug_test qdebug_test.cpp)
target_link_libraries(qdebug_test Qt5::Core)

---------------------------------------------------

-- qdebug_test.cpp -----------------------

#include <QtGlobal>
#include <iostream>

int main()
{
qDebug("Hello word from qDebug!");
std::cout << "Hello word from std::cout!" << std::endl;
std::cerr << "Hello word from std::cerr!" << std::endl;
return 0;
}

---------------------------------------------------

Cout and cerr output is printed and qDebug not. This behavior is shown on all
three machines I work on (openSUSE Tumbleweed).

Regards,
Hartmut

Loading...