qskinny/examples/layouts/TestRectangle.cpp

41 lines
1.1 KiB
C++
Raw Normal View History

2017-07-21 18:21:34 +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
2017-07-21 18:21:34 +02:00
*****************************************************************************/
#include "TestRectangle.h"
2024-02-19 15:51:55 +01:00
#include <QskFontRole.h>
2017-07-21 18:21:34 +02:00
TestRectangle::TestRectangle( QQuickItem* parent )
2018-08-03 08:15:28 +02:00
: QskTextLabel( parent )
2017-07-21 18:21:34 +02:00
{
setAlignment( Qt::AlignCenter );
2024-02-19 15:51:55 +01:00
setFontRole( QskFontRole::Title );
setTextColor( Qt::white );
2017-07-21 18:21:34 +02:00
setPreferredSize( 10, 10 );
2019-07-22 17:20:03 +02:00
initSizePolicy( QskSizePolicy::Minimum, QskSizePolicy::Minimum );
setFocusPolicy( Qt::TabFocus ); // for checking the focus tab chain
2017-07-21 18:21:34 +02:00
}
TestRectangle::TestRectangle( const char* colorName, QQuickItem* parent )
: TestRectangle( parent )
{
setColorName( colorName );
}
void TestRectangle::setColorName( const QString& colorName )
{
m_colorName = colorName;
setObjectName( colorName );
setBackgroundColor( colorName );
}
QString TestRectangle::colorName() const
{
return m_colorName;
}
#include "moc_TestRectangle.cpp"