Public Slots | Public Member Functions | Friends

QxtLanguageComboBoxPrivate Class Reference

#include <qxtlanguagecombobox_p.h>

Inheritance diagram for QxtLanguageComboBoxPrivate:
Inheritance graph
[legend]
Collaboration diagram for QxtLanguageComboBoxPrivate:
Collaboration graph
[legend]

List of all members.

Public Slots

void setCurrentLanguage (QLocale::Language language)
void comboBoxCurrentIndexChanged (int index)

Public Member Functions

 QxtLanguageComboBoxPrivate ()
void init ()
QLocale::Language currentLanguage () const
QString currentLanguageName () const
void setDisplayMode (QxtLanguageComboBox::DisplayMode mode)
void setTranslationPath (const QString &path)
QxtLanguageComboBox::DisplayMode displayMode () const
QString translationPath () const

Friends

class QxtLanguageComboBox

Detailed Description

Definition at line 33 of file qxtlanguagecombobox_p.h.


Constructor & Destructor Documentation

QxtLanguageComboBoxPrivate::QxtLanguageComboBoxPrivate (  ) [explicit]

Definition at line 189 of file qxtlanguagecombobox.cpp.

        : _mDisplayMode(QxtLanguageComboBox::AllLanguages), _mTranslationPath("."), _mModel(0)
{
}

Member Function Documentation

void QxtLanguageComboBoxPrivate::comboBoxCurrentIndexChanged ( int  index ) [slot]

Definition at line 237 of file qxtlanguagecombobox.cpp.

Referenced by init().

{
    handleLanguageChange();
}
QLocale::Language QxtLanguageComboBoxPrivate::currentLanguage (  ) const

Definition at line 248 of file qxtlanguagecombobox.cpp.

References QxtPrivate< QxtLanguageComboBox >::qxt_p().

{
    if (_mModel == NULL)
        return QLocale::C;

    QModelIndex idx = _mModel->index(qxt_p().currentIndex(), 1);
    QLocale::Language currentLang = static_cast<QLocale::Language>(idx.data().toInt());
    return currentLang;
}
QString QxtLanguageComboBoxPrivate::currentLanguageName (  ) const

Definition at line 258 of file qxtlanguagecombobox.cpp.

References QxtPrivate< QxtLanguageComboBox >::qxt_p().

{
    return qxt_p().currentText();
}
QxtLanguageComboBox::DisplayMode QxtLanguageComboBoxPrivate::displayMode (  ) const [inline]

Definition at line 48 of file qxtlanguagecombobox_p.h.

    {
        return _mDisplayMode;
    }
void QxtLanguageComboBoxPrivate::init (  )

Definition at line 194 of file qxtlanguagecombobox.cpp.

References comboBoxCurrentIndexChanged(), and QxtPrivate< QxtLanguageComboBox >::qxt_p().

{
    connect(&qxt_p(), SIGNAL(currentIndexChanged(int)), this, SLOT(comboBoxCurrentIndexChanged(int)));
}
void QxtLanguageComboBoxPrivate::setCurrentLanguage ( QLocale::Language  language ) [slot]

Definition at line 263 of file qxtlanguagecombobox.cpp.

References QxtPrivate< QxtLanguageComboBox >::qxt_p().

{
    // column 1 is QLocale::Language
    QModelIndex start = _mModel->index(0, 1);
    QModelIndexList result = _mModel->match(start, Qt::DisplayRole, language, 1, Qt::MatchExactly);
    if (!result.isEmpty())
        qxt_p().setCurrentIndex(result.first().row());
//   else
//     qDebug() << "Cannot setCurrentLanguage: " << language << _mModel;

    handleLanguageChange();
}
void QxtLanguageComboBoxPrivate::setDisplayMode ( QxtLanguageComboBox::DisplayMode  mode )

Definition at line 208 of file qxtlanguagecombobox.cpp.

{
    if (_mDisplayMode == mode && _mModel != 0)
        return;

    _mDisplayMode = mode;
    reset();
}
void QxtLanguageComboBoxPrivate::setTranslationPath ( const QString &  path )

Definition at line 199 of file qxtlanguagecombobox.cpp.

{
    if (_mTranslationPath == path)
        return;

    _mTranslationPath = path;
    reset();
}
QString QxtLanguageComboBoxPrivate::translationPath (  ) const [inline]

Definition at line 52 of file qxtlanguagecombobox_p.h.

    {
        return _mTranslationPath;
    }

Friends And Related Function Documentation

friend class QxtLanguageComboBox [friend]

Definition at line 37 of file qxtlanguagecombobox_p.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines