1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-23 20:23:54 +00:00
openmw/apps/launcher/utils/profilescombobox.hpp

47 lines
1.1 KiB
C++
Raw Normal View History

#ifndef PROFILESCOMBOBOX_HPP
#define PROFILESCOMBOBOX_HPP
#include "components/contentselector/view/combobox.hpp"
#include "lineedit.hpp"
2022-06-16 19:29:55 +00:00
#include <QWidget>
class QString;
class ProfilesComboBox : public ContentSelectorView::ComboBox
{
Q_OBJECT
public:
class ComboBoxLineEdit : public LineEdit
{
public:
2022-09-22 18:26:05 +00:00
explicit ComboBoxLineEdit(QWidget* parent = nullptr);
};
public:
2022-09-22 18:26:05 +00:00
explicit ProfilesComboBox(QWidget* parent = nullptr);
void setEditEnabled(bool editable);
void setCurrentProfile(int index)
{
ComboBox::setCurrentIndex(index);
mOldProfile = currentText();
}
signals:
2022-09-22 18:26:05 +00:00
void signalProfileTextChanged(const QString& item);
void signalProfileChanged(const QString& previous, const QString& current);
void signalProfileChanged(int index);
2022-09-22 18:26:05 +00:00
void profileRenamed(const QString& oldName, const QString& newName);
private slots:
void slotEditingFinished();
void slotIndexChangedByUser(int index);
2022-09-22 18:26:05 +00:00
void slotTextChanged(const QString& text);
private:
QString mOldProfile;
};
#endif // PROFILESCOMBOBOX_HPP