Giter Club home page Giter Club logo

qmlviewerdevhelper's Introduction

QmlViewerDevHelper

How to set the the path of images in qml file if the qml file is in resource? (http://qt-project.org/forums/viewthread/7047). The answer is:

QString imagePath = QDir::currentPath()+"/images/"; #if defined(Q_OS_MAC) imagePath = "file://"+imagePath; #endif QDeclarativeContext::setContextProperty("imagePath",imagePath);

and in qml

Image { source: imagePath + "image.png"
}

in your c++ application. But it`s became a real pain in QtCreator Qml editor and qml viewer. Yes, you can write in manualy with property string imagePath: ...

but it`s not clear and make some troubles with Loader.

Just build project and put the dll to your qmlviewer plugin folder.

Also you need to put valid qmldir file: plugin QmlViewerDevHelperX86

You can put dll in any folder you like, just put the path with -I options on QmlViewer.

And usage: -I "/var varName=varValue" or -P "/var varName=varValue" so varName would be available in qml.

Example: -I "/var imagePath=d:/work/project/images"

You may find qt4.x version in 1.0.0 tag.

(c) 2012 Nikolay Bondarenko [email protected]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.