40

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?

jaba
  • 735
  • 7
  • 18
Rek
  • 571
  • 1
  • 6
  • 14
  • Well, that error needs to be fixed. Not sure how you expect to be helped without posting at least some of that file. – Mat Jul 26 '11 at 14:27
  • I cannot find the erroneous line myself >_< I will try to fetch the library again tomorrow. – Rek Jul 26 '11 at 14:32
  • 1
    Ugh same problem here. Nothing to let us know what's wrong. How did you fix this? – wrongusername Aug 18 '11 at 18:22
  • 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_T – Rek Sep 07 '11 at 14:53
  • 2
    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 `` tag (as explained in the answers that followed). – Matteo Italia Oct 06 '13 at 02:02

6 Answers6

79

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.

Vlad
  • 791
  • 5
  • 2
  • 4
    Worked for me as well. Although the cause is still a mystery to me. – Martin Drozdik Apr 30 '12 at 18:21
  • There are more `` lines than there are errors; not all of them should be deleted. Still weird though, that it created `` lines for elements that aren't widgets (but spacers in my case). – Halfgaar Feb 03 '14 at 13:15
  • 3
    @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 problem – Nicolai Lissau Mar 28 '14 at 10:21
  • Edit the tab order, do fix some warnings for me. – Shihe Zhang Oct 18 '17 at 07:33
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.

Zathras
  • 141
  • 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 `` lines went away. – David Dunham Jan 31 '12 at 22:38
  • 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](http://stackoverflow.com/questions/22405937/qt-svn-z-order-assignment-widget-is-not-a-valid-widget) .. I will appreciate any advice – McLan Mar 14 '14 at 14:55
  • Please correct the typo above; it is "", not "". – Rob Winchester Apr 12 '17 at 16:51
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;

    // ...
};
Mike
  • 21
  • 2
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.

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.

totymedli
  • 29,531
  • 22
  • 131
  • 165
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
fyngyrz
  • 2,458
  • 2
  • 36
  • 43