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
1
vote
0 answers

QtMessageHandler / QTextStream causes memory usage to go up?

I have installed a simple QtMessageHandler in my application: void handleMessage(QtMsgType type, const QMessageLogContext &context, const QString &msg) { QString text = msg; QString path = QCoreApplication::applicationDirPath() +…
Don Joe
  • 274
  • 4
  • 13
1
vote
2 answers

qDebug prints a wrong number

I'm just trying to print a number using qDebug as follows: qDebug() << QString::number(03001); But the result is: "1537" If I try to print without the first zero: qDebug() << QString::number(3001); The result is correct: "3001" Why does it…
KelvinS
  • 2,870
  • 8
  • 34
  • 67
1
vote
2 answers

Overloading QDebug in QT

In view.h file : friend QDebug operator<< (QDebug , const Model_Personal_Info &); In view.cpp file : QDebug operator<< (QDebug out, const Model_Personal_Info &personalInfo) { out << "Personal Info :\n"; return out; } after calling…
Jyo the Whiff
  • 829
  • 9
  • 23
1
vote
1 answer

Read qdebug within a test case?

In my test case, I want to assert that the output of qDebug() includes a certain string. For example, this is what my test looks like. Notice the "Bound to UDP port 34772" output from qdebug. Can I test that the substring 34772 exists in qdebug,…
Miles R
  • 41
  • 1
  • 4
1
vote
0 answers

qDebug() output is not visible on a terminal

I use UBuntu 12.04 LTS. When I run a console application using Qt Creator an output of qDebug() is not visible on a terminal (I get only an empty terminal with a cursor). How to fix that ? Edit1 Moreover I can't stop a program using a stop button, I…
Irbis
  • 11,537
  • 6
  • 39
  • 68
1
vote
2 answers

Segmentation fault when overloading QDebug::operator<<

I tried to overload QDebug::operator<< for std::string. I know that we can debug (using qDebug()) std::string objects using its std::string::c_str() function but I want to avoid typing .c_str each time. Here is my attempt #include #include…
Ashot
  • 10,807
  • 14
  • 66
  • 117
1
vote
1 answer

How to decide which QtMsgType message type to print

Is there any way to tell the application to print only qDebug or only qFatal messages?
B Faley
  • 17,120
  • 43
  • 133
  • 223
1
vote
3 answers

How to print all the raw data of QImage for comparisons in the memory?

I have two QImage objects which should be equal but the result of QImage::operator== is false. So I want to print all the raw data of the two objects for the comparison. How to do that? Can it be done with qDebug()?
UniversE
  • 555
  • 2
  • 7
  • 25
1
vote
0 answers

QDebug in friend method, with or without &?

I've been using an overload for QDebug with msvc2010 for a while: friend QDebug &operator<<(QDebug &debug, const UsingClass &uc) { debug << uc.stringForStreaming(); return debug; } However, under MinGW with gcc 4.6.2 this signature is not…
Horst Walter
  • 13,663
  • 32
  • 126
  • 228
0
votes
2 answers

Issues with qDebug and QString const reference

Have a class which have the following functions: FileInfoWrapper(const QFileInfo &_fileInfo) : fileInfo(_fileInfo) {} const QString& FileName() const { return fileInfo.fileName(); } But when I do this: QFileInfo info(somePath); qDebug() <<…
chikuba
  • 4,229
  • 6
  • 43
  • 75
0
votes
3 answers

How make qDebug to write method and class name?

I want to make the qDebug or qWarning method to write the class and method name that calling them.Now I writing like below but It is hard work for all class and method in my application.Does Any one know How can I do this? void…
mohsen
  • 1,763
  • 3
  • 17
  • 55
0
votes
2 answers

How to disable qInfo() output

I have follwing code snippet to run. In which I want to see result of qDebug() but I dont want see result of qInfo(). I want to configure it on basis, sowetimes I need those qInfo() output and sometimes not. qInfo()<<"Info print"; …
0
votes
1 answer

How can hex values of a QByteArray be shown without them being converted to ASCII characters

I have a short program that reads data from the serial port and stores it in a QByteArray. When I use qDebug() to show the contents of the array some of the hex values are shown as expected, eg. 0xB5 stays 0xB5, but others are changed to ASCII, eg.…
Koos
  • 91
  • 9
0
votes
0 answers

How to show every qDebug with new window?

I make a QT console program. I want to show every command by new window. How could I do that ?? main.cpp I use system is win10 with QT. #include #include //在文字視窗輸出文字功能函式 #include
0
votes
1 answer

How to enable qDebug::noquote inside qMessageHandler?

How to enable qDebug::noquote inside custom message handler in Qt? Without using qDebug().noquote() qDebug().noquote() << every time.
Joe Dea
  • 29
  • 2
  • 7