PDA

View Full Version : [ubuntu[ Tree with qt



amreo
22nd August 2015, 16:02
I want to create a binary tree with QObject (NO QTREEWIEW) but i'm wrong:
The profondity is 10.
Read boo.h and boo.cpo
There is a method in boo.h, "void fill(int depth)" which called recursive to create sx and dx child elements to make tree like this:



/ S S S S
D
D S
D
D S S
D S D
D D S
D D D
D S S S
D
D S
D
D S S
D S D
D D S
D D D

ars
22nd August 2015, 17:53
Hello,

and what is your question? What do you get and what do you expect?

I have to guess a little bit: Your program compiles fine and when you run it on linux, you see only some debug messages output by your program, but not the tree you expect. Now let's have a look at QObject::dumpObjectInfo() documentation:

Dumps information about signal connections, etc. for this object to the debug output.

This function is useful for debugging, but does nothing if the library has been compiled in release mode (i.e. without debugging information).

Here library refers to the Qt library containing QObject. If you use Qt from your ubuntu repository, the Qt libraries are by default compiled in release mode and therefore, according to the documentation, you get no output. Note that this does not change if you build your code in debug mode!

I ran your program under Windows, where we have a set of debug and release libraries. Here I get the following output in debug build (for depth 3):


filling
Filled
OBJECT foo::unnamed
SIGNALS OUT
<None>
SIGNALS IN
<None>
foo::
foo::
foo::
foo::
foo::
foo::
foo::
dumped

Possibly not what you expected. You get information about signal/slot connection and not about your member objects. I'm afraid you have to write your own recursive dump function for outputting your S and D settings.

Best regards
ars

amreo
28th August 2015, 15:00
It's OK, I thinked the .dumpTree() doesn't show anything because the tree is empty