J-P Nurmi
Could you please do somewhere in MyClass after creating all the labels and other child widgets:
and paste the output?
J-P Nurmi
Okay I'm not sure if I came across clearly. I have made another screenshot and this time, I have changed all the German words to English for better understanding. Also, the first time around I did not show all of the windows that my application so far has. Here is the new and complete screenshot:
http://img502.imageshack.us/img502/4...icture2nf4.png
As you can see, the red text could really be anything. Anything you type in. It could also be another color if you want to. In any case, I definitely need it to be freely movable. Up, down, left, right, you name it. So it cannot be part of a layout, as it seems. All the other widgets - Memory, CPU, I/O Unit, Bus, Arrows - however can and in fact, are.
Now, the problem remains: How can I achieve it so that the QLabel gets drawn on top of the other widgets? Calling raise() did not lead to success so far.
Also,
Would the output of that command happen to be found in the directory which is named "debug"? Then I fear that my Qt library is maybe not compiled for debugging, because that directory is empty always.
No, I was referring to the debug output. IDEs tend to show the debug output. If you're not using any IDE, on Windows you will have to add
in the .pro file, regenerate makefile and rebuild the application. An external console is launched together with the application from which you can see the debug output. Alternatively, you can use such utilities as DebugView to monitor the debug output.CONFIG += console
J-P Nurmi
I dont know whether I understood your problem correctly. When you move QLabel, do you want it to be seen at top of other widgets. i.e whenever QLabel has a mouse on it, QLabel should be seen at top of other widgets. If that is what you are looking for then have a look at Examples->QWidgets->ToolTips. Might help.
Thanks
I want this QLabel to be in front of the other QWidgets all of the time.
I think my problem boils down to this: If you have two QWidgets that overlap, how do you control which one of the two is in the foreground? This seems to be complicated by the fact that the one QWidget (the QLabel which must be freely movable) is not part of a layout, while the other QWidgets (which are supposed to be visible, but "behind" the moving QLabel) are.i.e whenever QLabel has a mouse on it, QLabel should be seen at top of other widgets. If that is what you are looking for then have a look at Examples->QWidgets->ToolTips. Might help.
No, re-compiling Qt is not necessary. Sorry, I have no idea what's the problem with no text appearing, though. Did you clean and rebuild the whole project?
It's all about parenting widgets correctly.The order of sibling child widgets can be changed with raise() and lower() as mentioned in the beginning of the thread.
Edit: This is why I asked for dumpObjectTree() output. It will show the actual hierarchy of the object tree.
J-P Nurmi
Yes, I deleted the "release" directory and compiled it from scratch. I don't use a fancy IDE, just Vim 7.0 (gvim) as the editor and compiling at the console. Old school!![]()
Maybe I could redirect the stderror output to a file?
EDIT:
I just realised that I made a mistake. For the QLabel, instead of doing this:
I had left out the "this", thus making the QLabel not a child Widget of the application window.Qt Code:
To copy to clipboard, switch view to plain text mode
But still, even now that I have changed it, calling raise() seems to do nothing at all. Of course, there is always the possibility that I am making another stupid mistake...![]()
Last edited by Mister_Crac; 4th May 2007 at 19:04.
Okay, so I finally managed to call dumpObjectTree() and get an output. Turns out that indeed my Qt was not compiled for debugging, but now it is. Here is what I get, I simplified it because the output was so long. Look at this screenshot to see how it looks now - and still my QLabel is in the background. :-(
Qt Code:
Rechner:: QWidget:: QLabel:: QTextDocumentLayout:: QTextImageHandler:: QLabel:: QTextDocumentLayout:: QTextImageHandler:: QLabel:: QTextDocumentLayout:: QTextImageHandler:: QLabel:: QTextDocumentLayout:: QTextImageHandler:: QLabel:: QTextDocumentLayout:: QTextImageHandler:: QLabel:: QTextDocumentLayout:: QTextImageHandler:: QLabel:: QTextDocumentLayout:: QTextImageHandler:: QLabel:: QTextDocumentLayout:: QTextImageHandler:: QTimer:: QTimer:: QTimer:: QTimer:: QTimer::To copy to clipboard, switch view to plain text mode
Last edited by Mister_Crac; 8th May 2007 at 14:12.
Last edited by Mister_Crac; 4th May 2007 at 17:51.
Bookmarks