QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskDialogButton.cpp
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#include "QskDialogButton.h"
7#include "QskDialogButtonBox.h"
8#include "QskSkin.h"
9
10QskDialogButton::QskDialogButton(
11 QskDialog::Action action, QQuickItem* parent )
12 : QskPushButton( parent )
13 , m_action( action )
14{
15 resetButton();
16}
17
18QskDialogButton::QskDialogButton( QQuickItem* parent )
19 : QskDialogButton( QskDialog::NoAction, parent )
20{
21}
22
23QskDialogButton::~QskDialogButton()
24{
25}
26
27void QskDialogButton::setAction( QskDialog::Action action )
28{
29 if ( action != m_action )
30 {
31 m_action = action;
32 resetButton();
33
34 Q_EMIT actionChanged();
35 }
36}
37
38QskDialog::Action QskDialogButton::action() const
39{
40 return m_action;
41}
42
43void QskDialogButton::changeEvent( QEvent* event )
44{
45 switch( static_cast< int >( event->type() ) )
46 {
47 case QEvent::LocaleChange:
48 case QEvent::StyleChange:
49 resetButton();
50 break;
51 }
52
54}
55
56void QskDialogButton::resetButton()
57{
58 if ( const auto skin = effectiveSkin() )
59 setText( skin->dialogButtonText( m_action ) );
60}
61
62#include "moc_QskDialogButton.cpp"
void changeEvent(QEvent *) override
virtual void changeEvent(QEvent *)
Definition QskItem.cpp:859
QskSkin * effectiveSkin() const