[Qt-interest] QFileDialog::getOpenFileName Directory name [SOLVED]
yogesh upreti
yogesh.upreti at gmail.com
Wed Jun 9 08:41:41 CEST 2010
Hallo All,
It worked after I change my QString variable, as suggested by Mr. Frank
from
QString str = "F:/Data/Files/"
to
QString str = "F:\\Data\\Files\\"
+ Removing statement fd.setDirectory(str)
However when I use the method getExistingFile or getExistingDir , setting up
QString str = "F:/Data/Files/" workes fine. I use the forward slashes
because I am using my programme for both Linux and Windows. and the
directory name delimiters are different in these two. Now I have added one
check for dir Name and replace "\\" with "/" when I am in unix ( something
internal for programme, may be not relevant here)
I am not putting a bug report as my Qt Installation is very complicated,
with a lot of user routines embaded in Nokia Qt. May be there is a problem
coming because of some other updates. Let's see is someone else encounters
the same problem then it will be good to Report a bug.
Thanks for Help
Regds,
Yogesh
Date: Tue, 8 Jun 2010 21:58:25 -0400
From: "K. Frank" <kfrank29.c at gmail.com>
Subject: Re: [Qt-interest] QFileDialog::getOpenFileName Directory name
To: Qt-interest <qt-interest at trolltech.com>
Message-ID:
<AANLkTiljga92zKX3psfkKu2d6jofCQ7nP_QAbt_ptE4e at mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
Hello Alex -
On Tue, Jun 8, 2010 at 6:27 PM, Malyushytsky, Alex <alex at wai.com> wrote:
> If you are sure you get such behavior ( I would suggest place call right
after another in your test case to verify ) ? it might be possible that
there is a bug in Qt. In this case you should report ?the buf with details
about your compilers/platform.
>
> But first I would try to change directoryPath to
>
> QString directoryPath = "/foo/bar/baz"; // remove '/' from the end
But note in my test (done with windows-style "\" rather than
unix-style "/") that "/foo/bar/baz/" was interpreted as directory
"/foo/bar/baz/" and no pre-loaded file name, while "/foo/bar/baz"
(no trailing "/") was interpreted as directory "/foo/bar/" and
pre-loaded file name "baz".
K. Frank
On Wed, Jun 9, 2010 at 8:16 AM, <qt-interest-request at trolltech.com> wrote:
> Send Qt-interest mailing list submissions to
> qt-interest at trolltech.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.trolltech.com/mailman/listinfo/qt-interest
> or, via email, send a message with subject or body 'help' to
> qt-interest-request at trolltech.com
>
> You can reach the person managing the list at
> qt-interest-owner at trolltech.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Qt-interest digest..."
>
>
> Today's Topics:
>
> 1. Re: QProcess::execute -- help (Jason H)
> 2. Re: QProcess::execute -- help (Jason H)
> 3. Re: QFileDialog::getOpenFileName Directory name (K. Frank)
> 4. Re: QProcess::execute -- help (Sean Harmer)
> 5. Custom QTreeView header (Fabio Dago)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 8 Jun 2010 18:13:31 -0700 (PDT)
> From: Jason H <scorp1us at yahoo.com>
> Subject: Re: [Qt-interest] QProcess::execute -- help
> To: pmqt71 <pmqt71 at gmail.com>, qt-interest at trolltech.com
> Message-ID: <911620.98882.qm at web65706.mail.ac4.yahoo.com>
> Content-Type: text/plain; charset="us-ascii"
>
> try start();
>
>
>
>
> ________________________________
> From: pmqt71 <pmqt71 at gmail.com>
> To: qt-interest at trolltech.com
> Sent: Tue, June 8, 2010 7:41:51 PM
> Subject: [Qt-interest] QProcess::execute -- help
>
>
>
> Hi all,
>
> I'm using QProcess::execute in my Qt server application to run a script on
> the server side (Ubuntu 64 bit). It works fine when I run my app, but doen't
> work when I close the console.
>
> the application is alive because I run it in background ( ./myApp& ) and I
> find it in the ps list, but the script is not executed.
>
> I'm using both a relative and fixed path, also I tried the system function:
>
> QProcess::execute("./myScript &");
> QProcess::execute("/entire/path/myScript &");
> QProcess::execute("./myScript");
> QProcess::execute("/entire/path/myScript");
> system("/entire/path/myScript &");
>
> but without success.
>
> Please help me!
> pm
>
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.trolltech.com/pipermail/qt-interest/attachments/20100608/04854ce5/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Tue, 8 Jun 2010 18:19:26 -0700 (PDT)
> From: Jason H <scorp1us at yahoo.com>
> Subject: Re: [Qt-interest] QProcess::execute -- help
> To: pmqt71 <pmqt71 at gmail.com>, qt-interest at trolltech.com
> Message-ID: <65840.1713.qm at web65706.mail.ac4.yahoo.com>
> Content-Type: text/plain; charset="us-ascii"
>
> Oh, I am sorry, I missed the important bit.
>
> When you close the console, the signal HUP (hang up, from modem days) is
> sent to all child processes of that shell.
>
> You need to protect your process with 'nohup' (unix commandline utility)
> that will block the HUP from reaching your process.
>
>
>
>
>
> ________________________________
> From: pmqt71 <pmqt71 at gmail.com>
> To: qt-interest at trolltech.com
> Sent: Tue, June 8, 2010 7:41:51 PM
> Subject: [Qt-interest] QProcess::execute -- help
>
>
>
> Hi all,
>
> I'm using QProcess::execute in my Qt server application to run a script on
> the server side (Ubuntu 64 bit). It works fine when I run my app, but doen't
> work when I close the console.
>
> the application is alive because I run it in background ( ./myApp& ) and I
> find it in the ps list, but the script is not executed.
>
> I'm using both a relative and fixed path, also I tried the system function:
>
> QProcess::execute("./myScript &");
> QProcess::execute("/entire/path/myScript &");
> QProcess::execute("./myScript");
> QProcess::execute("/entire/path/myScript");
> system("/entire/path/myScript &");
>
> but without success.
>
> Please help me!
> pm
>
>
>
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.trolltech.com/pipermail/qt-interest/attachments/20100608/1450c41d/attachment-0001.html
>
> ------------------------------
>
> Message: 3
> Date: Tue, 8 Jun 2010 21:58:25 -0400
> From: "K. Frank" <kfrank29.c at gmail.com>
> Subject: Re: [Qt-interest] QFileDialog::getOpenFileName Directory name
> To: Qt-interest <qt-interest at trolltech.com>
> Message-ID:
> <AANLkTiljga92zKX3psfkKu2d6jofCQ7nP_QAbt_ptE4e at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hello Alex -
>
> On Tue, Jun 8, 2010 at 6:27 PM, Malyushytsky, Alex <alex at wai.com> wrote:
> > If you are sure you get such behavior ( I would suggest place call right
> after another in your test case to verify ) ? it might be possible that
> there is a bug in Qt. In this case you should report ?the buf with details
> about your compilers/platform.
> >
> > But first I would try to change directoryPath to
> >
> > QString directoryPath = "/foo/bar/baz"; // remove '/' from the end
>
> But note in my test (done with windows-style "\" rather than
> unix-style "/") that "/foo/bar/baz/" was interpreted as directory
> "/foo/bar/baz/" and no pre-loaded file name, while "/foo/bar/baz"
> (no trailing "/") was interpreted as directory "/foo/bar/" and
> pre-loaded file name "baz".
>
> K. Frank
>
> > ...
> > From: qt-interest-bounces at trolltech.com [mailto:
> qt-interest-bounces at trolltech.com] On Behalf Of yogesh upreti
> > Sent: Tuesday, June 08, 2010 4:36 AM
> > To: qt-interest at trolltech.com
> > Subject: Re: [Qt-interest] QFileDialog::getOpenFileName Directory name
> >
> > Hallo Oliver,
> > I was aware about the fact that its a static method, so I first wrote the
> code without an instance. But my problem is this. If I write:
> > ?QString filePath = QFileDialog::getOpenFileName(this, "Caption",
> "/foo/bar/baz/", "*.D"); (this is what I mean giving dir path explicitly);
> > it opens the dialog box in "/foo/bar/baz/" dir.
> > But if I write it
> > QString directoryPath = "/foo/bar/baz/";
> > QString filePath = QFileDialog::getOpenFileName(this, "Caption",
> directoryPath, "*.D");
> >
> > it dosen't open it in "/foo/bar/baz/" instead it opens it in current
> working dir. I am using Nokia Qt SDK 2010 for compiling my programme.
> >
> > I will try in the way you said (example with fd.exec()) and give the
> feedback.
> >
> > Thanks
> > Yogesh
> > ...
>
>
>
> ------------------------------
>
> Message: 4
> Date: Wed, 09 Jun 2010 06:38:48 +0100
> From: Sean Harmer <sean.harmer at maps-technology.com>
> Subject: Re: [Qt-interest] QProcess::execute -- help
> To: qt-interest at trolltech.com
> Message-ID: <4C0F28E8.5090500 at maps-technology.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hi,
>
> On 09/06/2010 00:41, pmqt71 wrote:
> >
> > Hi all,
> >
> > I'm using QProcess::execute in my Qt server application to run a script
> > on the server side (Ubuntu 64 bit). It works fine when I run my app, but
> > doen't work when I close the console.
> >
> > the application is alive because I run it in background ( ./myApp& ) and
> > I find it in the ps list, but the script is not executed.
> >
> > I'm using both a relative and fixed path, also I tried the system
> function:
> >
> > QProcess::execute("./myScript &");
> > QProcess::execute("/entire/path/myScript &");
> > QProcess::execute("./myScript");
> > QProcess::execute("/entire/path/myScript");
> > system("/entire/path/myScript &");
> >
> > but without success.
>
> Have you looked at the QtService solution? This allows you to easily run
> your application as a daemon process.
>
>
> http://qt.nokia.com/products/appdev/add-on-products/catalog/4/Utilities/qtservice/
>
> Cheers,
>
> Sean
>
>
> ------------------------------
>
> Message: 5
> Date: Wed, 09 Jun 2010 08:16:13 +0200
> From: Fabio Dago <fabio.dago at sir.to.it>
> Subject: [Qt-interest] Custom QTreeView header
> To: qt-interest at trolltech.com
> Message-ID: <4C0F31AD.50606 at sir.to.it>
> Content-Type: text/plain; charset=ISO-8859-15; format=flowed
>
> Hi.
>
> I'm trying to create a custom header for QTreeView.
>
> The QHeaderView documentation says that using a delegate for custom
> painting has no effect, so I subclass QHeaderView and reimplement
> paintEvent()...
>
> void MyHeaderView::paintEvent(QPaintEvent* e)
> {
> QPainter painter(this);
> //...
> //...
> }
>
> I dont't know why, but this doesn't work, and the QPainter contructor
> outputs: " QPainter::begin: Paint device returned engine == 0, type: 1 "
>
> What's wrong?
>
> Thanks.
> Fabio.
>
>
> ------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
> End of Qt-interest Digest, Vol 19, Issue 70
> *******************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100609/765ad7b4/attachment.html
More information about the Qt-interest-old
mailing list