fix: #13 custom drop area widgets

- adds public function to set widgets
- some cleanup changes
This commit is contained in:
mfreiholz
2016-04-18 09:40:51 +02:00
parent 180ed31fc4
commit e04b5c7900
5 changed files with 35 additions and 6 deletions

View File

@@ -11,6 +11,7 @@
#include <QBoxLayout>
#include "ads/SectionWidget.h"
#include "ads/DropOverlay.h"
#include "dialogs/SectionContentListWidget.h"
@@ -102,6 +103,18 @@ MainWindow::MainWindow(QWidget *parent) :
#endif
setCentralWidget(_container);
// Optional: Use custom drop area widgets.
if (false)
{
QHash<ADS_NS::DropArea, QWidget*> areaWidgets;
areaWidgets.insert(ADS_NS::TopDropArea, new QPushButton("TOP"));
areaWidgets.insert(ADS_NS::RightDropArea, new QPushButton("RIGHT"));
areaWidgets.insert(ADS_NS::BottomDropArea, new QPushButton("BOTTOM"));
areaWidgets.insert(ADS_NS::LeftDropArea, new QPushButton("LEFT"));
areaWidgets.insert(ADS_NS::CenterDropArea, new QPushButton("CENTER"));
_container->dropOverlay()->setAreaWidgets(areaWidgets);
}
// ADS - Adding some contents.
// Test #1: Use high-level public API
if (true)