From e1c3e4b68651a27c60137f1910d5c6ca9fad3c92 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 22 Jun 2016 20:28:44 +0300 Subject: [PATCH] Small addition to commit 02eb44be: fix regression related to QtxComboBox's signal activatedId(int). --- src/Qtx/QtxComboBox.cxx | 19 ++++++++++++++++++- src/Qtx/QtxComboBox.h | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/Qtx/QtxComboBox.cxx b/src/Qtx/QtxComboBox.cxx index c9da713ac..59f270182 100755 --- a/src/Qtx/QtxComboBox.cxx +++ b/src/Qtx/QtxComboBox.cxx @@ -241,7 +241,12 @@ void QtxComboBox::onCurrentChanged( int idx ) if ( idx != -1 ) { resetClear(); + QVariant ident = id( idx ); emit activatedId( id( idx ) ); + if ( ident.type() == QVariant::Int ) + emit activatedId( ident.toInt() ); + else if ( ident.type() == QVariant::String ) + emit activatedId( ident.toString() ); } } @@ -291,7 +296,19 @@ bool QtxComboBox::hasId( const int idx ) const } /*! - \fn void QtxComboBox::activatedId( int ident ) + \fn void QtxComboBox::activatedId( QVariant ident ) \brief Emitted when item with identificator \a ident is activated. \param ident item's identifier */ + +/*! + \fn void QtxComboBox::activatedId( int ident ) + \brief Emitted when item with integer identificator \a ident is activated. + \param ident item's identifier +*/ + +/*! + \fn void QtxComboBox::activatedId( QString ident ) + \brief Emitted when item with string identificator \a ident is activated. + \param ident item's identifier +*/ diff --git a/src/Qtx/QtxComboBox.h b/src/Qtx/QtxComboBox.h index 45cad6740..52f159542 100755 --- a/src/Qtx/QtxComboBox.h +++ b/src/Qtx/QtxComboBox.h @@ -60,6 +60,8 @@ public: signals: void activatedId( QVariant ); + void activatedId( int ); + void activatedId( QString ); private slots: void onCurrentChanged( int ); -- 2.39.2