2017-07-21 16:21:34 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
2023-04-06 07:23:37 +00:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2017-07-21 16:21:34 +00:00
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#include "TestRectangle.h"
|
2022-07-25 16:42:18 +00:00
|
|
|
#include <QskSkin.h>
|
2017-07-21 16:21:34 +00:00
|
|
|
|
2019-07-09 08:16:04 +00:00
|
|
|
TestRectangle::TestRectangle( QQuickItem* parent )
|
2018-08-03 06:15:28 +00:00
|
|
|
: QskTextLabel( parent )
|
2017-07-21 16:21:34 +00:00
|
|
|
{
|
|
|
|
setAlignment( Qt::AlignCenter );
|
2022-07-25 16:42:18 +00:00
|
|
|
setFontRole( QskSkin::HugeFont );
|
|
|
|
setTextColor( Qt::white );
|
2017-07-21 16:21:34 +00:00
|
|
|
|
|
|
|
setPreferredSize( 10, 10 );
|
2019-07-22 15:20:03 +00:00
|
|
|
initSizePolicy( QskSizePolicy::Minimum, QskSizePolicy::Minimum );
|
2018-03-20 13:57:29 +00:00
|
|
|
setFocusPolicy( Qt::TabFocus ); // for checking the focus tab chain
|
2017-07-21 16:21:34 +00:00
|
|
|
}
|
2019-07-09 08:16:04 +00: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"
|