applicationdatabasemodel.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5 *
6 * ArmarX is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * ArmarX is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 * @package ArmarXCore::core
19 * @author Cedric Seehausen (usdnr at kit dot edu)
20 * @date 2016
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24
25
26#pragma once
27
28#include <memory>
29
30#include <QStringList>
31
33#include "treemodel.h"
34
35/**
36* @class ApplicationDatabaseModel
37* @brief Model underlying the ApplicationDatabaseView.
38*/
40{
41public:
42 /**
43 * Constructor that sets up the first item contained by this model.
44 */
46
47 /**
48 * Returns the data at the specified index, depending on the specified role.
49 * @param index of the data
50 * @param role role of the data
51 * @return contained data
52 */
53 QVariant data(const QModelIndex& index, int role) const override;
54
55 /**
56 * Returns the behavioural flags of the object at the specified index.
57 * @param index index of the object
58 * @return behavioural flags
59 */
60 Qt::ItemFlags flags(const QModelIndex& index) const override;
61
62 /**
63 * Returns the supported drag action. In this case always Qt::CopyAction.
64 */
65 Qt::DropActions supportedDragActions() const override;
66
67 /**
68 * Returns supported MIME-types.
69 * @return list of the supported MIME-types
70 */
71 QStringList mimeTypes() const override;
72
73 /**
74 * Returns the mimedata of the objects at the specified indexes.
75 * @param indexes object indexes
76 * @return data about the mime type of the objects
77 */
78 QMimeData* mimeData(const QModelIndexList& indexes) const override;
79
80 /**
81 * Updates the model.
82 */
83 void update();
84
85 /**
86 * Clears and resets this model as if it was newly constructed.
87 */
88 void clear() override;
89
91};
92
93using ApplicationDatabaseModelPtr = std::shared_ptr<ApplicationDatabaseModel>;
uint8_t data[1]
std::shared_ptr< ApplicationDatabaseModel > ApplicationDatabaseModelPtr
This class represents an item in the ApplicationDatabaseView.
QStringList mimeTypes() const override
Returns supported MIME-types.
ApplicationDatabaseItem * getRootItem()
ApplicationDatabaseModel()
Constructor that sets up the first item contained by this model.
Qt::ItemFlags flags(const QModelIndex &index) const override
Returns the behavioural flags of the object at the specified index.
Qt::DropActions supportedDragActions() const override
Returns the supported drag action.
void clear() override
Clears and resets this model as if it was newly constructed.
QMimeData * mimeData(const QModelIndexList &indexes) const override
Returns the mimedata of the objects at the specified indexes.
TreeModel(QObject *parent=0)
Definition treemodel.cpp:32
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Definition treemodel.cpp:99