qtquick: Move last DockWidget Q_PROPERTY from controller to view
This commit is contained in:
@@ -58,7 +58,6 @@ class TitleBar;
|
||||
class DOCKS_EXPORT DockWidget : public Controller
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(KDDockWidgets::DockWidgetOptions options READ options WRITE setOptions NOTIFY optionsChanged)
|
||||
public:
|
||||
typedef QVector<DockWidget *> List;
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ DockWidget_qtquick::DockWidget_qtquick(const QString &uniqueName,
|
||||
connect(m_dockWidget, &Controllers::DockWidget::isFloatingChanged, this, &DockWidget_qtquick::isFloatingChanged);
|
||||
connect(m_dockWidget, &Controllers::DockWidget::isFocusedChanged, this, &DockWidget_qtquick::isFocusedChanged);
|
||||
connect(m_dockWidget, &Controllers::DockWidget::titleChanged, this, &DockWidget_qtquick::titleChanged);
|
||||
connect(m_dockWidget, &Controllers::DockWidget::optionsChanged, this, &DockWidget_qtquick::optionsChanged);
|
||||
}
|
||||
|
||||
DockWidget_qtquick::~DockWidget_qtquick()
|
||||
|
||||
@@ -49,7 +49,7 @@ class DOCKS_EXPORT DockWidget_qtquick : public Views::View_qtquick, public Views
|
||||
Q_PROPERTY(QString uniqueName READ uniqueName CONSTANT)
|
||||
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
|
||||
Q_PROPERTY(QObject *guestItem READ guestItem NOTIFY guestItemChanged)
|
||||
|
||||
Q_PROPERTY(KDDockWidgets::DockWidgetOptions options READ options WRITE setOptions NOTIFY optionsChanged)
|
||||
public:
|
||||
using Views::DockWidgetViewInterface::raise;
|
||||
using Views::DockWidgetViewInterface::show;
|
||||
@@ -121,6 +121,7 @@ Q_SIGNALS:
|
||||
void isFloatingChanged();
|
||||
void titleChanged();
|
||||
void guestItemChanged();
|
||||
void optionsChanged();
|
||||
|
||||
protected:
|
||||
bool event(QEvent *e) override;
|
||||
|
||||
@@ -126,4 +126,14 @@ void DockWidgetViewInterface::addDockWidgetToContainingWindow(DockWidgetViewInte
|
||||
m_dockWidget->addDockWidgetToContainingWindow(dw, location, relativeToDw, initialOption);
|
||||
}
|
||||
|
||||
DockWidgetOptions DockWidgetViewInterface::options() const
|
||||
{
|
||||
return m_dockWidget->options();
|
||||
}
|
||||
|
||||
void DockWidgetViewInterface::setOptions(DockWidgetOptions opts)
|
||||
{
|
||||
m_dockWidget->setOptions(opts);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -58,6 +58,9 @@ public:
|
||||
DockWidgetViewInterface *relativeTo = nullptr,
|
||||
KDDockWidgets::InitialOption initialOption = {});
|
||||
|
||||
DockWidgetOptions options() const;
|
||||
void setOptions(DockWidgetOptions);
|
||||
|
||||
protected:
|
||||
Controllers::DockWidget *const m_dockWidget;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user