qvgfile parameter adeed
This commit is contained in:
parent
b1ae08b91c
commit
75522ced4a
|
@ -31,8 +31,8 @@ class GraphicLabel : public QskGraphicLabel
|
||||||
Inverted
|
Inverted
|
||||||
};
|
};
|
||||||
|
|
||||||
GraphicLabel( const QskGraphic& graphic, QQuickItem* parent = nullptr )
|
GraphicLabel( QQuickItem* parent = nullptr )
|
||||||
: QskGraphicLabel( graphic, parent )
|
: QskGraphicLabel( parent )
|
||||||
{
|
{
|
||||||
setMargins( 10 );
|
setMargins( 10 );
|
||||||
setPanel( true );
|
setPanel( true );
|
||||||
|
@ -74,7 +74,7 @@ class GraphicLabel : public QskGraphicLabel
|
||||||
|
|
||||||
MainWindow::MainWindow()
|
MainWindow::MainWindow()
|
||||||
{
|
{
|
||||||
auto label = new GraphicLabel( QskGraphicIO::read( QString( ":/qvg/Tux.qvg" ) ) );
|
auto label = new GraphicLabel();
|
||||||
|
|
||||||
auto invertButton = new QskPushButton( "Inverted" );
|
auto invertButton = new QskPushButton( "Inverted" );
|
||||||
invertButton->setSizePolicy( Qt::Horizontal, QskSizePolicy::Fixed );
|
invertButton->setSizePolicy( Qt::Horizontal, QskSizePolicy::Fixed );
|
||||||
|
@ -98,6 +98,12 @@ MainWindow::MainWindow()
|
||||||
setGraphicRoles( qskSkinManager->skin() );
|
setGraphicRoles( qskSkinManager->skin() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::setGraphic( const QString& path )
|
||||||
|
{
|
||||||
|
if ( auto label = findChild< QskGraphicLabel* >() )
|
||||||
|
label->setGraphic( QskGraphicIO::read( path ) );
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::setGraphicRoles( QskSkin* skin )
|
void MainWindow::setGraphicRoles( QskSkin* skin )
|
||||||
{
|
{
|
||||||
// substituting black
|
// substituting black
|
||||||
|
|
|
@ -15,6 +15,7 @@ class MainWindow : public QskWindow
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MainWindow();
|
MainWindow();
|
||||||
|
void setGraphic( const QString& );
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void setGraphicRoles( QskSkin* );
|
void setGraphicRoles( QskSkin* );
|
||||||
|
|
|
@ -27,6 +27,7 @@ int main( int argc, char* argv[] )
|
||||||
focusIndicator->setObjectName( "FocusIndicator" );
|
focusIndicator->setObjectName( "FocusIndicator" );
|
||||||
|
|
||||||
MainWindow window;
|
MainWindow window;
|
||||||
|
window.setGraphic( ( argc > 1 ) ? argv[1] : ":/qvg/Tux.qvg" );
|
||||||
window.resize( 600, 400 );
|
window.resize( 600, 400 );
|
||||||
window.addItem( focusIndicator );
|
window.addItem( focusIndicator );
|
||||||
window.show();
|
window.show();
|
||||||
|
|
Loading…
Reference in New Issue