28 #ifndef COLLAPSINGTOOLBAR_H_ 29 #define COLLAPSINGTOOLBAR_H_ 32 #include <QToolButton> 34 #include <QActionEvent> 105 m_expandedSize = (
movable ? m_expandedSize + handleSz : m_expandedSize - handleSz);
131 m_expandedSize +=
width + m_spacing;
133 m_expandedSize = m_expandedSize - m_actionWidths.
value(e->
action()) +
width;
141 m_expandedSize -=
width + m_spacing;
155 recalcExpandedSize();
170 if (!
isVisible() || m_expandedSize <= 0 || availableWidth <= 0)
175 if (availableWidth > m_expandedSize)
180 if (availableWidth <= m_expandedSize)
190 void recalcExpandedSize()
197 for ( ; it != m_actionWidths.
end(); ++it) {
201 m_expandedSize +=
width + m_spacing;
222 int widthForAction(
QAction *action)
const 226 return m_separatorWidth;
232 const int width = tb->sizeHint().width();
233 tb->setToolButtonStyle(oldStyle);
238 return w->sizeHint().width();
243 int m_expandedSize = -1;
245 int m_separatorWidth = 0;
249 #endif // COLLAPSINGTOOLBAR_H_
QEvent::Type type() const const
QHash::iterator insert(const Key &key, const T &value)
const Key key(const T &value) const const
QRect contentsRect() const const
virtual int pixelMetric(QStyle::PixelMetric metric, const QStyleOption *option, const QWidget *widget) const const=0
QAction * action() const const
bool isSeparator() const const
int remove(const Key &key)
const T value(const Key &key) const const
bool isEmpty() const const
bool contains(const Key &key) const const
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const const