How to catch the line that emitted signal in Qt

Viewed 55

Code below is part of my program:

connect(dockObject, &QDockWidget::visibilityChanged, 
        [=](bool visible)
        {
            qDebug() << "Visibility:" << visible;
        });
dockObject->setVisible(false); // this line changed visibility so the visibilityChanged signal was emitted

And here is the terminal outputs:

Visibility: false
Visibility: true

Now my problem is : Visibility: true indicates that visibility of dockObject changed somewhere I don't know. I want to know which line changed it, is it possible?

0 Answers
Related