Questions tagged [qdebug]

The QDebug class, part of the Qt framework, provides an output stream for debugging information.

Documentation can be found here

99 questions
2
votes
1 answer

Replace logging backend for console.debug() console.warn()

Qt Quick uses qDebug to perform logging, where the standard Javascript logging methods are maped to a Qt log type console.log() -> qDebug() console.debug() -> qDebug() console.info() -> qDebug() console.warn() -> qWarning() console.error() ->…
Simon Warta
  • 10,850
  • 5
  • 40
  • 78
2
votes
4 answers

Collect user input using qDebug

I have been wondering if it is possible to collect user input using the qDebug() statement in Qt C++. I tried do it like in the std C++ code like: qDebug() >> myvar; but it didn't work. How can I read from stdin using Qt?
2
votes
4 answers

Where is located the qDebug qWarning qCritical and qFatal log by default on Qt?

When running my Qt5 application on linux, I don't see any output from qDebug, qWarning, qCritical or qFatal. I know that I can use qInstallMsgHandler to install a message handler and see them, but this is rather heavyweight. I just want to check the…
Mildred
  • 3,887
  • 4
  • 36
  • 44
2
votes
2 answers

qSin() giving wrong sin values?

I have the code: for(int i = 0; i < 314; i++){ float nextSine = aSin(i/5); qDebug() << "i: "<
JVE999
  • 3,327
  • 10
  • 54
  • 89
2
votes
2 answers

Qt Console Application - Terminal Won't Stay Open [In Ubuntu]

I recently began developing in Qt, but I am having an issue with console projects. When I run my program (Console Program), terminal opens and then immediately closes so I cannot see the output. Here is the code that I am using: #include…
foobar5512
  • 2,470
  • 5
  • 36
  • 52
1
vote
2 answers

How to get the precise value from QJsonObject?

I have made code below. i want correct value as 44112.25895 but result value is 44112.3 how can i fix this issue? QJsonObject qj{ {"close", 44112.25895} }; qDebug() << qj; QJsonValue qjv = qj.value("close"); qDebug() << qjv; qDebug() <<…
1
vote
1 answer

qDebug dosen't print anything when using vscode

I tried to use VSCode to code Qt program,but function qDebug doesn't print anything in console when debugging a Qt program in VSCode.However it works correctly when using QtCreator.By the way,Qt program is built by cmake in vscode. I tried to place…
Rascal
  • 11
  • 1
1
vote
1 answer

Can not surpress QDebug output in relesae build

I work on a Qt project and I use cmake. In my CMakeLists.txt I have: target_compile_definitions(${PROJECT_NAME} PUBLIC QT_DEBUG_NO_OUTPUT QT_NO_INFO_OUTPUT QT_NO_WARNING_OUTPUT ) and to test that in my main.cpp I…
DEKKER
  • 877
  • 6
  • 19
1
vote
2 answers

QT_MESSAGE_PATTERN not works over raspberry pi crosscompile

I adjust the QT_MESSAGE_PATTERN on build environment both for pc and raspberry. When I did a run on pc, debug gives me an output as I adjusted but when a did a run on raspberry pi (deployment) , debug gives me an output like I didn't adjust.... here…
bladekel
  • 37
  • 7
1
vote
0 answers

QFile.read() value into qDebug() into QDataStream

I was wondering why : QString MainWindow::getFileText(QString filename) { QFile test(filename + ".txt"); // The file who gets written into QFile file(filename); // The executable I am reading QDataStream in(&test); …
Nox
  • 713
  • 7
  • 16
1
vote
1 answer

Logs via qDebug() are invisible when run via docker-compose

I have written a Qt application which logs to console via qDebug(). When run inside a docker container, the application logs are visible as normal. But when the same docker image is run via docker-compose up, there is no output visible at all. How…
JaM
  • 549
  • 4
  • 15
1
vote
1 answer

No such file or directory #include

Why I got an error: I use Qt Creator. Version Qt 5.9.7 for Desktop Output:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 23:02:13: Uruchamianie "/usr/bin/make" g++ -c -pipe -g -std=gnu++11 -Wall -W…
AlinaChuj
  • 27
  • 1
  • 5
1
vote
1 answer

Qt debug feed keep spaming newline

I have a problem with the debug feed in QtCreator, it keep spamming newline caracters. If I remove all qDebug() call in my code it works fine and output nothing. But if call qDebug once (like qDebug() << "test"; at the start of main for example) it…
Le Moisso
  • 11
  • 2
1
vote
0 answers

in >> qstr or qstr = in.readLine()

I want to find alternative for cin >> #include #include #include int main(){ qDebug() << "Test start"; QTextStream in(stdin); QString qstr; qstr = in.readLine(); qDebug() << "Test end"; } Also…
sardorkun
  • 87
  • 2
  • 11
1
vote
1 answer

Prevent qDebug() from writing to std output

I am using qDebug(), qInfo() and so on in combination of qInstallMessageHandler to write my logfiles. I also get an output on my batch screen, when executing my application. I only found QT_NO_DEBUG_OUTPUT, but I want to toggle this configuration…
Daniel Müller
  • 741
  • 1
  • 7
  • 14