You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, June 9th 2005, 11:25am

Fileselector

hi,

I have a big problem with the QFileSelector.
I just want to open a dialogue and choose a file... but my app says that there are no documents found.
My code looks like this:

FileSelector folder = new FileSelector ( QString::null, widget, "Choose attachment", false, false);
folder->setGeometry(0,0,widget->width(), widget->height());
folder->show();

I tried a lot of different filters, but nothing helps.
Does anyone has an idea to solve my problem?

2

Thursday, June 9th 2005, 11:52am

RE: Fileselector

I'm using QFileSelector with this

Source code

1
2
3
4
5
6
7
8
9
10
sel = new FileSelector ("*/*", NULL, NULL, false, true);
     connect (sel, SIGNAL(fileSelected(const DocLnk &)), this, SLOT(changed(const DocLnk &)));
     connect (sel, SIGNAL(closeMe()), this, SLOT(cancel()));
     sel->showMaximized();
...
if ((sel->selectedDocument()).isValid())
   {
   DocLnk * f = new DocLnk( sel->selectedDocument());
   QString file(f->file());
}

and it works fine
There's no place like ::1

3

Thursday, June 9th 2005, 12:19pm

I try to use this class without using signals and slots... so I changed my implementation only by changing the mime filter... but it is the same result: No documents found :(

Also the showMaximized() function does not work in my code...

4

Thursday, June 9th 2005, 1:09pm

RE: Fileselector

Have you setup your environment? If you haven't installed your application to your QPEDIR the app you execute needs to be called with #> HOME=$QPEHOME ./app. Otherwise the globals like documents directory can not be resolved...
There's no place like ::1

5

Thursday, June 9th 2005, 1:28pm

no thats not the problem... I tried to call "HOME=$QPEHOME ./app" but I got the same result...

Another idea?

6

Thursday, June 9th 2005, 2:06pm

hey... now I get another warning messages:

Warning: Unable to open /Settings/Categories.xml
Warning: Unable to write /Settings/Categories_new.xml
Warning: Unable to open /Settings/Categories.xml
Warning: Unable to write /Settings/Categories_new.xml
Warning: Unable to open /Settings/Categories.xml
Warning: Unable to write /Settings/Categories_new.xml
...
Warning: QDir::readDirEntries: Cannot read the directory ../Documents


Whats that? It is not a permission problem...

7

Thursday, June 9th 2005, 3:05pm

I meant QPEHOME, that's where Qtopia stores its data (e.g. folders Documents, Applications and Settings) NOT QTEDIR, where Qtopia base installation resides... default would be #> HOME=$QPEDIR/home ./app I think
There's no place like ::1