Skip to content

Commit

Permalink
Fixed #65 QxtCountryComboBox
Browse files Browse the repository at this point in the history
QxtCountryComboBox::currentCountry() and setCurrentCountry() were using wrong model column.
  • Loading branch information
jpnurmi committed Jul 30, 2010
1 parent 3458b35 commit cfb2863
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/qxtcountrycombobox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void QxtCountryComboBoxPrivate::comboBoxCurrentIndexChanged(int)

QLocale::Country QxtCountryComboBoxPrivate::currentCountry() const
{
QModelIndex idx = qxt_p().model()->index(qxt_p().currentIndex(), 3);
QModelIndex idx = qxt_p().model()->index(qxt_p().currentIndex(), 2);
return static_cast<QLocale::Country>(idx.data().toInt());
}

Expand All @@ -53,7 +53,7 @@ QString QxtCountryComboBoxPrivate::currentCountryName() const
void QxtCountryComboBoxPrivate::setCurrentCountry(QLocale::Country country)
{
// column 3 is QLocale::Country
QModelIndex start = qxt_p().model()->index(0, 3);
QModelIndex start = qxt_p().model()->index(0, 2);
QModelIndexList result = qxt_p().model()->match(start, Qt::DisplayRole, country, 1, Qt::MatchExactly);
if (!result.isEmpty())
qxt_p().setCurrentIndex(result.first().row());
Expand Down

0 comments on commit cfb2863

Please sign in to comment.