Commit d9b5a8f4 authored by Dan Pascu's avatar Dan Pascu

Set drag and drop attributes from designer instead of having them hardcoded

parent f0d576f6
...@@ -694,8 +694,6 @@ class ContactListView(QListView): ...@@ -694,8 +694,6 @@ class ContactListView(QListView):
def __init__(self, parent=None): def __init__(self, parent=None):
super(ContactListView, self).__init__(parent) super(ContactListView, self).__init__(parent)
self.setItemDelegate(ContactDelegate(self)) self.setItemDelegate(ContactDelegate(self))
self.setDragEnabled(True)
self.setAcceptDrops(True)
self.setDropIndicatorShown(False) self.setDropIndicatorShown(False)
self.drop_indicator_index = QModelIndex() self.drop_indicator_index = QModelIndex()
self.restore_timer = QTimer(self) self.restore_timer = QTimer(self)
...@@ -871,8 +869,6 @@ class ContactSearchListView(QListView): ...@@ -871,8 +869,6 @@ class ContactSearchListView(QListView):
def __init__(self, parent=None): def __init__(self, parent=None):
super(ContactSearchListView, self).__init__(parent) super(ContactSearchListView, self).__init__(parent)
self.setItemDelegate(ContactDelegate(self)) self.setItemDelegate(ContactDelegate(self))
self.setDragEnabled(True)
self.setAcceptDrops(True)
self.setDropIndicatorShown(False) self.setDropIndicatorShown(False)
self.drop_indicator_index = QModelIndex() self.drop_indicator_index = QModelIndex()
......
...@@ -293,6 +293,12 @@ ...@@ -293,6 +293,12 @@
<property name="horizontalScrollBarPolicy"> <property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum> <enum>Qt::ScrollBarAlwaysOff</enum>
</property> </property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragDrop</enum>
</property>
<property name="alternatingRowColors"> <property name="alternatingRowColors">
<bool>true</bool> <bool>true</bool>
</property> </property>
...@@ -419,6 +425,12 @@ ...@@ -419,6 +425,12 @@
</property> </property>
<item> <item>
<widget class="ContactSearchListView" name="search_list"> <widget class="ContactSearchListView" name="search_list">
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::DragDrop</enum>
</property>
<property name="alternatingRowColors"> <property name="alternatingRowColors">
<bool>true</bool> <bool>true</bool>
</property> </property>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment