[welcome] Complete LocaleModel implementation

- It's a table with two columns (localized name and english name)
This commit is contained in:
Adriaan de Groot 2019-04-18 23:16:02 +02:00
parent 7f8411c3b7
commit 589168685e
2 changed files with 14 additions and 1 deletions

View File

@ -18,6 +18,19 @@
#include "LocaleModel.h" #include "LocaleModel.h"
LocaleModel::LocaleModel(const QStringList& locales, QObject* parent)
: QAbstractTableModel( parent )
{
m_locales.reserve( locales.count() );
for ( const auto& l : locales )
m_locales.emplace_back( l );
}
LocaleModel::~LocaleModel()
{
}
int int
LocaleModel::columnCount( const QModelIndex& ) const LocaleModel::columnCount( const QModelIndex& ) const
{ {

View File

@ -25,7 +25,7 @@
#include "utils/CalamaresUtilsGui.h" #include "utils/CalamaresUtilsGui.h"
class LocaleModel : public QAbstractItemModel class LocaleModel : public QAbstractTableModel
{ {
public: public:
LocaleModel( const QStringList& locales, QObject* parent = nullptr ); LocaleModel( const QStringList& locales, QObject* parent = nullptr );