[Qt-interest] Qt Property to open a File from filesystem (not resource)
prashant bhutani
prashantbhutani2008 at gmail.com
Mon Apr 26 16:40:29 CEST 2010
On Mon, Apr 26, 2010 at 7:43 PM, fungos <fungos at gmail.com> wrote:
> Hi,
Hi
> we are using QtTreePropertyBrowser and we need be able to select a
> file with a filedialog from inside a property. We want something like
> QVariant QIcon but with a filesystem file and not a resource file.
you can use** QString <http://qstring.html> QFileDialog::getOpenFileName (
QWidget <http://qwidget.html> * *parent* = 0, const QString<http://qstring.html>
& *caption* = QString(), const QString <http://qstring.html> & *dir* =
QString(), const QString <http://qstring.html> & *filter* = QString(),
QString <http://qstring.html> * *selectedFilter* = 0,
Options<http://qfiledialog.html#Option-enum>
*options* = 0 ) This will return a *QString *for the path of the file file
(in your case, picture/image path for QIcon) you will choose from the
directory of your system.
you can pass *QDir::Current()* as a third parameter to above function and
filter the choice of your files with fourth parameter.
We
> are not using Q_PROPERY but doing everything using
> QtVariantPropertyManager and others. Anybody has a sample on how to
> achieve this?
>
> Hope this will help you. You can get more on this from the Qt Documentation
.
>
> Thank you
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
--
Prashant Bhutani
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100426/07d2efe1/attachment.html
More information about the Qt-interest-old
mailing list