diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2014-06-18 15:30:35 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2014-06-19 17:14:05 +0200 |
commit | d88b976858437f081ef9f8150b3697586a5bf73a (patch) | |
tree | 72c4c9d3646b14ef6a231e24b535fbd51a12f23c /src/widgets/widgets | |
parent | 2de8ef2e49d1a14b5d4acf7bfd9539dadbcbc54f (diff) |
Fix compilation in under -no-c++11 mode
IndexSetter can't be passed to QObject::connect() since C++98 templates
require global types (they can't be function-local).
Change-Id: I099322f835661d4679140b7810b50dbeb0e4b9e0
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/widgets/widgets')
-rw-r--r-- | src/widgets/widgets/qcombobox.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
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<QPlatformMenuItem *> items; items.reserve(itemsCount); QPlatformMenuItem *currentItem = 0; |