using Qt::Edge instead of QskAspect::Placement

This commit is contained in:
Uwe Rathmann 2023-02-15 16:14:05 +01:00
parent 1300761ee2
commit 4c10d8b0e4
3 changed files with 6 additions and 9 deletions

View File

@ -28,10 +28,10 @@ namespace
setSizePolicy( Qt::Horizontal, QskSizePolicy::Fixed ); setSizePolicy( Qt::Horizontal, QskSizePolicy::Fixed );
setSpacing( 0 ); setSpacing( 0 );
auto* const topButton = new RoundButton( QskAspect::Top, this ); auto* const topButton = new RoundButton( Qt::TopEdge, this );
connect( topButton, &QskPushButton::clicked, this, &UpAndDownBox::increase ); connect( topButton, &QskPushButton::clicked, this, &UpAndDownBox::increase );
auto* const bottomButton = new RoundButton( QskAspect::Bottom, this ); auto* const bottomButton = new RoundButton( Qt::BottomEdge, this );
connect( bottomButton, &QskPushButton::clicked, this, &UpAndDownBox::decrease ); connect( bottomButton, &QskPushButton::clicked, this, &UpAndDownBox::decrease );
} }

View File

@ -4,23 +4,19 @@
*****************************************************************************/ *****************************************************************************/
#include "RoundButton.h" #include "RoundButton.h"
#include <QskGraphic.h> #include <QskGraphic.h>
#include <QskPushButton.h>
#include <QImage>
QSK_SUBCONTROL( RoundButton, Panel ) QSK_SUBCONTROL( RoundButton, Panel )
QSK_STATE( RoundButton, Top, ( QskAspect::FirstUserState << 1 ) ) QSK_STATE( RoundButton, Top, ( QskAspect::FirstUserState << 1 ) )
RoundButton::RoundButton( QskAspect::Placement placement, QQuickItem* parent ) RoundButton::RoundButton( Qt::Edge edge, QQuickItem* parent )
: QskPushButton( parent ) : QskPushButton( parent )
{ {
setSubcontrolProxy( QskPushButton::Panel, RoundButton::Panel ); setSubcontrolProxy( QskPushButton::Panel, RoundButton::Panel );
setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Expanding ); setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Expanding );
if( placement == QskAspect::Top ) if( edge == Qt::TopEdge )
{ {
setSkinStateFlag( Top ); setSkinStateFlag( Top );
setGraphicSource( "up" ); setGraphicSource( "up" );

View File

@ -6,6 +6,7 @@
#pragma once #pragma once
#include <QskPushButton.h> #include <QskPushButton.h>
#include <Qt>
class RoundButton : public QskPushButton class RoundButton : public QskPushButton
{ {
@ -15,5 +16,5 @@ class RoundButton : public QskPushButton
QSK_SUBCONTROLS( Panel ) QSK_SUBCONTROLS( Panel )
QSK_STATES( Top ) QSK_STATES( Top )
RoundButton( QskAspect::Placement, QQuickItem* parent ); RoundButton( Qt::Edge, QQuickItem* parent );
}; };