Author Topic: QFileDialog Brickwall  (Read 2168 times)

doc

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • http://
QFileDialog Brickwall
« on: April 06, 2004, 11:07:26 pm »
Another question for Qtopia experts...

I\'m trying to use a QFileDialog and hitting my head against a wall...it has to be obvious...

I keep getting compile errors:
zgscore.cpp: In method `void ZGS::Print()\':
zgscore.cpp:259: no method `QFileDialog::getSaveFileName\'
zgscore.cpp:259: warning: unused variable `class QString fileName\'
make: *** [zgscore.o] Error 1

Here is the code:
void ZGS::Print()
{
 QString fileName = QFileDialog::getSaveFileName( \"/tmp/zgscore.txt\",
                                                  \"Textfiles (*.txt)\",
                                                  this,
                                                  \"save file dialog\",
                                 \"Choose a filename to print report\" );
/* do something with fileName here */
}

Here is the class:
class ZGS : public ZGSBase
{
    Q_OBJECT
                                                                               
public:
    ZGS( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
    ~ZGS();
protected:
private slots:
    void Print();
};

I\'ve included <qfiledialog.h> so that\'s not the problem, what could be the deal?

Thanks in advance.
By your command...

Doc
Sharp SL-5500 PDA
Sharp 2.78 ROM
Viking 256MB SD
Socket LP-E CF Ethernet

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
QFileDialog Brickwall
« Reply #1 on: April 07, 2004, 04:58:07 am »
Welcome to the wonderful world of Qt/Embedded, where features are optional
Qt/Embedded in the Qtopia/Opie configuration defines QT_NO_FILESELECTOR hence does not contain the QFileSelector. Read qfileselector.h which explains why you can include that file but don\'t get any symbols.
Cheers,

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

doc

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • http://
QFileDialog Brickwall
« Reply #2 on: April 07, 2004, 08:03:39 am »
Ok, so if I can\'t use QFileDialog, is there a quick/dirty way to do this?
By your command...

Doc
Sharp SL-5500 PDA
Sharp 2.78 ROM
Viking 256MB SD
Socket LP-E CF Ethernet

Mickeyl

  • Hero Member
  • *****
  • Posts: 1495
    • View Profile
    • http://www.Vanille.de
QFileDialog Brickwall
« Reply #3 on: April 07, 2004, 08:33:12 am »
#include <qpe/filedialog.h> and use that.
Cheers,

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

boosalis

  • Jr. Member
  • **
  • Posts: 78
    • View Profile
    • http://
QFileDialog Brickwall
« Reply #4 on: April 08, 2004, 11:38:50 pm »
Also look at the FileDialog included in the application \"Just Reader\" created by Dmitri Skachkov.  He has the application released under GPL and it may be more suited for a PDA.  As I recall it looked pretty good.
Zaurus 6000 with expansion jacket