[Paraview] Custom Qt Filter Panel
clinton at elemtech.com
clinton at elemtech.com
Mon Nov 5 14:23:19 EST 2007
On Monday 05 November 2007 12:16:03 pm Robert Maynard wrote:
> Thanks for the help. I have found the problem being how it qt / paraview
> handles relative paths. Instead of the file using the path for plugin .so
> being the root, it actually uses the runtime directory as the root
> directory. Which means if I launch paraview from my home directory, or
> from the bin exactly I get different expectations on where my UI file
> should reside.
>
> The solution to this seems to be that the paraview developers have used a
>
> :/pqWidgets link to handle this problem, but I would like to know if there
>
> is a away for me to set the relative path starting directory to where the
> .so or the source code resides.
The ":" as the first character to a filename means it is embedded. I highly
recommend you do the same and embed the ui file in your plugin. You can
create a qrc file, call QT4_ADD_RESOURCES in your CMakeLists.txt file and add
the source file to the SOURCES when you call ADD_PARAVIEW_PLUGIN.
See the ParaView3/Examples/Plugins/Reader qrc file as an example. Instead
of the pqReader.xml you put your .ui file. And instead of the
the /ParaViewResources prefix, you make your own prefix.
Then you can reference the ui file as ":/MyPluginPrefix/My.ui" in your plugin
code.
Clint
More information about the ParaView
mailing list