QVision Widget Error upon compile
Asked Answered
D

6

39

Only one error to go until I get to use this for my research!

Warning: Z-order assignment: " is not a valid widget.
FILE: qvvideoreaderblockwidget.ui

There's no line number that came with it. I tried finding but, failed to see an open-ended part.

What should I do to correctly compile this library?

Dogmatist answered 26/7, 2011 at 14:24 Comment(5)
Well, that error needs to be fixed. Not sure how you expect to be helped without posting at least some of that file.Meagher
I cannot find the erroneous line myself >_< I will try to fetch the library again tomorrow.Dogmatist
Ugh same problem here. Nothing to let us know what's wrong. How did you fix this?Windswept
Haven't fixed this; I opted to do my programming in Linux (as opposed to doing it in Windows, where I get the error) sorry for not updating T_TDogmatist
Incidentally, you copied the message incorrectly, it's ", but '' (two empty single quotes, that signify an empty string), and the tag to kill is an empty <zorder></zorder> tag (as explained in the answers that followed).Zielsdorf
W
78

Edit the ui file outside of Qt Creator. Delete the rows with 'zorder' tags. Then open in Qt Creator and compile again. It worked for me then perfectly, the warning did not appear any more.

Westmorland answered 15/4, 2012 at 13:8 Comment(4)
Worked for me as well. Although the cause is still a mystery to me.Scriptorium
There are more <zorder> lines than there are errors; not all of them should be deleted. Still weird though, that it created <zorder> lines for elements that aren't widgets (but spacers in my case).Mazonson
@MartinDrozdik The z-order is the depth at which the different ui elements should be rendered to the screen. If two elements have the same z-order, the graphics card is trying to draw both elements at the exact same spot, and thereby the color value of the pixel can be changed two times on each render, which will result in a flickering. I haven't seen this occur with Qt, probably because there are ways you can assure doesn't happen. I don't think it's a big issue, however Qt is probably just making sure. Editing the file probably forces Qt to reindex the z-order, thereby solving the problemEcumenicist
Edit the tab order, do fix some warnings for me.Cultrate
T
14

OK, I had this, and it irked me too. I don't know what happened to cause this, but it is not serious. I suppose that breaking and remaking all the layouts might fix it. Other frameworks tend toward a lot of warnings, but tho I'm new to Qt, not a one yet. I went in another editor, and removed a line that said (as best I can remember):

<z-order>verticalSpacer</z-order>

which was among a lot of other lines which also were z-order tags. I deleted the line with this tag, and rebuilt all. Problem gone. Interestingly enough, all of the z-order tags had vanished from my file when I looked at it next. It must be a bug, but evidently one of little consequence; except those who hate to see the serene beauty of Qt spoiled.

Tingle answered 9/9, 2011 at 8:21 Comment(3)
I just got essentially the same thing. I manually edited the .ui file and got rid of the message. I then made another edit, and all but two of my <zorder> lines went away.Thekla
my problem is that I am working on a project from a svn, secondly in my xml there is no "z-order" tag to delete, kindly please read my question HERE .. I will appreciate any adviceCorrinnecorrival
Please correct the typo above; it is "<zorder>", not "<z-order>".Coff
P
2

Does the ui-file qvvideoreaderblockwidget.ui contain "Promoted widgets"? If so, use the "Promoted widgets" dialog of the (Qt4-) designer for ensuring that the header of the promoted widget-class is declared as "global include".

In case the custom widget class is named "MyWidget" and the header is named "mywidget.h" and the member widget shall be named "myWidget", the uic will generate the code of the ui-class as follows:

#include <mywidget.h>

class qvvideoreaderblockwidget
{
public:
    MyWidget* myWidget;

    // ...
};
Piddling answered 29/8, 2011 at 13:22 Comment(0)
B
1

It happened to me when I deleted a fairly large chunk of stuff in the designer. Investigation showed that the designer had failed to remove a zorder tag relating to the widget I deleted (which, incidentally contained a bunch of other widgets).

Deleting the line as suggested cleared the problem. If you do have a load of zorder tags you probably need to be careful to just delete the one that relates to the deleted item.

Bandstand answered 12/2, 2014 at 15:45 Comment(0)
S
0

I had the same problem, and deleting the .exe file from the output folder (debug or release) before run/compile the source, solved the problem.

Spilt answered 29/7, 2012 at 4:36 Comment(0)
C
0

This problem arises due to a (presently) unfixed bug in Qt Creator's undo / delete mechanism.

The solution until the bug is fixed is to:

  1. Close the .ui file in Qt Designer
  2. Open the .ui file in an external editor
  3. Delete the <zorder> line(s) that apply to the element with the problem. For example:

             <zorder>groupBox_2</zorder>
     
  4. Save the file
  5. Re-open the file in Qt Designer
  6. Re-compile in Qt
Crispen answered 6/5, 2020 at 16:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.