mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 04:53:53 +00:00
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
|
#ifndef CSV_WIDGET_DROPLINEEDIT_HPP
|
||
|
#define CSV_WIDGET_DROPLINEEDIT_HPP
|
||
|
|
||
|
#include <QLineEdit>
|
||
|
|
||
|
#include "../../model/world/universalid.hpp"
|
||
|
|
||
|
namespace CSMDoc
|
||
|
{
|
||
|
class Document;
|
||
|
}
|
||
|
|
||
|
namespace CSMWorld
|
||
|
{
|
||
|
class TableMimeData;
|
||
|
}
|
||
|
|
||
|
namespace CSVWidget
|
||
|
{
|
||
|
class DropLineEdit : public QLineEdit
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
CSMWorld::UniversalId::Type mDropType;
|
||
|
///< The accepted ID type for this LineEdit.
|
||
|
///< If \a mDropType has Type_None type, this LineEdit accepts all ID types
|
||
|
|
||
|
bool canAcceptEventData(QDropEvent *event) const;
|
||
|
///< Checks whether the \a event contains CSMWorld::TableMimeData with a proper ID type
|
||
|
|
||
|
int getAcceptedDataIndex(const CSMWorld::TableMimeData &data) const;
|
||
|
///< Checks whether the \a data has a proper type
|
||
|
///< \return -1 if there is no suitable data (ID type)
|
||
|
|
||
|
public:
|
||
|
DropLineEdit(QWidget *parent = 0,
|
||
|
CSMWorld::UniversalId::Type type = CSMWorld::UniversalId::Type_None);
|
||
|
|
||
|
protected:
|
||
|
void dragEnterEvent(QDragEnterEvent *event);
|
||
|
void dragMoveEvent(QDragMoveEvent *event);
|
||
|
void dropEvent(QDropEvent *event);
|
||
|
|
||
|
signals:
|
||
|
void tableMimeDataDropped(const std::vector<CSMWorld::UniversalId> &data,
|
||
|
const CSMDoc::Document *document);
|
||
|
};
|
||
|
}
|
||
|
|
||
|
#endif
|