X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiSelectionManager.cpp;h=4d172bc35d890cb52de14e27d6ec9f50f9edcfaf;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=ab95ed08f2ad1dbef0da6cda8d0e2f98f170d262;hpb=47821c7a2c8ccf2d7e9aac76a09b2e64b80f373a;p=lyx.git diff --git a/src/frontends/qt4/GuiSelectionManager.cpp b/src/frontends/qt4/GuiSelectionManager.cpp index ab95ed08f2..4d172bc35d 100644 --- a/src/frontends/qt4/GuiSelectionManager.cpp +++ b/src/frontends/qt4/GuiSelectionManager.cpp @@ -23,12 +23,20 @@ #include #include +#ifdef KeyPress +#undef KeyPress +#endif + +#ifdef ControlModifier +#undef ControlModifier +#endif + namespace lyx { namespace frontend { GuiSelectionManager::GuiSelectionManager( - QListView * avail, + QAbstractItemView * avail, QListView * sel, QPushButton * add, QPushButton * del, @@ -50,11 +58,11 @@ GuiSelectionManager::GuiSelectionManager( availableLV->setModel(amod); connect(availableLV->selectionModel(), - SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), - this, SLOT(availableChanged(const QModelIndex &, const QModelIndex &))); + SIGNAL(currentChanged(QModelIndex,QModelIndex)), + this, SLOT(availableChanged(QModelIndex, QModelIndex))); connect(selectedLV->selectionModel(), - SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), - this, SLOT(selectedChanged(const QModelIndex &, const QModelIndex &))); + SIGNAL(currentChanged(QModelIndex, QModelIndex)), + this, SLOT(selectedChanged(QModelIndex, QModelIndex))); connect(addPB, SIGNAL(clicked()), this, SLOT(addPB_clicked())); connect(deletePB, SIGNAL(clicked()), @@ -63,12 +71,12 @@ GuiSelectionManager::GuiSelectionManager( 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 &))); + connect(availableLV, SIGNAL(clicked(QModelIndex)), + this, SLOT(availableLV_clicked(QModelIndex))); + connect(availableLV, SIGNAL(doubleClicked(QModelIndex)), + this, SLOT(availableLV_doubleClicked(QModelIndex))); + connect(selectedLV, SIGNAL(clicked(QModelIndex)), + this, SLOT(selectedLV_clicked(QModelIndex))); availableLV->installEventFilter(this); selectedLV->installEventFilter(this); @@ -144,8 +152,8 @@ bool GuiSelectionManager::isSelected(const QModelIndex & idx) QVariant const & str = availableModel->data(idx, Qt::DisplayRole); QModelIndexList qmil = selectedModel->match(selectedModel->index(0), - Qt::DisplayRole, str, - Qt::MatchExactly | Qt::MatchWrap); + Qt::DisplayRole, str, 1, + Qt::MatchFlags(Qt::MatchExactly | Qt::MatchWrap)); return !qmil.empty(); } @@ -273,6 +281,7 @@ void GuiSelectionManager::downPB_clicked() // can enter the QListView in other ways. But there are no signals sent // in that case. We need to reimplement focusInEvent() to capture those, // which means subclassing QListView. (rgh) +// Or by installing an event listener.. (andre) void GuiSelectionManager::availableLV_clicked(const QModelIndex &) { selectedHasFocus_ = false; @@ -368,4 +377,4 @@ bool GuiSelectionManager::eventFilter(QObject * obj, QEvent * event) } // namespace frontend } // namespace lyx -#include "GuiSelectionManager_moc.cpp" +#include "moc_GuiSelectionManager.cpp"