diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index f857f4eac0..3718f09337 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -2377,6 +2377,16 @@ QSize QComboBox::sizeHint() const } #ifdef Q_OS_OSX + +namespace { +struct IndexSetter { + int index; + QComboBox *cb; + + void operator()(void) { cb->setCurrentIndex(index); } +}; +} + /*! * \internal * @@ -2391,13 +2401,6 @@ bool QComboBoxPrivate::showNativePopup() if (QPlatformMenu *menu = theme->createPlatformMenu()) { int itemsCount = q->count(); - struct IndexSetter { - int index; - QComboBox *cb; - - void operator()(void) { cb->setCurrentIndex(index); } - }; - QList items; items.reserve(itemsCount); QPlatformMenuItem *currentItem = 0;