115 int extra =
qMax(0, space - min);
122 if (
QToolBarLayout *tblayout = qobject_cast<QToolBarLayout*>(
item.widgetItem->widget()->layout()))
123 tblayout->checkUsePopupMenu();
125 const int itemMin =
pick(
o,
item.minimumSize());
130 const int extraSpace =
qMin(
item.size - itemMin, extra);
131 item.size = itemMin + extraSpace;
233 if ((reverse &&
i < 0) || (!reverse &&
i ==
lines.
size()))
255 i += reverse ? -1 : 1;
269 if (before ==
nullptr) {
279 for (
int k = 0; k <
line.toolBarItems.
size(); ++k) {
280 if (
line.toolBarItems.
at(k).widgetItem->widget() == before) {
293 for (
int k = 0; k <
line.toolBarItems.
size(); ++k) {
295 if (
item.widgetItem->widget() == toolBar) {
296 delete item.widgetItem;
297 item.widgetItem =
nullptr;
311 if (before ==
nullptr) {
321 for (
int k = 0; k <
line.toolBarItems.
size(); ++k) {
322 if (
line.toolBarItems.
at(k).widgetItem->widget() == before) {
342 for (
int k = 0; k <
line.toolBarItems.
size(); ++k) {
343 if (
line.toolBarItems.
at(k).widgetItem->widget() == before) {
372 int previousIndex = -1;
374 for (
int k = 0; k <
line.toolBarItems.
size(); ++k) {
377 int newPos = current.
pos;
379 if (previousIndex >= 0) {
386 for(
int l = k; l <
line.toolBarItems.
size(); ++l) {
396 int extra = newPos - current.
pos;
415 for(
int l = previousIndex; l >=0; --l) {
418 const int minPreferredSize =
pick(
o,
item.minimumSize());
419 const int margin =
item.size - minPreferredSize;
420 if (margin < extra) {
421 item.resize(
line.o, minPreferredSize);
437 }
else if (!current.
skip()) {
462 for (; k <
line.toolBarItems.
size(); ++k) {
484 if (
dist >= 0 && *minDistance >
dist) {
499 int j =
path.first();
511 for(
int p = k - 1 ;
p >= 0; --
p) {
513 if (!previous.
skip()) {
516 int previousExtraSpace = previous.
size - previousSizeHint;
518 if (previousExtraSpace > 0) {
521 previous.
size = previousSizeHint;
523 gap_item.
resize(
o, previousExtraSpace);
617 left_hint.
width(), center.height());
619 right_hint.
width(), center.height());
689 right_hint.
width()*coef, bottom_hint.
height()*coef);
704 for (
int k = 0; k <
line.toolBarItems.
size(); ++k) {
706 return line.toolBarItems.
at(k).widgetItem;
724 for (
int k = 0; k <
line.toolBarItems.
size(); ++k) {
746 for (
int k = 0; k <
line.toolBarItems.
size(); ++k) {
749 delete item.widgetItem;
750 item.widgetItem =
nullptr;
764 for (
int k = 0; k <
line.toolBarItems.
size(); ++k) {
765 if (
line.toolBarItems.
at(k).widgetItem->widget() == toolBar)
857 for (
int k = 0; k <
line.toolBarItems.
size(); ++k) {
879 QToolBarLayout *tbl = qobject_cast<QToolBarLayout*>(toolBar->layout());
913 for (
int k = 0; k <
line.toolBarItems.
size(); ++k) {
914 if (
line.toolBarItems.
at(k).widgetItem->widget() == toolBar)
915 return j > 0 && k == 0;
931 for (
int k = 0; k <
line.toolBarItems.
size(); ++k) {
932 if (
line.toolBarItems.
at(k).widgetItem->widget() == toolBar) {
934 option->positionWithinLine = QStyleOptionToolBar::OnlyOne;
936 option->positionWithinLine = QStyleOptionToolBar::Beginning;
937 else if (k ==
line.toolBarItems.
size() - 1)
938 option->positionWithinLine = QStyleOptionToolBar::End;
940 option->positionWithinLine = QStyleOptionToolBar::Middle;
943 option->positionOfLine = QStyleOptionToolBar::OnlyOne;
945 option->positionOfLine = QStyleOptionToolBar::Beginning;
947 option->positionOfLine = QStyleOptionToolBar::End;
949 option->positionOfLine = QStyleOptionToolBar::Middle;
970 for (
int k = 0; k <
line.toolBarItems.
size(); ++k) {
972 if (!
item.gap &&
item.widgetItem->widget() == toolBar) {
998 int minDistance = 80;
1022 for (
int k = 0; k <
line.toolBarItems.
size(); k++) {
1023 if (
line.toolBarItems[k].gap) {
1037 const int i =
path.first();
1060 for (
int k = 0; k <
line.toolBarItems.
size(); k++) {
1061 if (
line.toolBarItems[k].widgetItem ==
item) {
1091 return &(
line.toolBarItems[
path.at(2)]);
1096 const int i =
path.first();
1115 return item->widgetItem;
1131 int newExtraSpace = 0;
1134 for (
int i =
path.at(2) - 1;
i >= 0; --
i) {
1136 if (!previous.
skip()) {
1154 for (
int i =
path.at(2) - 1;
i >= 0; --
i) {
1156 if (!previous.
skip()) {
1167 return item->widgetItem;
1172 *floating = geom0 & 1;
1178 int x = (int)(geom0 & 0x0000ffff) - 0x7FFF;
1179 int y = (int)(geom1 & 0x0000ffff) - 0x7FFF;
1184 int w = geom0 & 0x0000ffff;
1185 int h = geom1 & 0x0000ffff;
1201 *geom0 |=
qMax(0,
rect.width()) & 0x0000ffff;
1202 *geom1 |=
qMax(0,
rect.height()) & 0x0000ffff;
1207 *geom0 |=
qMax(0,
rect.x() + 0x7FFF) & 0x0000ffff;
1208 *geom1 |=
qMax(0,
rect.y() + 0x7FFF) & 0x0000ffff;
1224 lineCount +=
docks[
i].lines.size();
1236 for (
int k = 0; k <
line.toolBarItems.
size(); ++k) {
1241 qWarning(
"QMainWindow::saveState(): 'objectName' not set for QToolBar %p '%s'",
1251 shownOrientation |= 2;
1253 stream << shownOrientation;
1260 stream << geom0 << geom1;
1280 for (
int j = 0;
j < lines; ++
j) {
1289 const bool applyingLayout = !testing;
1292 for (
int k = 0; k < cnt; ++k) {
1311 bool floating =
false;
1320 for (
int x = 0;
x < toolBars.
size(); ++
x) {
1321 if (toolBars.
at(
x)->objectName() == objectName) {
1326 if (toolBar ==
nullptr) {
1330 if (applyingLayout) {
1334 toolBarPrivate->widgetItem =
nullptr;
1345 if (applyingLayout) {
1357 if (!
docks[
i].lines.isEmpty())
int startDragDistance
the minimum distance required for a drag and drop operation to start.
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
\inmodule QtCore\reentrant
qint64 size() const
Returns the file size in bytes.
QPointF pos() const
Returns the position of the item in parent coordinates.
The QLayoutItem class provides an abstract item that a QLayout manipulates.
virtual bool isEmpty() const =0
Implemented in subclasses to return whether this item is empty, i.e.
virtual QWidget * widget() const
If this item manages a QWidget, returns that widget.
qsizetype size() const noexcept
bool isEmpty() const noexcept
void removeAt(qsizetype i)
const T & constLast() const noexcept
iterator insert(qsizetype i, parameter_type t)
const_reference at(qsizetype i) const noexcept
void prepend(rvalue_ref t)
void append(parameter_type t)
The QMainWindow class provides a main application window.
QString objectName
the name of this object
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr void moveBottom(int pos) noexcept
Moves the rectangle vertically, leaving the rectangle's bottom edge at the given y coordinate.
constexpr void moveRight(int pos) noexcept
Moves the rectangle horizontally, leaving the rectangle's right edge at the given x coordinate.
constexpr int bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
constexpr void setRight(int pos) noexcept
Sets the right edge of the rectangle to the given x coordinate.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr void setSize(const QSize &s) noexcept
Sets the size of the rectangle to the given size.
constexpr QRect adjusted(int x1, int y1, int x2, int y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
constexpr int top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr QPoint topRight() const noexcept
Returns the position of the rectangle's top-right corner.
constexpr void moveLeft(int pos) noexcept
Moves the rectangle horizontally, leaving the rectangle's left edge at the given x coordinate.
constexpr void setBottom(int pos) noexcept
Sets the bottom edge of the rectangle to the given y coordinate.
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr void setLeft(int pos) noexcept
Sets the left edge of the rectangle to the given x coordinate.
constexpr int left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QSize size() const noexcept
Returns the size of the rectangle.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr void moveTopRight(const QPoint &p) noexcept
Moves the rectangle, leaving the top-right corner at the given position.
constexpr void moveTop(int pos) noexcept
Moves the rectangle vertically, leaving the rectangle's top edge at the given y coordinate.
constexpr int right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
constexpr void setTop(int pos) noexcept
Sets the top edge of the rectangle to the given y coordinate.
constexpr Policy verticalPolicy() const noexcept
Returns the vertical component of the size policy.
constexpr Policy horizontalPolicy() const noexcept
Returns the horizontal component of the size policy.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
constexpr QSize expandedTo(const QSize &) const noexcept
Returns a size holding the maximum width and height of this size and the given otherSize.
constexpr void setWidth(int w) noexcept
Sets the width to the given width.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString right(qsizetype n) const
Returns a substring that contains the n rightmost characters of the string.
QString & removeAt(qsizetype pos)
qsizetype size() const
Returns the number of characters in this string.
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QString & insert(qsizetype i, QChar c)
QByteArray toLocal8Bit() const &
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString & append(QChar c)
QString left(qsizetype n) const
Returns a substring that contains the n leftmost characters of the string.
static QRect visualRect(Qt::LayoutDirection direction, const QRect &boundingRect, const QRect &logicalRect)
Returns the given logicalRectangle converted to screen coordinates based on the specified direction.
static QPoint visualPos(Qt::LayoutDirection direction, const QRect &boundingRect, const QPoint &logicalPos)
Returns the given logicalPosition converted to screen coordinates based on the specified direction.
Combined button and popup list for selecting options.
QMainWindowLayout * qt_mainwindow_layout(const QMainWindow *window)
Q_WIDGETS_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei GLsizei GLfloat distance
GLfloat GLfloat GLfloat GLfloat h
GLsizei const GLchar *const * path
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
std::uniform_real_distribution dist(1, 2.5)
[2]
QFileInfo info(fileName)
[8]