Rename MDIArea class to MDIArea_qtwidgets
To match the filename now
This commit is contained in:
@@ -83,7 +83,7 @@ int main(int argc, char **argv)
|
||||
auto mdiWidget3 = new KDDockWidgets::Views::DockWidget_qtwidgets(QStringLiteral("MDI widget3"), options);
|
||||
mdiWidget3->setWidget(new MyWidget3());
|
||||
|
||||
auto mdiArea = new KDDockWidgets::MDIArea();
|
||||
auto mdiArea = new KDDockWidgets::Views::MDIArea_qtwidgets();
|
||||
mainWindow.setPersistentCentralWidget(mdiArea);
|
||||
|
||||
mdiArea->addDockWidget(mdiWidget1, QPoint(10, 10));
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
Contact KDAB at <info@kdab.com> for commercial licensing options.
|
||||
*/
|
||||
|
||||
#include "../../../qtwidgets/views/MDIArea_qtwidgets.h"
|
||||
#include "../../../../qtwidgets/views/MDIArea_qtwidgets.h"
|
||||
@@ -24,8 +24,9 @@
|
||||
|
||||
using namespace KDDockWidgets;
|
||||
using namespace KDDockWidgets::Controllers;
|
||||
using namespace KDDockWidgets::Views;
|
||||
|
||||
class MDIArea::Private
|
||||
class MDIArea_qtwidgets::Private
|
||||
{
|
||||
public:
|
||||
Private(View *parent)
|
||||
@@ -41,7 +42,7 @@ public:
|
||||
MDILayout *const layout;
|
||||
};
|
||||
|
||||
MDIArea::MDIArea(QWidget *parent)
|
||||
MDIArea_qtwidgets::MDIArea_qtwidgets(QWidget *parent)
|
||||
: Views::View_qtwidgets<QWidget>(nullptr, Type::MDIArea, parent)
|
||||
, d(new Private(this))
|
||||
{
|
||||
@@ -53,12 +54,12 @@ MDIArea::MDIArea(QWidget *parent)
|
||||
// QWidgetAdapter::makeItemFillParent(d->layout);
|
||||
}
|
||||
|
||||
MDIArea::~MDIArea()
|
||||
MDIArea_qtwidgets::~MDIArea_qtwidgets()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
void MDIArea::addDockWidget(Controllers::DockWidget *dw, QPoint localPt, InitialOption addingOption)
|
||||
void MDIArea_qtwidgets::addDockWidget(Controllers::DockWidget *dw, QPoint localPt, InitialOption addingOption)
|
||||
{
|
||||
if (dw->options() & DockWidgetOption_MDINestable) {
|
||||
// We' wrap it with a drop area, so we can drag other dock widgets over this one and dock
|
||||
@@ -74,35 +75,35 @@ void MDIArea::addDockWidget(Controllers::DockWidget *dw, QPoint localPt, Initial
|
||||
d->layout->addDockWidget(dw, localPt, addingOption);
|
||||
}
|
||||
|
||||
void MDIArea::moveDockWidget(Controllers::DockWidget *dw, QPoint pos)
|
||||
void MDIArea_qtwidgets::moveDockWidget(Controllers::DockWidget *dw, QPoint pos)
|
||||
{
|
||||
d->layout->moveDockWidget(dw, pos);
|
||||
}
|
||||
|
||||
void MDIArea::resizeDockWidget(Controllers::DockWidget *dw, QSize size)
|
||||
void MDIArea_qtwidgets::resizeDockWidget(Controllers::DockWidget *dw, QSize size)
|
||||
{
|
||||
d->layout->resizeDockWidget(dw, size);
|
||||
}
|
||||
|
||||
void MDIArea::addDockWidget(Views::DockWidgetViewInterface *dwView, QPoint localPt, InitialOption addingOption)
|
||||
void MDIArea_qtwidgets::addDockWidget(Views::DockWidgetViewInterface *dwView, QPoint localPt, InitialOption addingOption)
|
||||
{
|
||||
auto dw = dwView ? dwView->dockWidget() : nullptr;
|
||||
addDockWidget(dw, localPt, addingOption);
|
||||
}
|
||||
|
||||
void MDIArea::moveDockWidget(Views::DockWidgetViewInterface *dwView, QPoint pos)
|
||||
void MDIArea_qtwidgets::moveDockWidget(Views::DockWidgetViewInterface *dwView, QPoint pos)
|
||||
{
|
||||
auto dw = dwView ? dwView->dockWidget() : nullptr;
|
||||
moveDockWidget(dw, pos);
|
||||
}
|
||||
|
||||
void MDIArea::resizeDockWidget(Views::DockWidgetViewInterface *dwView, QSize size)
|
||||
void MDIArea_qtwidgets::resizeDockWidget(Views::DockWidgetViewInterface *dwView, QSize size)
|
||||
{
|
||||
auto dw = dwView ? dwView->dockWidget() : nullptr;
|
||||
resizeDockWidget(dw, size);
|
||||
}
|
||||
|
||||
QList<Controllers::Frame *> MDIArea::frames() const
|
||||
QList<Controllers::Frame *> MDIArea_qtwidgets::frames() const
|
||||
{
|
||||
return d->layout->frames();
|
||||
}
|
||||
|
||||
@@ -25,8 +25,9 @@ class MDILayout;
|
||||
}
|
||||
|
||||
namespace Views {
|
||||
|
||||
class DockWidgetViewInterface;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief MDIArea allows to host dock widget in MDI mode.
|
||||
* This is an alternative to using a full blown MainWindowMDI.
|
||||
@@ -36,12 +37,12 @@ class DockWidgetViewInterface;
|
||||
*
|
||||
* See examples/mdi_with_docking/.
|
||||
*/
|
||||
class DOCKS_EXPORT MDIArea : public Views::View_qtwidgets<QWidget>
|
||||
class DOCKS_EXPORT MDIArea_qtwidgets : public Views::View_qtwidgets<QWidget>
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MDIArea(QWidget *parent = nullptr);
|
||||
~MDIArea();
|
||||
explicit MDIArea_qtwidgets(QWidget *parent = nullptr);
|
||||
~MDIArea_qtwidgets();
|
||||
|
||||
/// @brief docks the dock widgets into this MDI area, at the specified position
|
||||
void addDockWidget(Controllers::DockWidget *dw, QPoint localPt, InitialOption addingOption = {});
|
||||
@@ -68,4 +69,6 @@ private:
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -81,7 +81,7 @@ static Controller *controllerForWidget(QWidget *widget)
|
||||
break;
|
||||
|
||||
case Type::MDIArea:
|
||||
if (auto view = qobject_cast<MDIArea *>(widget))
|
||||
if (auto view = qobject_cast<MDIArea_qtwidgets *>(widget))
|
||||
return view->controller();
|
||||
break;
|
||||
case Type::SideBar:
|
||||
@@ -225,7 +225,7 @@ bool ViewWrapper_qtwidgets::is(Type t) const
|
||||
case Type::RubberBand:
|
||||
return qobject_cast<RubberBand_qtwidgets *>(m_widget);
|
||||
case Type::MDIArea:
|
||||
return qobject_cast<MDIArea *>(m_widget);
|
||||
return qobject_cast<MDIArea_qtwidgets *>(m_widget);
|
||||
case Type::LayoutItem:
|
||||
case Type::None:
|
||||
qWarning() << Q_FUNC_INFO << "These are framework internals that are not wrapped";
|
||||
|
||||
@@ -310,7 +310,7 @@ void TestQtWidgets::tst_mdi_mixed_with_docking()
|
||||
|
||||
m->addDockWidget(dock1, Location_OnBottom);
|
||||
|
||||
auto mdiArea = new MDIArea();
|
||||
auto mdiArea = new Views::MDIArea_qtwidgets();
|
||||
m->setPersistentCentralView(std::shared_ptr<ViewWrapper>(new Views::ViewWrapper_qtwidgets(mdiArea)));
|
||||
|
||||
auto mdiWidget1 = createDockWidget("mdi1", new QPushButton("mdi1"));
|
||||
@@ -356,7 +356,7 @@ void TestQtWidgets::tst_mdi_mixed_with_docking2()
|
||||
|
||||
m->addDockWidget(dock1, Location_OnBottom);
|
||||
|
||||
auto mdiArea = new MDIArea();
|
||||
auto mdiArea = new Views::MDIArea_qtwidgets();
|
||||
|
||||
m->setPersistentCentralView(std::shared_ptr<ViewWrapper>(new Views::ViewWrapper_qtwidgets(mdiArea)));
|
||||
|
||||
@@ -527,7 +527,7 @@ void TestQtWidgets::tst_mdi_mixed_with_docking_setMDISize()
|
||||
|
||||
m->addDockWidget(dock1, Location_OnBottom);
|
||||
|
||||
auto mdiArea = new MDIArea();
|
||||
auto mdiArea = new Views::MDIArea_qtwidgets();
|
||||
m->setPersistentCentralView(std::shared_ptr<ViewWrapper>(new Views::ViewWrapper_qtwidgets(mdiArea)));
|
||||
|
||||
auto createSheet = [](int id) -> Controllers::DockWidget * {
|
||||
|
||||
Reference in New Issue
Block a user