30 #include <QApplication> 31 #include <QChildEvent> 32 #include <QHBoxLayout> 34 #include <QToolButton> 35 #include <QCloseEvent> 42 : QDockWidget(name), collapsed_(false), forced_hidden_(false)
44 QWidget* title_bar =
new QWidget(
this);
46 QPalette pal(palette());
47 pal.setColor(QPalette::Background, QApplication::palette().color(QPalette::Mid));
48 title_bar->setAutoFillBackground(
true);
49 title_bar->setPalette(pal);
50 title_bar->setContentsMargins(0, 0, 0, 0);
52 QToolButton* close_button =
new QToolButton();
53 close_button->setIcon(QIcon::fromTheme(
"window-close"));
54 close_button->setIconSize(QSize(10, 10));
56 connect(close_button, SIGNAL(clicked()),
this, SLOT(close()));
64 QHBoxLayout* title_layout =
new QHBoxLayout();
65 title_layout->setContentsMargins(2, 2, 2, 2);
68 title_layout->addWidget(close_button, 0);
69 title_bar->setLayout(title_layout);
70 setTitleBarWidget(title_bar);
75 QDockWidget::setWindowTitle(title);
118 disconnect(widget(), SIGNAL(destroyed(QObject*)),
this, SLOT(
onChildDestroyed(QObject*)));
123 connect(child, SIGNAL(destroyed(QObject*)),
this, SLOT(
onChildDestroyed(QObject*)));
void setVisible(PanelDockWidget *widget, bool visible)
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.
bool isVisible(PanelDockWidget *widget)