qskinny/examples/layouts/TestRectangle.cpp

41 lines
1.1 KiB
C++
Raw Normal View History

2017-07-21 18:21:34 +02:00
/******************************************************************************
* 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>
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 );
setFontRole( QskSkin::HugeFont );
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"