#include <QObject>
#include <QKeyEvent>
#include <QStringList>
-#include <QStringListModel>
+#include <QAbstractListModel>
#include <QListView>
#include <QPushButton>
+#include "support/qstring_helpers.h"
+
+#include <vector>
+
namespace lyx {
namespace frontend {
QPushButton * delPB,
QPushButton * upPB,
QPushButton * downPB,
- QStringListModel * availableModel,
- QStringListModel * selectedModel);
+ QAbstractListModel * availableModel,
+ QAbstractListModel * selectedModel);
/// Sets the state of the various push buttons, depending upon the
/// state of the widgets. (E.g., "delete" is enabled only if the
/// selection is non-empty.)
- virtual void updateView();
+ /// Note: this is separated out into updateAddPB(), etc, below,
+ /// for easy over-riding of these functions.
+ void update();
/// Not strictly a matter of focus, which may be elsewhere, but
/// whether selectedLV is `more focused' than availableLV. Intended
///Given a QModelIndex from availableLV, determines whether it has
///been selected (i.e., is also in selectedLV).
bool isSelected(const QModelIndex & idx);
+ ///
+ bool insertRowToSelected(int i, QMap<int, QVariant> const & itemData);
+ ///
+ QListView * availableLV;
+ ///
+ QListView * selectedLV;
+ ///
+ QPushButton * addPB;
+ ///
+ QPushButton * deletePB;
+ ///
+ QPushButton * upPB;
+ ///
+ QPushButton * downPB;
+ ///
+ QAbstractListModel * availableModel;
+ ///
+ QAbstractListModel * selectedModel;
protected Q_SLOTS:
///
///
void selectedChanged(const QModelIndex & idx, const QModelIndex &);
///
- void addPB_clicked();
+ virtual void addPB_clicked();
///
- void deletePB_clicked();
+ virtual void deletePB_clicked();
///
- void upPB_clicked();
+ virtual void upPB_clicked();
///
- void downPB_clicked();
+ virtual void downPB_clicked();
///
void availableLV_clicked(const QModelIndex &);
///
bool eventFilter(QObject *, QEvent *);
private:
- QListView * availableLV;
- QListView * selectedLV;
- QPushButton * addPB;
- QPushButton * deletePB;
- QPushButton * upPB;
- QPushButton * downPB;
- QStringListModel * availableModel;
- QStringListModel * selectedModel;
- //Dialog::View * dialog;
-
+ ///
+ virtual void updateAddPB();
+ ///
+ virtual void updateDelPB();
+ ///
+ virtual void updateDownPB();
+ ///
+ virtual void updateUpPB();
+ ///
bool selectedHasFocus_;
};