diff --git a/examples/qtquick/customtitlebar/main.cpp b/examples/qtquick/customtitlebar/main.cpp index d0cf5bde..088ae2f4 100644 --- a/examples/qtquick/customtitlebar/main.cpp +++ b/examples/qtquick/customtitlebar/main.cpp @@ -24,9 +24,8 @@ public: ~CustomFrameworkWidgetFactory() override; - QUrl titleBarFilename(int userType) const override + QUrl titleBarFilename() const override { - Q_UNUSED(userType); return QUrl("qrc:/MyTitleBar.qml"); } }; diff --git a/src/FrameworkWidgetFactory.cpp b/src/FrameworkWidgetFactory.cpp index e74804d7..81b3e90d 100644 --- a/src/FrameworkWidgetFactory.cpp +++ b/src/FrameworkWidgetFactory.cpp @@ -54,9 +54,9 @@ FrameworkWidgetFactory::~FrameworkWidgetFactory() } #ifdef KDDOCKWIDGETS_QTWIDGETS -Frame *DefaultWidgetFactory::createFrame(QWidgetOrQuick *parent, FrameOptions options, int userType) const +Frame *DefaultWidgetFactory::createFrame(QWidgetOrQuick *parent, FrameOptions options) const { - return new FrameWidget(parent, options, userType); + return new FrameWidget(parent, options); } TitleBar *DefaultWidgetFactory::createTitleBar(Frame *frame) const @@ -138,9 +138,9 @@ QAbstractButton* DefaultWidgetFactory::createTitleBarButton(QWidget *parent, Tit #else -Frame *DefaultWidgetFactory::createFrame(QWidgetOrQuick *parent, FrameOptions options, int userType) const +Frame *DefaultWidgetFactory::createFrame(QWidgetOrQuick *parent, FrameOptions options) const { - return new FrameQuick(parent, options, userType); + return new FrameQuick(parent, options); } TitleBar *DefaultWidgetFactory::createTitleBar(Frame *frame) const @@ -212,9 +212,8 @@ SideBar *DefaultWidgetFactory::createSideBar(SideBarLocation loc, MainWindowBase return nullptr; } -QUrl DefaultWidgetFactory::titleBarFilename(int userType) const +QUrl DefaultWidgetFactory::titleBarFilename() const { - Q_UNUSED(userType); return QUrl(QStringLiteral("qrc:/kddockwidgets/private/quick/qml/TitleBar.qml")); } diff --git a/src/FrameworkWidgetFactory.h b/src/FrameworkWidgetFactory.h index 0c2681e1..507a14de 100644 --- a/src/FrameworkWidgetFactory.h +++ b/src/FrameworkWidgetFactory.h @@ -80,9 +80,7 @@ public: /// DockWidgets. ///@param parent just forward to Frame's constructor ///@param options just forward to Frame's constructor - ///@param userType corresponds to DockWidgetBase::userType() - virtual Frame* createFrame(QWidgetOrQuick *parent = nullptr, FrameOptions options = FrameOption_None, - int userType = 0) const = 0; + virtual Frame* createFrame(QWidgetOrQuick *parent = nullptr, FrameOptions options = FrameOption_None) const = 0; ///@brief Called internally by the framework to create a TitleBar /// Override to provide your own TitleBar sub-class. If overridden then @@ -144,7 +142,7 @@ public: ///@p parent the button's parent virtual QAbstractButton* createTitleBarButton(QWidget *parent, TitleBarButtonType) const = 0; #else - virtual QUrl titleBarFilename(int userType = 0) const = 0; + virtual QUrl titleBarFilename() const = 0; virtual QUrl dockwidgetFilename() const = 0; virtual QUrl frameFilename() const = 0; virtual QUrl floatingWindowFilename() const = 0; @@ -165,7 +163,7 @@ class DOCKS_EXPORT DefaultWidgetFactory : public FrameworkWidgetFactory Q_OBJECT public: DefaultWidgetFactory() = default; - Frame *createFrame(QWidgetOrQuick *parent, FrameOptions, int userType) const override; + Frame *createFrame(QWidgetOrQuick *parent, FrameOptions) const override; TitleBar *createTitleBar(Frame *) const override; TitleBar *createTitleBar(FloatingWindow *) const override; TabWidget *createTabWidget(Frame *parent) const override; @@ -180,7 +178,7 @@ public: #ifdef KDDOCKWIDGETS_QTWIDGETS QAbstractButton* createTitleBarButton(QWidget *parent, TitleBarButtonType) const override; #else - Q_INVOKABLE QUrl titleBarFilename(int userType = 0) const override; + Q_INVOKABLE QUrl titleBarFilename() const override; QUrl dockwidgetFilename() const override; QUrl frameFilename() const override; QUrl floatingWindowFilename() const override; diff --git a/src/private/MDILayoutWidget.cpp b/src/private/MDILayoutWidget.cpp index 604aea2e..ad6a69c9 100644 --- a/src/private/MDILayoutWidget.cpp +++ b/src/private/MDILayoutWidget.cpp @@ -46,8 +46,7 @@ void MDILayoutWidget::addDockWidget(DockWidgetBase *dw, QPoint localPt, InitialO if (frame) { newItem->setGuestWidget(frame); } else { - frame = Config::self().frameworkWidgetFactory()->createFrame(nullptr, FrameOption_None, - dw->userType()); + frame = Config::self().frameworkWidgetFactory()->createFrame(nullptr, FrameOption_None); frame->addWidget(dw, addingOption); newItem->setGuestWidget(frame);