PDA

View Full Version : QResource dinamic append resource on run app



patrik08
27th November 2006, 19:34
qtdoc say....


bool QResource::registerResource ( const QString & rccFileName, const QString & mapRoot = QString() ) [static]
Registers the resource with the given rccFileName at the location in the resource tree specified by mapRoot, and returns true if the file is successfully opened; otherwise returns false.
See also unregisterResource().

all my rccFileName is already register .... but how i can append new QResource on run application?

is this the same method as rcc source code?

On qtextedit (Qt::RichText) i can display only image from resource? is this normal?
full path not running?

this give only false on not register...



void Base_Function::RegisterImage( QString infile )
{
QResource newfileappender; /* infile is absolutePath */
bool makehits;
makehits = newfileappender.registerResource(infile, ":/pic/");
if (makehits) {
qDebug() << "### register true " << infile;
} else {
qDebug() << "### register false " << infile;
}
}

patrik08
27th November 2006, 20:30
I found this....

The correct way to register a resource file using QResource::registerResource() is to use rcc to create a binary, which then can be loaded at runtime.

Therefore do:

#rcc -binary foo.qrc -o foo.rcc

then in the code:

QResource::registerResource("/path/to/foo.rcc");


http://www.trolltech.com/developer/task-tracker/index_html?method=entry&id=131727

is this ok?

i must put rcc on installer??

on QDomDocument create a xml resource file && on qprocess create the binary fo.rcc loading or register resource and final display image on qtextedit?
I suppose the are other way to display image on qtexedit ?
Mission imposibel WYSIWYG & display image edit on qt?