Results 1 to 2 of 2

Thread: QResource dinamic append resource on run app

  1. #1
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QResource dinamic append resource on run app

    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...

    Qt Code:
    1. void Base_Function::RegisterImage( QString infile )
    2. {
    3. QResource newfileappender; /* infile is absolutePath */
    4. bool makehits;
    5. makehits = newfileappender.registerResource(infile, ":/pic/");
    6. if (makehits) {
    7. qDebug() << "### register true " << infile;
    8. } else {
    9. qDebug() << "### register false " << infile;
    10. }
    11. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QResource dinamic append resource on run app

    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/t...ntry&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?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.