2022-07-05 15:45:06 +02:00
|
|
|
|
/******************************************************************************
|
2024-01-17 14:31:45 +01:00
|
|
|
|
* QSkinny - Copyright (C) The authors
|
2023-04-06 09:23:37 +02:00
|
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2022-07-05 15:45:06 +02:00
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "DialogPage.h"
|
|
|
|
|
|
|
|
|
|
#include <QskDialog.h>
|
2023-02-27 12:27:57 +01:00
|
|
|
|
#include <QskLinearBox.h>
|
2022-07-05 15:45:06 +02:00
|
|
|
|
#include <QskPushButton.h>
|
|
|
|
|
|
|
|
|
|
namespace
|
|
|
|
|
{
|
2023-02-27 12:27:57 +01:00
|
|
|
|
class Button : public QskPushButton
|
2022-07-05 15:45:06 +02:00
|
|
|
|
{
|
2023-07-03 16:48:37 +02:00
|
|
|
|
public:
|
|
|
|
|
Button( const QString& text, QQuickItem* parent = nullptr )
|
|
|
|
|
: QskPushButton( text, parent )
|
|
|
|
|
{
|
2024-02-06 15:41:50 +01:00
|
|
|
|
setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Fixed );
|
2023-07-03 16:48:37 +02:00
|
|
|
|
}
|
|
|
|
|
};
|
2023-02-27 12:27:57 +01:00
|
|
|
|
|
2023-07-03 16:48:37 +02:00
|
|
|
|
class ButtonBox : public QskLinearBox
|
|
|
|
|
{
|
2023-02-26 17:04:47 +01:00
|
|
|
|
public:
|
2023-07-03 16:48:37 +02:00
|
|
|
|
ButtonBox( QQuickItem* parent = nullptr )
|
2024-02-06 15:41:50 +01:00
|
|
|
|
: QskLinearBox( Qt::Vertical, parent )
|
2022-07-05 15:45:06 +02:00
|
|
|
|
{
|
2023-07-03 16:48:37 +02:00
|
|
|
|
setObjectName( "ButtonBox" );
|
2024-02-06 15:41:50 +01:00
|
|
|
|
setDefaultAlignment( Qt::AlignCenter );
|
2022-07-05 15:45:06 +02:00
|
|
|
|
|
2023-07-03 16:48:37 +02:00
|
|
|
|
setMargins( 10 );
|
|
|
|
|
setSpacing( 20 );
|
2022-07-05 15:45:06 +02:00
|
|
|
|
|
2023-07-03 16:48:37 +02:00
|
|
|
|
auto messageButton = new Button( "Message", this );
|
|
|
|
|
connect( messageButton, &Button::clicked, this, &ButtonBox::execMessage );
|
2022-07-05 15:45:06 +02:00
|
|
|
|
|
2023-07-03 16:48:37 +02:00
|
|
|
|
auto questionButton = new Button( "Question", this );
|
|
|
|
|
connect( questionButton, &Button::clicked, this, &ButtonBox::execQuestion );
|
2022-07-05 15:45:06 +02:00
|
|
|
|
|
2023-07-03 16:48:37 +02:00
|
|
|
|
auto selectButton = new Button( "Selection", this );
|
|
|
|
|
connect( selectButton, &Button::clicked, this, &ButtonBox::execSelection );
|
|
|
|
|
|
|
|
|
|
setExtraSpacingAt( Qt::BottomEdge );
|
2023-02-27 12:27:57 +01:00
|
|
|
|
}
|
2022-07-05 15:45:06 +02:00
|
|
|
|
|
2023-02-27 12:27:57 +01:00
|
|
|
|
private:
|
2023-07-03 16:48:37 +02:00
|
|
|
|
void execMessage()
|
2023-02-27 12:27:57 +01:00
|
|
|
|
{
|
2024-02-06 15:41:50 +01:00
|
|
|
|
qskDialog->information( "Message", "Request vector, over." );
|
2023-07-03 16:48:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void execQuestion()
|
|
|
|
|
{
|
|
|
|
|
qskDialog->question( "Question",
|
|
|
|
|
"Roger, Roger. Do we have a vector, Victor ?" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void execSelection()
|
|
|
|
|
{
|
|
|
|
|
const QStringList entries =
|
|
|
|
|
{
|
|
|
|
|
"Give Me More",
|
|
|
|
|
"Gimme Gimme Your Love",
|
|
|
|
|
"1-2-3-4 Red Light",
|
|
|
|
|
"New York",
|
|
|
|
|
"If You Walk Away",
|
|
|
|
|
"Eloise",
|
|
|
|
|
"On The Radio",
|
|
|
|
|
"We Are The Teens",
|
|
|
|
|
"Never Gonna Tell No Lie To You",
|
|
|
|
|
"Walking On Sunshine ",
|
|
|
|
|
"Get Out Of My Mind",
|
|
|
|
|
"Cover Girl ",
|
|
|
|
|
"Here I Stand",
|
|
|
|
|
"Gypsy Caravan",
|
|
|
|
|
"It´s Good To Have A Friend",
|
|
|
|
|
"We´ll Have A Party Tonite ´nite",
|
|
|
|
|
"Automatic World",
|
|
|
|
|
"Gimme Gimme Gimme Gimme Gimme Your Love"
|
|
|
|
|
};
|
|
|
|
|
|
2024-02-08 12:39:27 +01:00
|
|
|
|
qskDialog->select( "The Teens", entries, 7 );
|
2023-07-03 16:48:37 +02:00
|
|
|
|
}
|
2022-07-05 15:45:06 +02:00
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DialogPage::DialogPage( QQuickItem* parent )
|
|
|
|
|
: Page( Qt::Horizontal, parent )
|
|
|
|
|
{
|
2023-07-03 16:48:37 +02:00
|
|
|
|
( void ) new ButtonBox( this );
|
2022-07-05 15:45:06 +02:00
|
|
|
|
}
|