Qt 5.0.2 Trace inside Qt source code

  • hello,

    I'm trying to trace inside Qt code. I did download qt sources and add it from qt creator. However i can set into qt source code.
    Thankx for your help

  • you would need to compile the src with -debug option, or better with the developer option -developer-build in configure

    http://harmattan-dev.nokia.com/docs/library/html/qt4/configure-options.html options for Qt4, not sure where they are for Qt 5, but check also here:


  • I did try to build qt from git but i'm stuck when i try to init-repository. It gave me this error :
    "GetOptionsFromArray" is not exported by the Getopt::Long module
    Can't continue after import errors at init-repository line 203
    BEGIN failed--compilation aborted at init-repository line 203.
    . i tried to Google it, i found that i'm using a wrong version of perl, although i installed the latest version of it.

  • Compiling from source is quite a drag. If you're starting I'd suggest you get the latest installed in the Download section. It's compiled with Debug info.

    Anyway, why do you need to trace inside Qt source code? You should only have to trace inside your code, unless you're developping the API yourself.

  • My problem is that i'm using a progress bar wen i try to set its value the second time. it give me a segmentation fault. So i want to see what is going on? why the first setvalue() is working and not the second? and they are running in same thread (thread 1).

  • Lifetime Qt Champion


    Without some code it's a bit hard to help you, could you show us ?

  • hello,

    i can't give the code but i'll explain to you,

    so i have a mainwindow with a progressbar in the status bar, and in another class i'm calculating the value of the progress bar the send it by a signal:
    connect(this, SIGNAL(barValueChanged(int )), wind , SLOT(setNewValue(int ))); and i emit the signal :
    emit barValueChanged(newValue);
    and in the mainwindow the slot set the value of the progressbar :
    void MainWindow::setNewValue(int val){
    test->setValue(val); // test is the name of my progressbar
    the signal triggers the signal correctly, but when executing "setValue" it give me a segmentation fault.
    So thats my problem, if you need more infos just tell me. And also it would be great if you can show me how to trace in side qt source code.

  • Lifetime Qt Champion

    Does test point to a valid object ?

  • ill check now !! thankx dor your fast answer

  • Hi again,

    i checked the test pointer. So it is different, when i creat the progress bar the address is 0x561ea7a and when the slot is triggered it point to 0x16c3b850. Normaly it should point to the same place right ?

  • Lifetime Qt Champion

    Where do you initialize it ? Do you create it multiple times ? Do you delete it ?

  • i create it in the constructor once and i dont delete it.

  • hi again after doing some research i did this :
    void MainWindow::testvaluechanged(int val){

    and its working now!!

  • Lifetime Qt Champion

    Please, enclose your code with code tags, it will make it readable.

    This workaround seems a bit fishy even if it works

  • Hi again,

    i want it to thank you for your help. For the solution i also find it fishy. But i want to tell you that i create a multiple progressdialog. I ll explain : i have a class and i create several objects of it, so each one has his own progressdialog. And i double checked the pointer is valid (my mistake). so do you think that can be where the problem is coming from ?

Log in to reply

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