Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++
1.2 KB
Raw Blame
/*
 *  SPDX-FileCopyrightText: 2022 Deif Lou <[email protected]>
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef KISOPTIONBUTTONSTRIP_H
#define KISOPTIONBUTTONSTRIP_H

#include <QList>
#include <QScopedPointer>
#include <QWidget>

#include <kritawidgetutils_export.h>

class KoGroupButton;

/**
 * @brief Provides a list of consecutive tool buttons
 */
class KRITAWIDGETUTILS_EXPORT KisOptionButtonStrip : public QWidget
{
    Q_OBJECT

public:
    explicit KisOptionButtonStrip(QWidget *parent = nullptr);
    ~KisOptionButtonStrip() override;

    KoGroupButton *addButton(const QIcon &icon,
                             const QString &text = QString());
    KoGroupButton *addButton(const QString &text);
    KoGroupButton *addButton();

    KoGroupButton *button(int index) const;
    QList<KoGroupButton *> buttons() const;

    bool exclusive() const;
    void setExclusive(bool exclusive);

    KoGroupButton *checkedButton() const;
    int checkedButtonIndex() const;

Q_SIGNALS:
    void buttonToggled(KoGroupButton *button, bool checked);
    void buttonToggled(int index, bool checked);

private:
    class Private;
    QScopedPointer<Private> m_d;
};

#endif