qskinny/examples/gallery/dialog/DialogPage.cpp

71 lines
2.3 KiB
C++
Raw Normal View History

2022-07-05 13:45:06 +00:00
/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the 3-clause BSD License
*****************************************************************************/
#include "DialogPage.h"
#include <QskDialog.h>
#include <QskGridBox.h>
#include <QskPushButton.h>
#include <QskStandardSymbol.h>
namespace
{
class Box : public QskGridBox
{
2023-02-26 16:04:47 +00:00
public:
2022-07-05 13:45:06 +00:00
Box( QQuickItem* parent )
: QskGridBox( parent )
{
auto* messageButton = new QskPushButton( "message", this );
2023-02-26 16:04:47 +00:00
connect( messageButton, &QskPushButton::clicked, this,
[]() { qskDialog->message( "message", "text", QskStandardSymbol::Ok ); } );
2022-07-05 13:45:06 +00:00
auto* informationButton = new QskPushButton( "information", this );
2023-02-26 16:04:47 +00:00
connect( informationButton, &QskPushButton::clicked, this,
[]() { qskDialog->information( "information", "text" ); } );
2022-07-05 13:45:06 +00:00
auto* warningButton = new QskPushButton( "warning", this );
2023-02-26 16:04:47 +00:00
connect( warningButton, &QskPushButton::clicked, this,
[]() { qskDialog->warning( "warning", "text" ); } );
2022-07-05 13:45:06 +00:00
auto* criticalButton = new QskPushButton( "critical", this );
2023-02-26 16:04:47 +00:00
connect( criticalButton, &QskPushButton::clicked, this,
[]() { qskDialog->critical( "critical", "text" ); } );
2022-07-05 13:45:06 +00:00
auto* questionButton = new QskPushButton( "question", this );
2023-02-26 16:04:47 +00:00
connect( questionButton, &QskPushButton::clicked, this,
[]() { qskDialog->question( "question", "text" ); } );
2022-07-05 13:45:06 +00:00
auto* selectButton = new QskPushButton( "select", this );
2023-02-26 16:04:47 +00:00
connect( selectButton, &QskPushButton::clicked, this,
[]() { qskDialog->select( "select", "text", { "yes", "no", "maybe" } ); } );
2022-07-05 13:45:06 +00:00
addItem( messageButton, 0, 0 );
addItem( informationButton, 0, 1 );
addItem( warningButton, 0, 2 );
addItem( criticalButton, 1, 0 );
addItem( questionButton, 1, 1 );
addItem( selectButton, 1, 2 );
}
};
}
DialogPage::DialogPage( QQuickItem* parent )
: Page( Qt::Horizontal, parent )
{
populate();
}
void DialogPage::populate()
{
new Box( this );
}