Archive 17/01/2023.

Get rid of “WARNING: Forcing top alignment because parent element has vertical layout”

sirop

Hello.

I have 3 widgets in my application which always yield smth. like

WARNING: Forcing top alignment because parent element has vertical layout

or

WARNING: Forcing left alignment because parent element has horizontal layout

What shall I do to get rid of these warnings?

Or is there a general way to just suppress this debug level/ warnings ?

Thanks.

sirop

Setting engineParameters_[EP_LOG_LEVEL] = 0; let me get rid of warnings, however DEBUG level log messages are still there.

How can that be?

Miegamicis

Log level 0 means that all the messages that comes in should be outputted to console.
There are multiple log levels
0 - output everything
1 - output debug messages and everything > 1
2 - output info messages and everything > 2
3 - output warning messages and everything > 3
4 - output error message and everything > 4
5 - output nothing

See source here: https://github.com/urho3d/Urho3D/blob/master/Source/Urho3D/IO/Log.h#L33-L46

Miegamicis

Do you have sample code where you create parent with vertical/horizontal layout and add a child to it?

sirop

yes, I have some: https://pastebin.com/zJzCFMS0

Miegamicis

This warning message is generated when you create a parent with vertical layout mode and add child to it, and after that try to change it’s vertical layout to something other than VA_TOP

Same thing with horizontal layout, only HA_LEFT alignment is allowed for added child elements.