qml: decouple ClassicIndicator from QRubberBand

the rubber band is now returned from the factory, meaning it can
be a QQuickItem when QtQuick is being used

Still need to remove the QtWidget'isms from IndicatorWindow
though
This commit is contained in:
Sergio Martins
2020-08-09 18:39:56 +01:00
parent dc3aa354ec
commit 64791eec82
4 changed files with 20 additions and 7 deletions

View File

@@ -25,6 +25,7 @@
# include "widgets/TabWidgetWidget_p.h"
# include "multisplitter/Separator_qwidget.h"
# include "widgets/FloatingWindowWidget_p.h"
# include <QRubberBand>
#else
# include "quick/FrameQuick_p.h"
# include "quick/DockWidgetQuick.h"
@@ -84,6 +85,12 @@ DropIndicatorOverlayInterface *DefaultWidgetFactory::createDropIndicatorOverlay(
{
return new ClassicIndicators(dropArea);
}
QWidgetOrQuick *DefaultWidgetFactory::createRubberBand(QWidgetOrQuick *parent) const
{
return new QRubberBand(QRubberBand::Rectangle, parent);
}
#else
Frame *DefaultWidgetFactory::createFrame(QWidgetOrQuick *parent, FrameOptions options) const
@@ -140,4 +147,9 @@ Layouting::Separator *DefaultWidgetFactory::createSeparator(Layouting::Widget *p
return new Layouting::SeparatorQuick(parent);
}
QWidgetOrQuick *DefaultWidgetFactory::createRubberBand(QWidgetOrQuick *parent) const
{
return new QWidgetOrQuick(parent);
}
#endif