Author Topic: QFileDialog::getOpenFileName  (Read 4848 times)

frogola

  • Newbie
  • *
  • Posts: 1
    • View Profile
QFileDialog::getOpenFileName
« on: October 18, 2004, 07:18:48 pm »
I'm a newbie porter, just installed the qtopia sdk and cross compiler libs and tools to port qt apps to the zaurus.  My first compile resulted in the following error:

no method `QFileDialog::getOpenFileName'

Is there an alternative to QFileDialog when coding for the zaurus?  If so what is it and where is it documented?

Thanks,
-Frank
http://www.inwa.net/~frog/

ashikase

  • Sr. Member
  • ****
  • Posts: 280
    • View Profile
    • http://
QFileDialog::getOpenFileName
« Reply #1 on: October 18, 2004, 09:57:40 pm »
frogola:

A lot of classes are disabled in the Zaurus build of Qtopia; this includes QFileDialog.

Sharp includes a library on the Z (libsl) that provides a replacement, SlFileDialog; it has similar functionality (though is not exactly the same). The include files for it, as well as all of Sharp's other classes, can be downloaded from:

http://developer.ezaurus.com/sl_j/doc/refe...20021227.tar.gz
http://developer.ezaurus.com/sl_j/doc/refe...qte.so.2.3.2.gz

(The second file includes an updated libqte file; the one included in the first file is apparently flawed with respect to libjpeg support).

The include files can be found in 'include/sl'. The sdk file also contains copies of the libraries (libqte, libsl, libjpeg, libzdtm) that are used on the Zaurus. If you built the cross-compiler (and thus the libraries) yourself, you should use the library files from the sdk instead, as the sdk libs contain different options (at least, this was the case for me when I tried to use libsl with my own built version of libqte). Another option is to just copy the libraries directly from your Zaurus.

As for (English) documentation, there really isn't a lot available. You can try looking at the slfiledialog.h header file for information. You can also take a look at Opie's implementation of the class, as it should be compatible:

http://dudu.dyn.2-h.org/nist/doxydoc/allOp...FileDialog.html

My program, knQuiz, makes use of SlFileDialog; you can browse the source at the link below (look at kaniquiz.cpp, in the slotLoadFile method):

http://cvs.sourceforge.net/viewcvs.py/niho....23&view=markup

Oh, and please forgive my messy code, it's still a work in progress (^_^;)
(Specifically, ignore the whole 'if (breakCompounds)' section; it has nothing to do with the file dialog).

Hope that helps.

- ashikase
  anpachi, gifu, japan
SL-C3100 & SL-C760

vanstrien

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • http://www.vanstrien.net
QFileDialog::getOpenFileName
« Reply #2 on: October 21, 2004, 10:36:03 am »
Ashikase,

I gave the sdk files a go and tried to use them in one of my own apps.  I also tried to compile your two apps downloaded from sourceforge. For some reason I get errors on all attempts.

Any suggestions?  I copied the files from the SDK into my existing /opt/Qtopia (which came from the qtopia-free rpm).

All my compilaton errors appear to be at the linking stage.  And my old apps don't run with the new libs.  I'm sure I copied the x86 and sharp libs to the right place.

R,

Michael
C860 Cacko ROM | 5500 tkcROM
256MB SD | 128MB SD
512MB CF | 256MB CF
D-Link DWL 660 WiFi| Linksys WCF12 WiFi
Socket Bluetooth | Socket Ethernet

ashikase

  • Sr. Member
  • ****
  • Posts: 280
    • View Profile
    • http://
QFileDialog::getOpenFileName
« Reply #3 on: October 21, 2004, 11:18:51 am »
vanstrien: (EDIT: had addressed to wrong person, sorry)

What errors did you get?

Also, your compiler, did you build it yourself or install it from RPMs? If from RPMs, you will probably have two lib directories, /opt/Qtopia/lib and /opt/Qtopia/sharp/lib. The sharp/lib is for cross-compiling... make sure to put the library files in this directory, not /opt/Qtopia/lib.

- ashikase
  anpachi, gifu, japan
« Last Edit: October 21, 2004, 09:45:53 pm by ashikase »
SL-C3100 & SL-C760

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
QFileDialog::getOpenFileName
« Reply #4 on: October 21, 2004, 12:56:51 pm »
Please don't use libsl - it's a one way street and exludes usage on other distributions than SharpROM clones. Don't support proprietary closed source libraries on a PDA using a free operating system when there are alternatives, i.e.  there's always the libqpe FileDialog or the libopie2 OFileDialog.
« Last Edit: October 21, 2004, 12:58:15 pm by Mickeyl »
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.

lpotter

  • Sr. Member
  • ****
  • Posts: 450
    • View Profile
    • http://qtopia.net
QFileDialog::getOpenFileName
« Reply #5 on: October 21, 2004, 03:06:49 pm »
Quote
I'm a newbie porter, just installed the qtopia sdk and cross compiler libs and tools to port qt apps to the zaurus.  My first compile resulted in the following error:

no method `QFileDialog::getOpenFileName'

Is there an alternative to QFileDialog when coding for the zaurus?  If so what is it and where is it documented?

Thanks,
-Frank
http://www.inwa.net/~frog/
Use FileSelector class in Qtopia. Or, you can also use my fileBrowser class.
You might have to edit this a bit, and could even improve it and send back patches

http://handhelds.org/~llornkcor/devZone/fileBrowser.tgz
Software Engineer, Systems Group, MES, Trolltech
irc.freenode.net #qtopia
http://qtopia.net

ashikase

  • Sr. Member
  • ****
  • Posts: 280
    • View Profile
    • http://
QFileDialog::getOpenFileName
« Reply #6 on: October 21, 2004, 10:04:22 pm »
Quote
there's always the libqpe FileDialog or the libopie2 OFileDialog.

As far as I know, there is no FileDialog available in libqpe; did you mean FileSelector?

Quote
Use FileSelector class in Qtopia.

Please, do *not* use FileSelector. FileSelector is designed to search all available media for a given mimetype; for people with large flash cards (like my 4GB microdrive), this search can take ages. Qtopia (version < 1.6) does not provide a way to prevent certain media from being searched (Opie does).

I have not tried OFileDialog; does it do the same kind of media-wide search as FileSelector? Which library is it a part of, libopie1 or libopie2... or both? (What's the difference between the two libraries, anyways?)

- ashikase
  anpachi, gifu, japan
SL-C3100 & SL-C760

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
QFileDialog::getOpenFileName
« Reply #7 on: October 22, 2004, 05:21:58 am »
The difference is: libopie1 is old, libopie2 is new

Whereas libopie1 was a big pile of junk, libopie2 is functionally split to lighten up dependencies. libopieui2 contains a nice OFileDialog class which is used in some Opie applications.
Cheers,

Michael 'Mickey' Lauer | Embedded Linux Freelancer | www.Vanille-Media.de
Consider donating, if you like the software I contribute to.

zenyatta

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
QFileDialog::getOpenFileName
« Reply #8 on: October 22, 2004, 06:24:23 am »
ashikase:

OFileDialog contains the very cool feature of being able to switch between a filesystem view (files and directories) and a document view (the Qtopia way) on the fly using a simple drop-down. As far as I can tell, the Qtopia mode doesn't scan media at all - it uses information obtained at Opie startup and during media mounts. It also seems to respect the scanning limitations from Settings > Medium Mount. In OZ 3.5.1, you can see this new dialog when setting a Launcher tab background image. I hope it spreads to other applications as soon as possible, it seems to be a really well-thought-out piece of work.

Of course, if you're developing for non-OZ ROMs you'll have to figure out how to get libopieui2 running on your system.

z.
« Last Edit: October 22, 2004, 06:25:07 am by zenyatta »
SL-5500, 256MB Kingston CF card, 128MB EDGE SD card, Thomson HED-155 headphones
OpenZaurus 3.5.3 / Opie (kernel 64-0)

vanstrien

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • http://www.vanstrien.net
QFileDialog::getOpenFileName
« Reply #9 on: October 22, 2004, 09:54:29 am »
Ashikase,

I'm using the redhat RPMs on Fedora 2.  One of my first problems was that I used the tmake.conf that came with the SDK - that messed up all my compiling.   I've since corrected that.

With the lib files in /opt/Qtopia/lib, the sharp/lib files in /opt/Qtopia/sharp/lib and the include files in /opt/Qtopia/include I still get errors on the linking stage.  Here they are:

Code: [Select]
gcc296  -o example main.o example.o moc_example.o  -L/opt/Qtopia/lib -lqpe -lqte
example.o(.text+0x52): In function `mainwidget::mainwidget(QWidget *, char const *, unsigned int)':
: undefined reference to `SlFileDialog::SlFileDialog(bool, QWidget *, char const *, bool, unsigned int)'
example.o(.text+0x5b): In function `mainwidget::mainwidget(QWidget *, char const *, unsigned int)':
: undefined reference to `SlFileDialog::getFileName(void)'
collect2: ld returned 1 exit status
make: *** [example] Error 1

Mickey,

I'm likely to release a version based on OPIE as well, or based on a library that I've half written myself.
C860 Cacko ROM | 5500 tkcROM
256MB SD | 128MB SD
512MB CF | 256MB CF
D-Link DWL 660 WiFi| Linksys WCF12 WiFi
Socket Bluetooth | Socket Ethernet