2017-07-21 18:21:34 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
|
|
|
* This file may be used under the terms of the QSkinny License, Version 1.0
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef QSK_TAB_BUTTON_H
|
|
|
|
#define QSK_TAB_BUTTON_H
|
|
|
|
|
|
|
|
#include "QskAbstractButton.h"
|
|
|
|
|
|
|
|
class QskTextOptions;
|
|
|
|
class QskTabBar;
|
|
|
|
|
|
|
|
class QSK_EXPORT QskTabButton : public QskAbstractButton
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
Q_PROPERTY( QString text READ text WRITE setText NOTIFY textChanged FINAL )
|
2018-08-03 08:15:28 +02:00
|
|
|
|
2017-07-21 18:21:34 +02:00
|
|
|
Q_PROPERTY( QskTextOptions textOptions READ textOptions
|
|
|
|
WRITE setTextOptions NOTIFY textOptionsChanged )
|
|
|
|
|
|
|
|
using Inherited = QskAbstractButton;
|
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
public:
|
2017-07-21 18:21:34 +02:00
|
|
|
QSK_SUBCONTROLS( Panel, Text )
|
|
|
|
|
|
|
|
QskTabButton( QQuickItem* parent = nullptr );
|
|
|
|
QskTabButton( const QString& text, QQuickItem* parent = nullptr );
|
|
|
|
|
2018-07-31 17:32:25 +02:00
|
|
|
~QskTabButton() override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2021-08-04 08:24:36 +02:00
|
|
|
bool isCheckable() const override final;
|
|
|
|
|
2017-07-21 18:21:34 +02:00
|
|
|
void setText( const QString& text );
|
|
|
|
QString text() const;
|
|
|
|
|
|
|
|
void setTextOptions( const QskTextOptions& );
|
|
|
|
QskTextOptions textOptions() const;
|
|
|
|
|
2019-04-26 18:09:59 +02:00
|
|
|
QRectF layoutRectForSize( const QSizeF& ) const override;
|
2019-04-18 16:16:44 +02:00
|
|
|
|
2018-07-31 17:32:25 +02:00
|
|
|
QskAspect::Placement effectivePlacement() const override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2019-04-18 16:16:44 +02:00
|
|
|
const QskTabBar* tabBar() const;
|
|
|
|
QskTabBar* tabBar();
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
Q_SIGNALS:
|
2017-07-21 18:21:34 +02:00
|
|
|
void textChanged( const QString& text );
|
|
|
|
void textOptionsChanged();
|
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
protected:
|
2018-07-31 17:32:25 +02:00
|
|
|
void changeEvent( QEvent* ) override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
private:
|
2017-07-21 18:21:34 +02:00
|
|
|
class PrivateData;
|
|
|
|
std::unique_ptr< PrivateData > m_data;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|