View Single Post
Posts: 1,548 | Thanked: 7,510 times | Joined on Apr 2010 @ Czech Republic
#26
You can use PyOtherSide and PDB !

I kinda wondered how to debug the Python part of a PyOtherSide application - I expected it would be difficult as the Python "backend" is loaded and started from Qt.

Then I got an idea - what about PDB ?

I though: "No way it would work out of the box, the input/output will probably end in /dev/null or worse."

But, well, it works just fine !

Just create a file named, say, pdb.qml:

Code:
import QtQuick 2.0
import io.thp.pyotherside 1.0

Rectangle {
    color : "green"
    width : 640
    height : 480
    Text {
        text : "hello PDB!"
    }

    Python {
        id : python
        Component.onCompleted: {
            importModule('pdb', function() {
            call('pdb.set_trace()')
            })
            }
        onError: {
            // when an exception is raised, this error handler will be called
            console.log('python error: ' + traceback);

        }
    }
}
And run it with qmlscene:
Code:
qmlscene pdb.qml
And voila, pdb will be started in the shell you just used to start qmlscene.
__________________
modRana: a flexible GPS navigation system
Mieru: a flexible manga and comic book reader
Universal Components - a solution for native looking yet component set independent QML appliactions (QtQuick Controls 2 & Silica supported as backends)

Last edited by MartinK; 2013-10-12 at 17:16.
 

The Following 4 Users Say Thank You to MartinK For This Useful Post: