8 #include <Wt/WAbstractItemModel.h> 9 #include <Wt/WItemSelectionModel.h> 10 #include <Wt/WMessageBox.h> 15 =
"application/x-computers-selection";
49 +
" files to folder '" 50 + cpp17::any_cast<WString>(target.
data(ItemDataRole::Display)).toUTF8()
52 StandardButton::Yes | StandardButton::No);
57 if (result == StandardButton::Yes) {
62 std::shared_ptr<WAbstractItemModel> sourceModel = selection->
model();
66 for (WModelIndexSet::reverse_iterator i = toChange.rbegin();
67 i != toChange.rend(); ++i) {
76 std::map<ItemDataRole, cpp17::any> data =
model()->itemData(target);
77 data[ItemDataRole::Decoration] = index.
data(ItemDataRole::Decoration);
78 sourceModel->setItemData(index, data);
std::shared_ptr< WAbstractItemModel > model() const
static const char * FileSelectionMimeType
Constant that indicates the mime type for a selection of files.
const std::string & mimeType() const
std::shared_ptr< WAbstractItemModel > model() const
WString asString(const cpp17::any &v, const WString &formatString=WString())
std::set< WModelIndex > WModelIndexSet
WModelIndexSet selectedIndexes() const
virtual void dropEvent(const WDropEvent &event, const WModelIndex &target)
Drop event.
cpp17::any data(ItemDataRole role=ItemDataRole::Display) const