5#ifndef DSEGMENTEDCONTROL_H
6#define DSEGMENTEDCONTROL_H
11#include <QPropertyAnimation>
13#include <QEasingCurve>
15#include <dtkwidget_global.h>
18DWIDGET_BEGIN_NAMESPACE
34 Q_PROPERTY(
int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentChanged)
35 Q_PROPERTY(
int count READ count)
36 Q_PROPERTY(
int animationDuration READ animationDuration WRITE setAnimationDuration)
43 int currentIndex()
const;
44 QToolButton *at(
int index)
const;
45 QString getText(
int index)
const;
46 QIcon getIcon(
int index)
const;
47 int animationDuration()
const;
48 int indexByTitle(
const QString &title)
const;
53 int addSegmented(
const QString &title);
54 int addSegmented(
const QIcon &icon,
const QString &title);
57 void insertSegmented(
int index,
const QString &title);
58 void insertSegmented(
int index,
const QIcon &icon,
const QString &title);
59 void removeSegmented(
int index);
61 bool setCurrentIndex(
int currentIndex);
62 bool setCurrentIndexByTitle(
const QString &title);
63 void setText(
int index,
const QString &title);
64 void setIcon(
int index,
const QIcon &icon);
65 void setAnimationDuration(
int animationDuration);
69 void updateHighlightGeometry(
bool animation =
true);
79 void resizeEvent(QResizeEvent *event)
override;