[Interest] Very large QRC file

Sean Harmer sean.harmer at kdab.com
Wed Mar 23 17:33:52 CET 2016


On Wednesday 23 March 2016 17:28:21 Jason H wrote:
> > Notice the -no-compress option too this can save runtime CPu costs
> > involved
> > with decompressing the data especially for already compressed formats such
> > as most video codecs.
> > 
> > Then in your c++ source add:
> > 
> > QResource::registerResource("mybigmedia.qrb");
> > 
> > and use it just like any other resource. Just remember to deploy the qrb
> > file with your app.
> 
> Thanks, that seems to have fixed my compile time, but the call to
> registerResource fails. int main(int argc, char *argv[])
> {
> 	QGuiApplication app(argc, argv);
> 	qDebug() << "registerResource" << 
QResource::registerResource("media.qrb");
> // FALSE
> 
> 	QQmlApplicationEngine engine;
> 	engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
> 
> 	return app.exec();
> }
> 
> However the build directory contains: media.qrb (100mb)
> However when the app is launched it is that build dir plus
> "VideoPlayerHIV.app/Contents/MacOS"
> 
> How can I set this up in a platform independent way? (Develop on OSX, deploy
> to iOS/Android)

mac {
    asset_builder.output = 
$$OUT_PWD/VideoPlayerHIV.app/Contents/MacOs/${QMAKE_FILE_IN_BASE}.qrb
} else {
    asset_builder.output = $$OUT_PWD/${QMAKE_FILE_IN_BASE}.qrb
}

Or similar.

Sean
--
Dr Sean Harmer | sean.harmer at kdab.com | Managing Director UK
Klarälvdalens Datakonsult AB, a KDAB Group company
Tel. UK +44 (0)1625 809908, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions



More information about the Interest mailing list