buttonClicked signal added
This commit is contained in:
parent
763ac4a205
commit
5a19669f26
@ -448,6 +448,9 @@ int QskTabBar::insertTab( int index, QskTabButton* button )
|
||||
|
||||
m_data->connectButton( button, this, true );
|
||||
|
||||
connect( button, &QskAbstractButton::clicked,
|
||||
this, &QskTabBar::handleButtonClick );
|
||||
|
||||
Q_EMIT countChanged( count() );
|
||||
|
||||
return index;
|
||||
@ -657,6 +660,17 @@ void QskTabBar::adjustCurrentIndex()
|
||||
}
|
||||
}
|
||||
|
||||
void QskTabBar::handleButtonClick()
|
||||
{
|
||||
if ( auto button = qobject_cast< const QskTabButton* >( sender() ) )
|
||||
{
|
||||
const auto index = indexOf( button );
|
||||
|
||||
if ( index >= 0 )
|
||||
Q_EMIT buttonClicked( index );
|
||||
}
|
||||
}
|
||||
|
||||
QskAspect::Subcontrol QskTabBar::effectiveSubcontrol(
|
||||
QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
|
@ -98,6 +98,7 @@ class QSK_EXPORT QskTabBar : public QskBox
|
||||
|
||||
Q_SIGNALS:
|
||||
void currentIndexChanged( int index );
|
||||
void buttonClicked( int index );
|
||||
void countChanged( int );
|
||||
void textOptionsChanged( const QskTextOptions& );
|
||||
void tabPositionChanged( Qsk::Position );
|
||||
@ -109,6 +110,7 @@ class QSK_EXPORT QskTabBar : public QskBox
|
||||
|
||||
private:
|
||||
void adjustCurrentIndex();
|
||||
void handleButtonClick();
|
||||
|
||||
class PrivateData;
|
||||
std::unique_ptr< PrivateData > m_data;
|
||||
|
Loading…
x
Reference in New Issue
Block a user