• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

  • sources
  • kde-4.12
  • kdenetwork
  • kget
  • ui
  • metalinkcreator
localemodels.h
Go to the documentation of this file.
1 /***************************************************************************
2 * Copyright (C) 2009 Matthias Fuchs <mat69@gmx.net> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
18 ***************************************************************************/
19 
20 #ifndef LOCALEMODELS_H
21 #define LOCALEMODELS_H
22 
23 #include <QtCore/QAbstractListModel>
24 
25 #include <KIcon>
26 
35 class CountryModel : public QAbstractListModel
36 {
37  Q_OBJECT
38 
39  public:
40  CountryModel(QObject *parent = 0);
41 
42  int rowCount (const QModelIndex &parent = QModelIndex()) const;
43  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
44 
45  void setupModelData(const QStringList &countryCodes);
46 
47  private:
48  QStringList m_countryCodes;
49  QStringList m_countryNames;
50  QList<KIcon> m_countryIcons;
51 };
52 
56 class LanguageModel : public QAbstractListModel
57 {
58  Q_OBJECT
59 
60  public:
61  LanguageModel(QObject *parent = 0);
62 
63  int rowCount (const QModelIndex &parent = QModelIndex()) const;
64  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
65 
66  void setupModelData(const QStringList &languageCodes);
67 
68  private:
69  QStringList m_languageCodes;
70  QStringList m_languageNames;
71 };
72 
73 #endif
CountryModel::setupModelData
void setupModelData(const QStringList &countryCodes)
Definition: localemodels.cpp:64
LanguageModel::LanguageModel
LanguageModel(QObject *parent=0)
Definition: localemodels.cpp:88
QAbstractListModel
QObject
LanguageModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: localemodels.cpp:93
CountryModel::CountryModel
CountryModel(QObject *parent=0)
Definition: localemodels.cpp:26
CountryModel
The following models are there to store the localized names and the codes of languages and countries ...
Definition: localemodels.h:35
LanguageModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: localemodels.cpp:112
LanguageModel::setupModelData
void setupModelData(const QStringList &languageCodes)
Definition: localemodels.cpp:122
CountryModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: localemodels.cpp:54
LanguageModel
The LanguageModel stores localized names as well as the codes of languages.
Definition: localemodels.h:56
CountryModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Definition: localemodels.cpp:31
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal