A specialized treeview that supports a custom drop event.
More...
#include <FolderView.h>
|
static const char * | FileSelectionMimeType = "application/x-computers-selection" |
| Constant that indicates the mime type for a selection of files. More...
|
|
|
virtual void | dropEvent (const Wt::WDropEvent &event, const Wt::WModelIndex &target) |
| Drop event. More...
|
|
A specialized treeview that supports a custom drop event.
Definition at line 19 of file FolderView.h.
§ FolderView()
FolderView::FolderView |
( |
Wt::WContainerWidget * |
parent = 0 | ) |
|
Constructor.
Definition at line 19 of file FolderView.C.
static const char * FileSelectionMimeType
Constant that indicates the mime type for a selection of files.
§ dropEvent()
void FolderView::dropEvent |
( |
const Wt::WDropEvent & |
event, |
|
|
const Wt::WModelIndex & |
target |
|
) |
| |
|
protectedvirtual |
Drop event.
Definition at line 28 of file FolderView.C.
43 WItemSelectionModel *selection
44 =
dynamic_cast<WItemSelectionModel *
>(
event.source());
47 int result = WMessageBox::show
50 + boost::lexical_cast<std::string>(selection->selectedIndexes().size())
51 +
" files to folder '" 52 + boost::any_cast<WString>(target.data(DisplayRole)).toUTF8()
64 WAbstractItemModel *sourceModel = selection->model();
66 WModelIndexSet toChange = selection->selectedIndexes();
68 for (WModelIndexSet::reverse_iterator i = toChange.rbegin();
69 i != toChange.rend(); ++i) {
70 WModelIndex index = *i;
78 std::map<int, boost::any> data = model()->itemData(target);
79 data[DecorationRole] = index.data(DecorationRole);
80 sourceModel->setItemData(index, data);
static const char * FileSelectionMimeType
Constant that indicates the mime type for a selection of files.
§ FileSelectionMimeType
const char * FolderView::FileSelectionMimeType = "application/x-computers-selection" |
|
static |
Constant that indicates the mime type for a selection of files.
Every kind of dragged data should be identified using a unique mime type.
Definition at line 26 of file FolderView.h.
The documentation for this class was generated from the following files:
- /build/witty-8LS0oe/witty-3.3.6+dfsg/examples/treeview-dragdrop/FolderView.h
- /build/witty-8LS0oe/witty-3.3.6+dfsg/examples/treeview-dragdrop/FolderView.C