It seems to work quite fine for me... Check the attached ui file (adjust the source to match your Qt docs index.html). Also be sure to always change the active document using setSource().
It seems to work quite fine for me... Check the attached ui file (adjust the source to match your Qt docs index.html). Also be sure to always change the active document using setSource().
Nyphel (24th May 2007)
Thanks Wysota, I didn't saw the answer before
This works well !
I had reimplemented the slots that could be set with the QtDesigner and I made an error.
I set the home_button to perform
Certainly should I set :
Qt Code:
my_text_box->setSource(home());To copy to clipboard, switch view to plain text mode
Hi,
I don't understand why but I can't make my browser to work.
When I execute my app, the browser is wide, clean, cleared...![]()
When I open the .ui file, the browser looks well and the html content is displayed.
When I preview the .ui file, the browser is wide, clean, cleared...![]()
The source is set in the .ui file, and never modified in my source code.
The only thing I've done since the last two weeks is to rebuild my Qt Open Source editon with the following configure.cache (under Win2000) :
Qt Code:
-release -static -fast -no-exceptions -no-dsp -no-vcproj -no-rtti -no-style-windowsxpTo copy to clipboard, switch view to plain text mode
You're probably using a relative path for your source and Qt can't find it once the binary is moved to other place (like debug or release folders).
Yes this is a relative path : ../../help/help.html
This relative path is the same path for my .ui file and my .exe file.
Qt Code:
my_project |-- help | |-- help.html | |-- gui | |-- gui | |-- help.ui | |-- my_app | |-- { sources } | |-- release | |-- my_app.exeTo copy to clipboard, switch view to plain text mode
But what I don't understand is that I don't move my application when I want to test it![]()
Moreover I must set a relative path, cause this application will be deployed on ifferent OS (Linux, Win98, Win2000 and WinXP). Isn't it possible ?
You can embed the files you need into your executable and use the resource system to access them.
Mmmhhh... I think that this solution wouldn't be the best for me![]()
I use a TextBrowser in order to be able to modify the help file without a complete rebuild of my application. So, if I embed it in the ressources file, wouldn't I lost this ability ?![]()
Last edited by Nyphel; 24th May 2007 at 12:47.
You can do the embedding only when your application is being released and use real files when developing. Alternatively use file path relative to QApplication::applicationDirPath(), just make sure they are always correct. For example Windows compilers tend to move your application to different directories when compiling.
Nyphel (25th May 2007)
That's a great idea, thanks Wysota, but it doesn't resolve my problem![]()
I think my installation is broken, cause it has worked very well before I rebuild my Qt Open Source edition with the static option.
Moreover, my compiler doesn't move the file while compiling (I've checked this point to be sure) and I'm pretty sure that if the QtDesigner editor can read the HTML file while editing the .ui, it should be able to read the content while doing the preview (with CTRL+D).
I don't really know what to do, but thanks for your help and tips, that helped me![]()
Could you prepare a minimal compilable example that reproduces the problem?
I'm a .ui file similar to yours
The difference is that I'm under Win2000 and my path to the HTML file is [../../aide/accueil.html] and not [/usr/share/doc/qt4/doc/html/index.html].
("aide" stands for "help" in french)
I generate the header file with the command :
uic aide.ui -o aide.h
And I use an implementation class...
Here is my HTML :
(I made some links to test the forward/backward/home functionnalities)Qt Code:
<html> <head> </head> <body> huhuhuh hin hin hin ! <br /><br /> <a href="suite.html">a link</a> </body> </html>To copy to clipboard, switch view to plain text mode
Here is my implementation class :
Qt Code:
#ifndef Aide_impl_h #define Aide_impl_h #include "../gui/gui/ui_aide.h" #include <QObject> #include <QDialog> #include <QtGui> #include <QUrl> { Q_OBJECT public: protected: private slots: private: }; #endif // Aide_impl_hTo copy to clipboard, switch view to plain text mode
Qt Code:
{ setupUi(this); }To copy to clipboard, switch view to plain text mode
And I use it in my application :
Qt Code:
Aide_impl my_help_window = new Aide_impl(this); my_help_window->show();To copy to clipboard, switch view to plain text mode
So where do you set the path?
Bookmarks