formal adjustments
This commit is contained in:
parent
eb5f3d3bcf
commit
8df1551701
|
@ -1,21 +1,24 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) 2023 Edelhirsch Software GmbH
|
||||
* This file may be used under the terms of the 3-clause BSD License
|
||||
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
||||
* This file may be used under the terms of the QSkinny License, Version 1.0
|
||||
*****************************************************************************/
|
||||
|
||||
#include "QskSpinBox.h"
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskGridBox.h>
|
||||
#include <QskTextInput.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskSkinlet.h>
|
||||
#include <QskEvent.h>
|
||||
#include "QskLinearBox.h"
|
||||
#include "QskGridBox.h"
|
||||
#include "QskTextInput.h"
|
||||
#include "QskBoxShapeMetrics.h"
|
||||
#include "QskBoxBorderColors.h"
|
||||
#include "QskBoxBorderMetrics.h"
|
||||
#include "QskSkinlet.h"
|
||||
#include "QskIntervalF.h"
|
||||
#include "QskEvent.h"
|
||||
|
||||
#include <QtMath>
|
||||
#include <QGuiApplication>
|
||||
#include <QStyleHints>
|
||||
#include <QskIntervalF.h>
|
||||
|
||||
#include <array>
|
||||
|
||||
QSK_SUBCONTROL(QskSpinBox, Inc)
|
||||
QSK_SUBCONTROL(QskSpinBox, Dec)
|
||||
|
|
|
@ -1,48 +1,49 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) 2023 Edelhirsch Software GmbH
|
||||
* This file may be used under the terms of the 3-clause BSD License
|
||||
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
||||
* This file may be used under the terms of the QSkinny License, Version 1.0
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
#ifndef QSK_SPIN_BOX_H
|
||||
#define QSK_SPIN_BOX_H
|
||||
|
||||
#include <QskControl.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskBoundedInput.h>
|
||||
|
||||
class QSK_EXPORT QskSpinBox : public QskBoundedInput
|
||||
{
|
||||
Q_OBJECT
|
||||
using Inherited = QskBoundedInput;
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(qreal value READ value NOTIFY valueChanged)
|
||||
|
||||
using Inherited = QskBoundedInput;
|
||||
public:
|
||||
Q_PROPERTY(qreal value READ value NOTIFY valueChanged)
|
||||
QSK_SUBCONTROLS(Inc, Dec, IncText, DecText, TextPanel, Text, Layout)
|
||||
QSK_STATES( Pressed )
|
||||
QSK_SUBCONTROLS(Inc, Dec, IncText, DecText, TextPanel, Text, Layout)
|
||||
QSK_STATES( Pressed )
|
||||
|
||||
explicit QskSpinBox( QQuickItem* parent = nullptr );
|
||||
~QskSpinBox() override;
|
||||
explicit QskSpinBox( QQuickItem* parent = nullptr );
|
||||
~QskSpinBox() override;
|
||||
|
||||
void increment( qreal offset ) override;
|
||||
qreal value() const;
|
||||
void increment( qreal offset ) override;
|
||||
qreal value() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void valueChanged(qreal value);
|
||||
void valueChanged( qreal );
|
||||
void focusIndexChanged( int );
|
||||
|
||||
private:
|
||||
Q_SIGNAL void focusIndexChanged(int index);
|
||||
void hoverEnterEvent( QHoverEvent* ) override;
|
||||
void hoverLeaveEvent( QHoverEvent* ) override;
|
||||
void hoverMoveEvent( QHoverEvent* ) override;
|
||||
|
||||
void hoverEnterEvent( QHoverEvent* event) override;
|
||||
void hoverLeaveEvent( QHoverEvent* event) override;
|
||||
void hoverMoveEvent( QHoverEvent* event) override;
|
||||
void mouseReleaseEvent( QMouseEvent* ) override;
|
||||
void mousePressEvent( QMouseEvent* ) override;
|
||||
|
||||
void mouseReleaseEvent(QMouseEvent* event) override;
|
||||
void mousePressEvent(QMouseEvent* event) override;
|
||||
void keyPressEvent( QKeyEvent* ) override;
|
||||
void keyReleaseEvent( QKeyEvent* ) override;
|
||||
|
||||
void keyPressEvent( QKeyEvent* event ) override;
|
||||
void keyReleaseEvent( QKeyEvent* event ) override;
|
||||
void focusInEvent( QFocusEvent* ) override;
|
||||
QRectF focusIndicatorRect() const override;
|
||||
|
||||
void focusInEvent(QFocusEvent* event) override;
|
||||
QRectF focusIndicatorRect() const override;
|
||||
|
||||
class PrivateData;
|
||||
std::unique_ptr<PrivateData> m_data;
|
||||
class PrivateData;
|
||||
std::unique_ptr<PrivateData> m_data;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) 2023 Edelhirsch Software GmbH
|
||||
* This file may be used under the terms of the 3-clause BSD License
|
||||
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
||||
* This file may be used under the terms of the QSkinny License, Version 1.0
|
||||
*****************************************************************************/
|
||||
|
||||
#include "QskSpinBoxSkinlet.h"
|
||||
#include "QskSpinBox.h"
|
||||
#include <QFontMetrics>
|
||||
|
||||
#include <qfontmetrics.h>
|
||||
|
||||
const auto INC_TEXT = QStringLiteral("+");
|
||||
const auto DEC_TEXT = QStringLiteral("-");
|
||||
|
|
|
@ -1,28 +1,48 @@
|
|||
/******************************************************************************
|
||||
* Copyright (C) 2023 Edelhirsch Software GmbH
|
||||
* This file may be used under the terms of the 3-clause BSD License
|
||||
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
||||
* This file may be used under the terms of the QSkinny License, Version 1.0
|
||||
*****************************************************************************/
|
||||
|
||||
#pragma once
|
||||
#ifndef QSK_SPIN_BOX_SKINLET_H
|
||||
#define QSK_SPIN_BOX_SKINLET_H
|
||||
|
||||
#include <QskSkinlet.h>
|
||||
|
||||
class QSK_EXPORT QskSpinBoxSkinlet : public QskSkinlet
|
||||
{
|
||||
Q_GADGET
|
||||
using Inherited = QskSkinlet;
|
||||
public:
|
||||
enum NodeRole
|
||||
{
|
||||
IncPanel, IncText, DecPanel, DecText, TextPanel, TextText, RoleCount
|
||||
};
|
||||
Q_INVOKABLE QskSpinBoxSkinlet( QskSkin* = nullptr );
|
||||
protected:
|
||||
int sampleCount( const QskSkinnable*, QskAspect::Subcontrol ) const override;
|
||||
QRectF sampleRect( const QskSkinnable*, const QRectF&, QskAspect::Subcontrol, int index ) const override;
|
||||
QskAspect::States sampleStates(const QskSkinnable* skinnable, QskAspect::Subcontrol subControl, int index ) const override;
|
||||
QSizeF sizeHint( const QskSkinnable*, Qt::SizeHint, const QSizeF& ) const override;
|
||||
QRectF subControlRect( const QskSkinnable*, const QRectF&, QskAspect::Subcontrol ) const override;
|
||||
QSGNode* updateSubNode( const QskSkinnable*, quint8 nodeRole, QSGNode* ) const override;
|
||||
QSGNode* updateSampleNode( const QskSkinnable* skinnable, QskAspect::Subcontrol subControl, int index, QSGNode* node ) const override;
|
||||
Q_GADGET
|
||||
using Inherited = QskSkinlet;
|
||||
|
||||
public:
|
||||
enum NodeRole
|
||||
{
|
||||
IncPanel,
|
||||
IncText,
|
||||
DecPanel,
|
||||
DecText,
|
||||
TextPanel,
|
||||
TextText,
|
||||
RoleCount
|
||||
};
|
||||
|
||||
Q_INVOKABLE QskSpinBoxSkinlet( QskSkin* = nullptr );
|
||||
|
||||
protected:
|
||||
int sampleCount( const QskSkinnable*, QskAspect::Subcontrol ) const override;
|
||||
|
||||
QRectF sampleRect( const QskSkinnable*, const QRectF&,
|
||||
QskAspect::Subcontrol, int index ) const override;
|
||||
|
||||
QskAspect::States sampleStates( const QskSkinnable*,
|
||||
QskAspect::Subcontrol, int index ) const override;
|
||||
|
||||
QSizeF sizeHint( const QskSkinnable*, Qt::SizeHint, const QSizeF& ) const override;
|
||||
QRectF subControlRect( const QskSkinnable*,
|
||||
const QRectF&, QskAspect::Subcontrol ) const override;
|
||||
|
||||
QSGNode* updateSubNode( const QskSkinnable*, quint8 nodeRole, QSGNode* ) const override;
|
||||
QSGNode* updateSampleNode( const QskSkinnable*,
|
||||
QskAspect::Subcontrol, int index, QSGNode* node ) const override;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue