54 #include <QVBoxLayout> 56 #include "SideArea.hh" 57 #include "SideElement.hh" 65 layout_ =
new QVBoxLayout;
66 layout_->setSpacing (0);
68 QVBoxLayout *l =
new QVBoxLayout;
69 l->addLayout (layout_);
71 l->setContentsMargins(2, 2, 2, 2);
79 QIcon *_icon, QWidget *_headerAreaWidget)
82 layout_->addWidget (e);
85 itemNames_.push_back(_name);
93 if(_position < 0 || _position >= items_.size())
97 QVector<SideElement*>::iterator it = items_.begin();
98 for(; it != items_.end(); ++it) {
99 if( (*it)->name() == _name )
103 if(it != items_.end()) {
104 layout_->removeWidget(*it);
105 layout_->insertWidget(_position, (*it));
114 if(_position < 0 || _position >= items_.size())
118 QVector<SideElement*>::iterator it = items_.begin();
120 for(; it != items_.end(); ++it, ++i) {
121 if( ((*it)->name() == _name)
126 bool active = (*it)->active();
128 if(it != items_.end()) {
129 layout_->removeWidget(*it);
130 layout_->insertWidget(_position, (*it));
139 return items_.size();
148 layout_->removeWidget (e);
159 void SideArea::expandAll()
167 void SideArea::expand(QWidget *sideElementWidget,
bool expand)
171 if (e->
widget() == sideElementWidget)
180 _settings.beginGroup (
"SideArea");
185 _settings.endGroup ();
192 _settings.beginGroup (
"SideArea");
197 _settings.endGroup ();
204 sideElementState_[_viewMode + e->
name()] = e->
active();
220 for (
int i=0; i < items_.count(); i++)
221 if ( items_[i]->name() == _name ){
222 items_[i]->setActive(_active);
void moveItemToPosition(const QString &_name, int _position)
Move a toolbox widget to a given position.
void restoreState(QSettings &_settings)
restores the state
const QList< const QObject * > & plugins()
Get plugins in side area.
std::vector< PluginInfo > plugins_
List of all loaded plugins_.
void restoreViewModeState(const QString &_viewMode)
restores the active state of _viewMode
QWidget const * widget()
returns the pointer to the plugin tool widget
SideArea(QWidget *_parent=0)
void restoreState(QSettings &_settings)
restores the state
void saveState(QSettings &_settings)
returns the current state
void setActive(bool _active)
Set the element as active.
const QString & name()
return the name
void addItem(QObject const *const _plugin, QWidget *_w, QString _name, QIcon *_icon=0, QWidget *_headerAreaWidget=0)
const QStringList & names()
Get item names.
int getNumberOfWidgets() const
Get number of widgets.
void clear()
clears the whole tool widget area
void saveViewModeState(const QString &_viewMode)
saves the active state of _viewMode
void saveState(QSettings &_settings)
saves the current state
bool active()
returns if the SideElement is active
void setElementActive(QString _name, bool _active)
set the active state of given element