qskinny/examples/gallery/dialog/DialogPage.cpp
Uwe Rathmann c96b3dbbff additional infoText removed from
QskSelectionSubWindow/QskSelectionWindow.
not sure if will keep those classes in the long run
2024-02-08 12:39:27 +01:00

94 lines
2.7 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/******************************************************************************
* QSkinny - Copyright (C) The authors
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#include "DialogPage.h"
#include <QskDialog.h>
#include <QskLinearBox.h>
#include <QskPushButton.h>
namespace
{
class Button : public QskPushButton
{
public:
Button( const QString& text, QQuickItem* parent = nullptr )
: QskPushButton( text, parent )
{
setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Fixed );
}
};
class ButtonBox : public QskLinearBox
{
public:
ButtonBox( QQuickItem* parent = nullptr )
: QskLinearBox( Qt::Vertical, parent )
{
setObjectName( "ButtonBox" );
setDefaultAlignment( Qt::AlignCenter );
setMargins( 10 );
setSpacing( 20 );
auto messageButton = new Button( "Message", this );
connect( messageButton, &Button::clicked, this, &ButtonBox::execMessage );
auto questionButton = new Button( "Question", this );
connect( questionButton, &Button::clicked, this, &ButtonBox::execQuestion );
auto selectButton = new Button( "Selection", this );
connect( selectButton, &Button::clicked, this, &ButtonBox::execSelection );
setExtraSpacingAt( Qt::BottomEdge );
}
private:
void execMessage()
{
qskDialog->information( "Message", "Request vector, over." );
}
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"
};
qskDialog->select( "The Teens", entries, 7 );
}
};
}
DialogPage::DialogPage( QQuickItem* parent )
: Page( Qt::Horizontal, parent )
{
( void ) new ButtonBox( this );
}