OESF Portables Forum
Everything Else => Zaurus - Everything Development => Distros, Development, and Model Specific Forums => Archived Forums => Qt/Qtopia => Topic started by: liferey on July 17, 2004, 05:00:26 pm
-
I wrote a simple program using Qpe alarmserver.
IN constructor:
connect(qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)),
this, SLOT(slotappMessage(const QCString&, const QByteArray&)));
AlarmServer::AddAlarm(when, "QPE/Application/alarmclock","alarmclock(QDT,int)",0);
In slotappMessage:
if(msg=="alarmclock()") Sound::soundAlarm;
I just followed the alarmserver ref and everything looks simple enough. But when I tried to run the program, it always says "NO such signal QApplication::appMessage(const QCString&, const QByteArray&)" on Zaurus. What am I doing wrong here?
Thanks for your help!
-
You need to connect to QPEApplication.
You should have in main.cpp something like this:
QPEApplication a( argc, argv );
QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(receive( const QCString&, const QByteArray& )));
m is here a Mainwindow, receive is the receiving slot.
You have to change that.
z.
-
Thank you very much!
I did what you said and now the program can run - but the results are wrong.
When the time comes to execute the alarm, it looks like Zaurus is trying to do something, with the hourglass displaying at the buttom, but nothing happens. Debug shows that the program doesn't go into receive() slot.
I think this is because my "QPE/Application/myalarm" isn't kosher. I don't know what my appname should be. So I just name the cpp file myalarm.cpp, the class name myalarm and the .pro file myalarm.pro, hoping that by doing this, zaurus will know what I am talking about in AlarmServer::addAlarm(alarm_time, "QPE/Application/myalarm", ...) But obviously it is not that simple.
How do I decide my appname in QPE/Application/appname?