6#include "QskTabButton.h"
9#include "QskTextOptions.h"
12#include <qfontmetrics.h>
20 return qskFindAncestorOf< QskTabBar* >( button->parentItem() );
23class QskTabButton::PrivateData
26 PrivateData(
const QString& txt )
32 QPointer< QskTabBar > tabBar;
35QskTabButton::QskTabButton( QQuickItem* parent )
40QskTabButton::QskTabButton(
const QString& text, QQuickItem* parent )
42 , m_data( new PrivateData( text ) )
45 m_data->tabBar = qskFindTabBar(
this );
47 initSizePolicy( QskSizePolicy::MinimumExpanding,
48 QskSizePolicy::QskSizePolicy::MinimumExpanding );
53QskTabButton::~QskTabButton()
57bool QskTabButton::isCheckable()
const
62void QskTabButton::setText(
const QString& text )
64 if ( m_data->text == text )
68 Q_EMIT textChanged( text );
74QString QskTabButton::text()
const
79void QskTabButton::setTextOptions(
const QskTextOptions& textOptions )
81 if ( setTextOptionsHint( Text, textOptions ) )
82 Q_EMIT textOptionsChanged();
87 return textOptionsHint( Text );
90void QskTabButton::resetTextOptions()
92 if ( resetTextOptionsHint( Text ) )
93 Q_EMIT textOptionsChanged();
103 if ( m_data->tabBar )
104 return m_data->tabBar->effectiveVariation();
109const QskTabBar* QskTabButton::tabBar()
const
111 return m_data->tabBar;
116 return m_data->tabBar;
121 switch ( event->type() )
123 case QEvent::LocaleChange:
125 if ( !m_data->text.isEmpty() )
133 case QEvent::ParentChange:
135 m_data->tabBar = qskFindTabBar(
this );
145#include "moc_QskTabButton.cpp"
Variation
Some sort of variation.
QRectF subControlContentsRect(QskAspect::Subcontrol) const
virtual void changeEvent(QEvent *)