OESF Portables Forum
Everything Else => Zaurus - Everything Development => Distros, Development, and Model Specific Forums => Archived Forums => Qt/Qtopia => Topic started by: tblumer on April 22, 2004, 07:31:43 pm
-
I need to write a simple application that is launched from the normal Applications tab, but has no GUI output (unless there is an error). It also must not change keyboard focus from the current application that\'s running. (The user can assign a button press to it.) It\'s easy enough to do a simple widget that does something, then exits, but the waiting hourglass remains, as does the \"explosion\" launch graphic. Basically, I want a button press to trigger an event in the background and have it work from any application. Any suggestions?
-
More specifically, here\'s what I\'m trying, but as you can see by the comment, the screen flickers momentarily.
Trigger::Trigger( QWidget *parent, const char *name, WFlags fl )
: QWidget( parent, name, WStyle_Customize | WStyle_NoBorderEx )
{
p_sdgms = sdgms_init( \"/dev/sdgmhs0\", SDGMS_VERSION );
if (p_sdgms == NULL)
{
QMessageBox::critical(0, \"Not Detected\",
\"The scanner cannot be detected. Please make sure it \"
\"is securely plugged in and try again.\");
exit(1);
}
if (sdgms_open( p_sdgms ) != SDGMS_SUCCESS)
{
QMessageBox::critical(0, \"Not Detected\",
\"The scanner cannot be detected. Please make sure it \"
\"is securely plugged in and try again.\");
exit(1);
}
setFixedSize(0,0); // don\'t make widget appear, screen flickers :-(
setDisabled(TRUE);
QTimer::singleShot( 0, this, SLOT(scanon()) );
}
Trigger::~Trigger( void )
{
sdgms_shutdown( p_sdgms );
}
void
Trigger::scanon( void )
{
(void) sdgms_trigger( p_sdgms, SDGMS_TRIGGER_ON, NULL, NULL );
}
-
can you try using hide() ?