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