QHBoxLayout(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’– QHBoxLayout β€” the qt one, section 3 πŸ’–

okay bestie, sit down, hydrate, because today we're learning about QHBoxLayout from the 3qt manual. yes, that 3qt. it's giving classic Qt energy and honestly? we're obsessed. ✨


🌸 NAME 🌸

QHBoxLayout β€” lines up widgets horizontally. that's it. that's the whole vibe. horizontal. left to right. like reading a text from your bestie. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <qlayout.h>

Inherits QBoxLayout. yes she's a daughter class, she gets it from her mama, iconic behavior. πŸ‘‘

✨ Public Members ✨

  • QHBoxLayout ( QWidget * parent, int margin = 0, int spacing = -1, const char * name = 0 )
  • QHBoxLayout ( QLayout * parentLayout, int spacing = -1, const char * name = 0 )
  • QHBoxLayout ( int spacing = -1, const char * name = 0 )
  • ~QHBoxLayout ()

three constructors and a destructor, so basically a whole friend group. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

The QHBoxLayout class lines up widgets horizontally. no cap. side by side. shoulder to shoulder. a little row of widgets holding hands. 😭

This class is used to construct horizontal box layout objects. for the full tea, go read QBoxLayout β€” she has more details, and she's the main character of that particular story. ✨

The simplest use of the class is like this:

QBoxLayout * l = new QHBoxLayout( widget );
l->setAutoAdd( TRUE );
new QSomeWidget( widget );
new QSomeOtherWidget( widget );
new QAnotherWidget( widget );

or like this:

QBoxLayout * l = new QHBoxLayout( widget );
l->addWidget( existingChildOfWidget );
l->addWidget( anotherChildOfWidget );
note: there was an image here in the original and it got omitted. so just imagine it. picture the layout. visualize it. manifest it. 🧚

See also QVBoxLayout, QGridLayout, the Layout overview, Widget Appearance and Style, and Layout Management. so many cross-references, so little time, we love a connected ecosystem. 🌈


πŸ’œ MEMBER FUNCTION DOCUMENTATION πŸ’œ

⭐ QHBoxLayout::QHBoxLayout ( QWidget * parent, int margin = 0, int spacing = -1, const char * name = 0 )

Constructs a new top-level horizontal box called name, with parent parent. πŸ’«

The margin is the number of pixels between the edge of the widget and its managed children. The spacing is the default number of pixels between neighboring children. If spacing is -1 the value of margin is used for spacing. yes, -1 means "bestie just use the margin", it's a little shortcut, we love a shortcut. πŸŽ€

⭐ QHBoxLayout::QHBoxLayout ( QLayout * parentLayout, int spacing = -1, const char * name = 0 )

Constructs a new horizontal box called name name and adds it to parentLayout. so she comes with a built-in friend group. 🫢

The spacing is the default number of pixels between neighboring children. If spacing is -1, this QHBoxLayout will inherit its parent's spacing(). inheriting from your parent? growth. generational wealth. ✨

⭐ QHBoxLayout::QHBoxLayout ( int spacing = -1, const char * name = 0 )

Constructs a new horizontal box called name name. You must add it to another layout. like, she cannot stand alone, she needs a support system, she needs a parent layout, ok?? don't leave her hanging. 😭

The spacing is the default number of pixels between neighboring children. If spacing is -1, this QHBoxLayout will inherit its parent's spacing(). same deal as before, the -1 inheritance slay. πŸ’…

⭐ QHBoxLayout::~QHBoxLayout ()

Destroys this box layout. rip to the layout, she did her job. πŸ™ˆ

IMPORTANT: the layout's widgets aren't destroyed. the layout goes, the widgets stay. they're fine. they're thriving. do not panic. πŸ’€

πŸ”₯ SEE ALSO πŸ”₯


Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. yes bestie we cite our sources, we give credit, we are not thieves. 🫢


🌸 AUTHOR 🌸

Generated automatically from the source code. not a human, not a poet, just a script doing its thing. and honestly? she ate. ✨


πŸ’€ BUGS πŸ’€

If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. πŸŽ€

The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. (read that again bestie, she said not officially supported, we're in unofficial territory, proceed with vibes. 🌈)

If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qhboxlayout.3qt) and the Qt version (3.3.8). include the details!! a bug report without details is just a rant, and we don't do that here. πŸ’…


sign-off: this little love letter was brought to you by Trolltech AS, dated 2 February 2007, and yes, the Qt version in question is 3.3.8. go forth and lay out your widgets horizontally, bestie. you got this. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«ΆπŸ”₯πŸ‘‘πŸŒˆβ­πŸ’œ
πŸ“¦ where this page comes from