Plasma
Go to the documentation of this file.
20 #include <QGraphicsWidget>
26 m_currentWidgetIndex(-1)
38 const QRectF effectiveRect = geometry();
40 for(
int i = 0; i < items.size(); i++) {
41 itemAt(i)->setGeometry(effectiveRect);
50 qreal left, top, right, bottom;
51 getContentsMargins(&left, &top, &right, &bottom);
53 if (m_currentWidgetIndex <= 0 || !
itemAt(m_currentWidgetIndex)) {
57 QSizeF currentWidgetSize =
itemAt(m_currentWidgetIndex)->effectiveSizeHint(which, constraint);
59 return QSizeF( left + right + currentWidgetSize.width(), right + bottom + currentWidgetSize.height());
74 if(!pos && (m_currentWidgetIndex == -1)) {
75 m_currentWidgetIndex = 0;
77 item->graphicsItem()->hide();
80 items.insert(pos, item);
91 items.removeAt(index);
96 QGraphicsItem *currentWidget =
itemAt(m_currentWidgetIndex)->graphicsItem();
97 QGraphicsItem *hiddenWidget =
itemAt(index)->graphicsItem();
99 currentWidget->hide();
100 hiddenWidget->show();
102 m_currentWidgetIndex = index;
107 return m_currentWidgetIndex;
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 23 2013 21:58:15 by
doxygen 1.8.1.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.