Qtopia - FileSelector

"Stefan Kreisberg" <[email protected]> Mon, 21 Oct 2002 20:50:39 +0200
Newsgroups gmane.comp.handhelds.zaurus.devel
Message-ID <3DB4689F.17759.1F8AC4@localhost>
Hi,

I'm trying to use the FileSelector suplied with the Qtopia dist. 
Problem is: no good working example to start of from. I've read the 
Textedit, and knows its usage when raising widgets via QMainWindow 
and a QWidgetStack. But what if I don't need a stack to my "one tab 
page" GUI + a simple XML parser for which I want to use the 
FileSelector ...  

Does anyone know of a good simple FileSelector example?  
*******************************************************************

And for those of you who want to snooze closer at my problem:  

Being a "newborn" Linux developer, I appreciate any helpful comments 
on the FileSelector widget: My problem is that the widget never gets 
raised, instead the application quits ...  

I have a main file,
	QPEApplication a( argc, argv );
 	// and my implemented GUI GMTool:
 	GMTool mw;
   	a.showMainDocumentWidget( &mw );

and in the GMTool implementation I have, among others:

	GMTool::GMTool( QWidget* parent,  const char* name, WFlags fl )
 	    : BaseForm( parent, name, fl )

 	// etc...

 	// and here the part that doesn't work as intended:
 	/*
 	 * public slot for selecting XML file
 	 */
 	void GMTool::openXML()
 	{
 	  fs = new FileSelector("text/xml", this, "fileselector", false);
 	  connect( fs, SIGNAL(fileSelected(const DocLnk&)), this,
		 SLOT(openDoc(const DocLnk&)));
 	  fs->show();
 	}

I have an "Open" button (clicked) signal connected to the openXML 
slot, and a FileSelector* fs in the header file .... I guess my main 
problem is to understand widget relationship(s) and how to show'em?  

I looked at the source code for Text Editor which uses a QWidgetStack 
and QMainWindow, but found that copying these might be a bit drastic 
for my "one GUI form" appl.  

The program compiles without errors, and everything but the above 
mentioned slot works fine (I can even click an XML file and 
load/parse it automatic in the appl.)  

What happens when I press open: The application simply quits, with a 
qWarning saying 	 	
	Categories::labels didn't find app Document View  

Best Regards from overseas,

Stefan the Dane
-----BEGIN GEEK CODE BLOCK-----
GCS/MU d? s+:s+ a31 C+++$ L+++ w E(++) W+++ V+ Y+ 5? R+++ b+++ D---- 
++ h----
-----END GEEK CODE BLOCK------



-------------------------------------------------------
This sf.net emial is sponsored by: Influence the future of 
Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) 
program now. http://ad.doubleclick.net/clk;4699841;7576298;k?
http://www.sun.com/javavote