SaveFile-Dialog
Florian Erfurth <[email protected]>
| Newsgroups | gmane.comp.handhelds.opie.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi folks,
am I stupid or do I only think that I *may* be stupid? I did try the
whole night to write a line, so that my app popup a SaveFile-dialog. But
it will not work. :( I did try two ways without success:
I did try with QFileDialog (#include <qfiledialog.h>:
code:
QString fileName = QFileDialog::getSaveFileName( "newfile.txt",
"Textfiles (*.txt)", this );
This result such error message:
incomplete type 'QFileDialog' cannot be used to name a scope
If I compile this code (without any modification) with qt3, it works
fine and in the runtime a SaveDialog did pop up.
Then I gave up and did try with OFileDialog:
QString fileName = OFileDialog::getSaveFileName( this , , "newfile.txt", );
Then I got such error message:
g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2
-DOPIE_NO_DEBUG -DOPIE_NO_BUILTIN_SHUTDOWN -DUSE_FILE_NOTIFICATION
-DOPIE_SOUND_FRAGMENT_SHIFT=16 -DQT_NO_DEBUG
-I/home/floh/qt-embedded/opie/mkspecs/qws/linux-x86-g++ -I.
-I/home/floh/qt-embedded/opie/include
-I/home/floh/qt-embedded/qt-2.3.10/include -I.moc// -o
.obj//speech2textImpl.o speech2textImpl.cpp
speech2textImpl.cpp: In member function `virtual void
speech2textImpl::SaveText_slot()':
speech2textImpl.cpp:16: error: `OFileDialog' undeclared (first use this
function)
speech2textImpl.cpp:16: error: (Each undeclared identifier is reported only
once for each function it appears in.)
speech2textImpl.cpp:16: error: parse error before `::' token
speech2textImpl.cpp:16: warning: unused variable `QString fileName'
make: *** [.obj//speech2textImpl.o] Error 1
So, why will it not work? The code is in attachment.
cu Floh
_______________________________________________
http://opie.handhelds.org/cgi-bin/moin.cgi/DeveloperWikiIndex
Opie-devel mailing list
[email protected]
https://handhelds.org/mailman/listinfo/opie-devel
speech2textImpl.cpp
(text/plain, 783 B)
#include "speech2textImpl.h"
#include <qmessagebox.h>
#include <qdialog.h>
#include <opie2/ofiledialog.h>
//#include <qfiledialog.h>
#include <qstring.h>
void speech2textImpl::Hangup_slot()
{
QMessageBox::information( this, "Speech2Text Info", "Under Construction", QMessageBox::Ok );
}
void speech2textImpl::SaveText_slot()
{
QMessageBox::information( this, "Speech2Text Info", "Under Construction", QMessageBox::Ok );
QString fileName = OFileDialog::getSaveFileName( this , , "newfile.txt", );
/*
QString fileName = OFileDialog::getSaveFileName( "newfile.txt", "Textfiles (*.txt)", this );
QString fileName = QFileDialog::getSaveFileName( "newfile.txt", "Textfiles (*.txt)", this );
if ( !fileName.isNull() )
{
//file saved
} else {
//file not saved
}
*/
}