Enable internal move in the list. Helps user quickly make reorder.
--HG-- branch : feature
This commit is contained in:
parent
eb84ae7526
commit
f40bf977c8
|
@ -29,6 +29,7 @@
|
|||
#include "mainwindow.h"
|
||||
#include "core/vapplication.h"
|
||||
#include "../fervor/fvupdater.h"
|
||||
#include "../vpatterndb/vpiecenode.h"
|
||||
|
||||
#include <QMessageBox> // For QT_REQUIRE_VERSION
|
||||
#include <QTimer>
|
||||
|
@ -53,6 +54,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
qt_qhash_seed.store(0); // Lock producing random attribute order in XML
|
||||
|
||||
qRegisterMetaTypeStreamOperators<VPieceNode>("VPieceNode");
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
||||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // DPI support
|
||||
#endif
|
||||
|
|
|
@ -97,3 +97,24 @@ void VPieceNode::SetReverse(bool reverse)
|
|||
d->m_reverse = reverse;
|
||||
}
|
||||
}
|
||||
|
||||
// Friend functions
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QDataStream& operator<<(QDataStream& out, const VPieceNode& p)
|
||||
{
|
||||
out << p.d->m_id << static_cast<int>(p.d->m_typeTool) << p.d->m_reverse;
|
||||
return out;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
QDataStream& operator>>(QDataStream& in, VPieceNode& p)
|
||||
{
|
||||
in >> p.d->m_id;
|
||||
|
||||
int type = 0;
|
||||
in >> type;
|
||||
p.d->m_typeTool = static_cast<Tool>(type);
|
||||
|
||||
in >> p.d->m_reverse;
|
||||
return in;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,9 @@ public:
|
|||
VPieceNode &operator=(const VPieceNode &node);
|
||||
~VPieceNode();
|
||||
|
||||
friend QDataStream& operator<<(QDataStream& out, const VPieceNode& p);
|
||||
friend QDataStream& operator>>(QDataStream& in, VPieceNode& p);
|
||||
|
||||
quint32 GetId() const;
|
||||
void SetId(quint32 id);
|
||||
|
||||
|
|
|
@ -59,7 +59,11 @@
|
|||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidget"/>
|
||||
<widget class="QListWidget" name="listWidget">
|
||||
<property name="dragDropMode">
|
||||
<enum>QAbstractItemView::InternalMove</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="helpLabel">
|
||||
|
|
Loading…
Reference in New Issue
Block a user