68 :
QWidgetItem(widget), action(0), customWidget(false)
82 :
QLayout(parent), expanded(false), animating(false), dirty(true),
83 expanding(false), empty(true), expandFlag(false), popupMenu(0)
104 widgetAction->releaseWidget(item->
widget());
160 qWarning() <<
"QToolBarLayout::addItem(): please use addAction() instead";
195 index =
qMax(0, index);
238 return Qt::Orientations(0);
240 return expanding ? Qt::Orientations(o) : Qt::Orientations(0);
265 const int handleExtent =
movable()
314 a[i].sizeHint =
pick(o, hint);
315 a[i].maximumSize =
pick(o, max);
316 a[i].minimumSize =
pick(o, min);
317 a[i].expansive = exp & o;
326 that->
empty = count == 0;
338 if (mw->unifiedTitleAndToolBarOnMac()
372 bool ranOutOfSpace =
false;
379 area = win->toolBarArea(tb);
389 rpick(o, size) = extensionExtent;
406 # ifdef QT_MAC_USE_COCOA 433 const int handleExtent =
movable()
439 bool extensionMenuContainsOnlyWidgetActions =
true;
441 int space =
pick(o, rect.size()) - 2*margin - handleExtent;
448 bool ranOutOfSpace =
false;
450 int rowPos =
perp(o, rect.topLeft()) + margin;
461 bool expansiveRow =
false;
467 if (prev != -1 && newSize > space) {
469 ranOutOfSpace =
true;
472 if (count > 1 && size + spacing + extensionExtent > space)
479 expansiveRow = expansiveRow || a[i].expansive;
481 maximumSize += spacing + (a[i].expansive ? a[i].maximumSize : a[i].smartSizeHint());
489 a[i].minimumSize = 0;
490 a[i].expansive =
true;
494 if (expansiveRow && maximumSize < space) {
495 expansiveRow =
false;
499 qGeomCalc(a, start, i - start + (expansiveRow ? 0 : 1), 0,
500 space - (ranOutOfSpace ? (extensionExtent + spacing) : 0),
503 for (
int j = start; j < i; ++j) {
508 hideWidgets << item->
widget();
513 rpick(o, pos) = margin + handleExtent + a[j].pos;
514 rperp(o, pos) = rowPos;
518 rperp(o, size) = rowHeight;
520 rperp(o, size) =
perp(o, rect.size()) - 2*margin;
529 showWidgets << item->
widget();
536 hideWidgets << item->
widget();
540 extensionMenuContainsOnlyWidgetActions =
false;
558 for (
int i = 0; i < showWidgets.count(); ++i)
559 showWidgets.at(i)->show();
560 for (
int i = 0; i < hideWidgets.count(); ++i)
561 hideWidgets.at(i)->hide();
563 return ranOutOfSpace;
579 const int handleExtent =
movable()
596 int min_w =
pick(o, size);
600 int space = total_w/rows + spacing + extensionExtent;
601 space =
qMax(space, min_w - 2*margin - handleExtent);
603 space =
qMin(space,
pick(o, win->
size()) - 2*margin - handleExtent);
619 if (prev != -1 && newSize > space) {
620 if (count > 1 && size + spacing + extensionExtent > space) {
621 size -= spacing +
geomArray[prev].minimumSize;
636 w += 2*margin + handleExtent + spacing + extensionExtent;
643 rpick(o, result) = w;
644 rperp(o, result) = h;
660 #ifdef QT_NO_DOCKWIDGET 695 bool customWidget =
false;
696 bool standardButtonWidget =
false;
702 if (
QWidgetAction *widgetAction = qobject_cast<QWidgetAction *>(action)) {
703 widget = widgetAction->requestWidget(tb);
728 standardButtonWidget =
true;
733 if (standardButtonWidget)
742 #endif // QT_NO_TOOLBAR bool isSeparator() const
Returns true if this action is a separator action; otherwise it returns false.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
#define QT_END_NAMESPACE
This macro expands to.
QPointer< QWidget > widget
QRect itemRect(const QList< int > &path) const
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
Policy horizontalPolicy() const
void insert(int i, const T &t)
Inserts value at index position i in the list.
QMainWindowLayoutState layoutState
virtual void setGeometry(const QRect &)
Reimplemented Function
long ASN1_INTEGER_get ASN1_INTEGER * a
int count(const T &t) const
Returns the number of occurrences of value in the list.
void invalidate()
Reimplemented Function
T * qobject_cast(QObject *object)
bool empty() const
This function is provided for STL compatibility.
int horizontalStretch() const
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
QSize maximumSize() const
Returns the maximum size of this layout.
QWidget * parentWidget() const
Returns the parent widget of this layout, or 0 if this layout is not installed on any widget...
int width() const
Returns the width.
void setAlignment(Qt::Alignment a)
Sets the alignment of this item to alignment.
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QLayoutItem class provides an abstract item that a QLayout manipulates.
QPoint bottomRight() const
Returns the position of the rectangle's bottom-right corner.
T takeFirst()
Removes the first item in the list and returns it.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
The QLayout class is the base class of geometry managers.
QSize size() const
Returns the size of the rectangle.
const T & at(int i) const
Returns the item at index position i in the list.
Q_CORE_EXPORT void qWarning(const char *,...)
int verticalStretch() const
void qGeomCalc(QVector< QLayoutStruct > &chain, int start, int count, int pos, int space, int spacer)
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
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...
QObject * parent() const
Returns a pointer to the parent object.
The QPoint class defines a point in the plane using integer precision.
The QMainWindow class provides a main application window.
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
QList< int > indexOf(QWidget *widget) const
int height() const
Returns the height.
The QRect class defines a rectangle in the plane using integer precision.
T takeAt(int i)
Removes the item at index position i and returns it.
virtual QWidget * widget()
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned.
The QSize class defines the size of a two-dimensional object using integer point precision.
QLayout * layout()
Reimplemented Function
void fixSizeInUnifiedToolbar(QToolBar *tb) const
QToolBarAreaLayout toolBarAreaLayout
int size() const
Returns the number of items in the vector.
void deleteLater()
Schedules this object for deletion.
The QAction class provides an abstract user interface action that can be inserted into widgets...
static int area(const QSize &s)
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.