-availableLV = avail;
-selectedLV = sel;
-addPB = add;
-deletePB = del;
-upPB = up;
-downPB = down;
-availableModel = amod;
-selectedModel = smod;
-
-selectedLV->setModel(smod);
-availableLV->setModel(amod);
-
-connect(availableLV->selectionModel(),
- SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
- this, SLOT(availableChanged(const QModelIndex &, const QModelIndex &)));
-connect(selectedLV->selectionModel(),
- SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)),
- this, SLOT(selectedChanged(const QModelIndex &, const QModelIndex &)));
-connect(addPB, SIGNAL(clicked()),
- this, SLOT(addPB_clicked()));
-connect(deletePB, SIGNAL(clicked()),
- this, SLOT(deletePB_clicked()));
-connect(upPB, SIGNAL(clicked()),
- this, SLOT(upPB_clicked()));
-connect(downPB, SIGNAL(clicked()),
- this, SLOT(downPB_clicked()));
-connect(availableLV, SIGNAL(clicked(const QModelIndex &)),
- this, SLOT(availableLV_clicked(const QModelIndex &)));
-connect(availableLV, SIGNAL(doubleClicked(const QModelIndex &)),
- this, SLOT(availableLV_doubleClicked(const QModelIndex &)));
-connect(selectedLV, SIGNAL(clicked(const QModelIndex &)),
- this, SLOT(selectedLV_clicked(const QModelIndex &)));
-
-availableLV->installEventFilter(this);
-selectedLV->installEventFilter(this);
+ selectedLV->setModel(smod);
+ availableLV->setModel(amod);
+ selectedLV->setSelectionBehavior(QAbstractItemView::SelectRows);
+ selectedLV->setSelectionMode(QAbstractItemView::SingleSelection);
+
+ connect(availableLV->selectionModel(),
+ SIGNAL(currentChanged(QModelIndex, QModelIndex)),
+ this, SLOT(availableChanged(QModelIndex, QModelIndex)));
+ connect(selectedLV->selectionModel(),
+ SIGNAL(currentChanged(QModelIndex, QModelIndex)),
+ this, SLOT(selectedChanged(QModelIndex, QModelIndex)));
+ connect(availableLV->selectionModel(),
+ SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
+ this, SLOT(availableChanged(QItemSelection, QItemSelection)));
+ connect(selectedLV->selectionModel(),
+ SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
+ this, SLOT(selectedChanged(QItemSelection, QItemSelection)));
+ connect(selectedLV->itemDelegate(), SIGNAL(commitData(QWidget*)),
+ this, SLOT(selectedEdited()));
+ connect(addPB, SIGNAL(clicked()),
+ this, SLOT(addPB_clicked()));
+ connect(deletePB, SIGNAL(clicked()),
+ this, SLOT(deletePB_clicked()));
+ connect(upPB, SIGNAL(clicked()),
+ this, SLOT(upPB_clicked()));
+ connect(downPB, SIGNAL(clicked()),
+ this, SLOT(downPB_clicked()));
+ connect(availableLV, SIGNAL(doubleClicked(QModelIndex)),
+ this, SLOT(availableLV_doubleClicked(QModelIndex)));
+
+ availableLV->installEventFilter(this);
+ selectedLV->installEventFilter(this);