mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Adapt to setSupportedDragActions() begin removed.
Models have a virtual supportedDragActions() now.
This commit is contained in:
parent
5a745da07b
commit
e3cde7b55e
@ -22,6 +22,11 @@ SortFilterHideProxyModel::SortFilterHideProxyModel(QObject* parent)
|
||||
{
|
||||
}
|
||||
|
||||
Qt::DropActions SortFilterHideProxyModel::supportedDragActions() const
|
||||
{
|
||||
return sourceModel()->supportedDragActions();
|
||||
}
|
||||
|
||||
void SortFilterHideProxyModel::hideColumn(int column, bool hide)
|
||||
{
|
||||
m_hiddenColumns.resize(column + 1);
|
||||
|
@ -29,6 +29,7 @@ class SortFilterHideProxyModel : public QSortFilterProxyModel
|
||||
|
||||
public:
|
||||
explicit SortFilterHideProxyModel(QObject* parent = Q_NULLPTR);
|
||||
Qt::DropActions supportedDragActions() const Q_DECL_OVERRIDE;
|
||||
void hideColumn(int column, bool hide);
|
||||
|
||||
protected:
|
||||
|
@ -29,7 +29,6 @@ EntryModel::EntryModel(QObject* parent)
|
||||
: QAbstractTableModel(parent)
|
||||
, m_group(Q_NULLPTR)
|
||||
{
|
||||
setSupportedDragActions(Qt::MoveAction | Qt::CopyAction);
|
||||
}
|
||||
|
||||
Entry* EntryModel::entryFromIndex(const QModelIndex& index) const
|
||||
@ -191,6 +190,11 @@ Qt::DropActions EntryModel::supportedDropActions() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
Qt::DropActions EntryModel::supportedDragActions() const
|
||||
{
|
||||
return (Qt::MoveAction | Qt::CopyAction);
|
||||
}
|
||||
|
||||
Qt::ItemFlags EntryModel::flags(const QModelIndex& modelIndex) const
|
||||
{
|
||||
if (!modelIndex.isValid()) {
|
||||
|
@ -47,6 +47,7 @@ public:
|
||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
|
||||
Qt::DropActions supportedDropActions() const Q_DECL_OVERRIDE;
|
||||
Qt::DropActions supportedDragActions() const Q_DECL_OVERRIDE;
|
||||
Qt::ItemFlags flags(const QModelIndex& modelIndex) const Q_DECL_OVERRIDE;
|
||||
QStringList mimeTypes() const Q_DECL_OVERRIDE;
|
||||
QMimeData* mimeData(const QModelIndexList& indexes) const Q_DECL_OVERRIDE;
|
||||
|
@ -32,7 +32,6 @@ EntryView::EntryView(QWidget* parent)
|
||||
m_sortModel->setDynamicSortFilter(true);
|
||||
m_sortModel->setSortLocaleAware(true);
|
||||
m_sortModel->setSortCaseSensitivity(Qt::CaseInsensitive);
|
||||
m_sortModel->setSupportedDragActions(m_model->supportedDragActions());
|
||||
QTreeView::setModel(m_sortModel);
|
||||
|
||||
setUniformRowHeights(true);
|
||||
|
Loading…
Reference in New Issue
Block a user