1 /* 2 dialog page for multiple choice suggestions 3 SPDX-FileCopyrightText: 1999-2001 Ewald Arnold <kvoctrain@ewald-arnold.de> 4 SPDX-FileCopyrightText: 2005-2006 Peter Hedlund <peter.hedlund@kdemail.net> 5 SPDX-FileCopyrightText: 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net> 6 SPDX-License-Identifier: GPL-2.0-or-later 7 */ 8 9 #ifndef MULTIPLECHOICEWIDGET_H 10 #define MULTIPLECHOICEWIDGET_H 11 12 #include "ui_multiplechoicewidget.h" 13 14 #include <QModelIndex> 15 16 class KEduVocExpression; 17 class KEduVocTranslation; 18 class QStringListModel; 19 20 namespace Editor 21 { 22 class MultipleChoiceWidget : public QWidget, public Ui::multipleChoiceWidget 23 { 24 Q_OBJECT 25 26 public: 27 explicit MultipleChoiceWidget(QWidget *parent = nullptr); 28 29 public slots: 30 void setTranslation(KEduVocExpression *entry, int translation); 31 32 protected: 33 bool eventFilter(QObject *obj, QEvent *event) override; 34 35 private slots: 36 void slotDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); 37 void slotAddChoiceButton(); 38 void slotRemoveChoiceButton(); 39 40 private: 41 KEduVocTranslation *m_translation{nullptr}; 42 QStringListModel *m_choicesModel{nullptr}; 43 }; 44 } 45 46 #endif 47