qskinny/examples/layouts/ButtonBox.cpp
2024-01-17 14:31:45 +01:00

26 lines
772 B
C++

/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#include "ButtonBox.h"
#include <QskPushButton.h>
ButtonBox::ButtonBox( QQuickItem* parent )
: QskLinearBox( Qt::Horizontal, parent )
{
setObjectName( "ButtonBox" );
setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Fixed );
}
void ButtonBox::addButton(
const QString& text, std::function< void() > func, bool autoRepeat )
{
auto button = new QskPushButton( text );
button->setAutoRepeat( autoRepeat );
QObject::connect( button, &QskPushButton::clicked, func );
addItem( button );
}