qskinny/examples/layouts/TestRectangle.cpp
2022-07-25 18:42:18 +02:00

41 lines
1.1 KiB
C++

/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
* This file may be used under the terms of the 3-clause BSD License
*****************************************************************************/
#include "TestRectangle.h"
#include <QskSkin.h>
TestRectangle::TestRectangle( QQuickItem* parent )
: QskTextLabel( parent )
{
setAlignment( Qt::AlignCenter );
setFontRole( QskSkin::HugeFont );
setTextColor( Qt::white );
setPreferredSize( 10, 10 );
initSizePolicy( QskSizePolicy::Minimum, QskSizePolicy::Minimum );
setFocusPolicy( Qt::TabFocus ); // for checking the focus tab chain
}
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"