Qdebug problem



  • Having problem with qdebug displaying qstring.
    Same problem on previous relases and it says <not accessible>.
    How to solve this problem?


  • Moderators

    Where and what does say that? Which Qt version are you using? Which IDE? Did you include both <QDebug> and <QString> ? Can you show a sample code that produces it?
    When specifying a problem please provide as much information as possible. It's hard to answer "how to solve this problem" when problem is not well defined.



  • Version is Qt Creator 3.3.1 (opensource), problem occurs on floating window and right side list in debug mode if breakpoint has paused execution.

    Tryed if including <QDebug> and <QString> changes outcome but no luck.

    No code appears to not show data of qstrings for some reason but qdebug text output works.


  • Moderators

    @Q139 It would be better when show the code lines affected. Otherwise we need crystal ball reading, which is typically not very accurate.



  • @koahnig
    Problem is independant of code.
    For example

    QString strq = "eee";

    debug wont show eee , instead displays <not accessible>



  • @Q139
    Here is a code that uses QString and QDebug and it displays the string in a terminal. Could you try to run it and tell us what do you see in a terminal

    qdebug-problem.pro

    QT -= gui
    TARGET = qdebug-problem
    CONFIG += console
    CONFIG -= app_bundle
    TEMPLATE = app
    SOURCES += main.cpp
    

    main.cpp

    #include <QDebug>
    #include <QString>
    int main(int, char**)
    {
        QString strq = "eee";
        qDebug() << strq;
        return 0;
    }
    

    Here is a debug window of qtcreator
    Debug Window



  • @Q139 What OS and what compiler do you use?



  • Sorry for long response ,
    Running windows 7 Pro and mingw compiler.
    In terminal all works perfect , problem mostly is with floating window or variables tab on right under debug.
    Sometimes floating window turn gray and hard to see content,
    Probably will install linux version of qt also if it very stable.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.