Results 1 to 5 of 5

Thread: QLocale/Resource

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2007
    Posts
    78
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Default Re: QLocale/Resource

    Thx DeepDiver but it is a slightly different situation.

    I have just been entrenched in so many other problems I didn't even think I should just create my own working example of it and force QLocale and see what happens....

    Bob

  2. #2
    Join Date
    Oct 2007
    Posts
    78
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Default Re: QLocale/Resource

    My problem that I was attempting to solve in the first question was having documentation set in html formatted files and loading them into a QTextEdit depending on what language was in use.

    If I placed in them in a resource file I could then just display them in the QTextEdit appropriately but was unsure of how to access them from resource file and have them displayed.

    I know how to read them in from file and set them but file access times are unacceptable so I figured I could add them as a resource and trade time for size.

    Bob

  3. #3
    Join Date
    Oct 2007
    Posts
    78
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1
    Thanked 3 Times in 3 Posts

    Default Re: QLocale/Resource

    In case anyone was wondering


    Qt Code:
    1. QFile file(THE_RESOURCE); // This should never fail since its a resource
    2. QByteArray data = file.readAll();
    3. QTextCodec *codec = Qt::codecForHtml(data);
    To copy to clipboard, switch view to plain text mode 

    Bob

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
  •  
Qt is a trademark of The Qt Company.