30 #include <QChildEvent> 31 #include <QHBoxLayout> 33 #include <QToolButton> 34 #include <QCloseEvent> 44 , forced_hidden_(false)
46 QWidget *title_bar =
new QWidget(
this);
48 QPalette pal(palette());
49 pal.setColor(QPalette::Background, QColor( 200,200,200 ) );
50 title_bar->setAutoFillBackground(
true);
51 title_bar->setPalette(pal);
52 title_bar->setContentsMargins(0,0,0,0);
54 QToolButton *close_button =
new QToolButton();
55 close_button->setIcon(QIcon::fromTheme(
"window-close"));
56 close_button->setIconSize( QSize(10,10) );
58 connect( close_button, SIGNAL( clicked() ),
this, SLOT(close()) );
66 QHBoxLayout *title_layout =
new QHBoxLayout();
67 title_layout->setContentsMargins(2,2,2,2);
70 title_layout->addWidget( close_button, 0 );
71 title_bar->setLayout(title_layout);
72 setTitleBarWidget( title_bar );
77 QDockWidget::setWindowTitle( title );
97 if (
collapsed_ == collapse || isFloating() )
return;
119 disconnect( widget(), SIGNAL( destroyed( QObject* )),
this, SLOT(
onChildDestroyed( QObject* )));
124 connect( child, SIGNAL( destroyed( QObject* )),
this, SLOT(
onChildDestroyed( QObject* )));
void mapSetValue(const QString &key, QVariant value)
Set a named child to the given value.
Configuration data storage class.
bool mapGetBool(const QString &key, bool *value_out) const
Convenience function for looking up a named boolean.