|
|
2010-05-05
, 18:06
|
|
Posts: 16 |
Thanked: 11 times |
Joined on Dec 2009
|
#3
|
Code for the timer to call vibrate and stopVibrate
Code:vibrate(); tmr = new QTimer(this); tmr->isSingleShot(); QObject::connect(tmr, SIGNAL(timeout()), this, SLOT(stopVibrate())); tmr->start(5000);
| The Following 2 Users Say Thank You to rkm For This Useful Post: | ||
|
|
2010-05-05
, 20:11
|
|
Posts: 289 |
Thanked: 101 times |
Joined on Oct 2009
|
#4
|
|
|
2010-05-07
, 11:01
|
|
Posts: 289 |
Thanked: 101 times |
Joined on Oct 2009
|
#5
|
|
|
2010-05-07
, 11:10
|
|
|
Posts: 1,389 |
Thanked: 1,857 times |
Joined on Feb 2010
@ Israel
|
#6
|
|
|
2010-05-07
, 11:36
|
|
Posts: 289 |
Thanked: 101 times |
Joined on Oct 2009
|
#7
|
|
|
2010-05-11
, 06:18
|
|
Posts: 289 |
Thanked: 101 times |
Joined on Oct 2009
|
#8
|
|
|
2010-05-11
, 10:18
|
|
Posts: 432 |
Thanked: 645 times |
Joined on Mar 2009
|
#9
|
Still have the same old problems, but I got a new problem. How do I interact with the calendar? I know of the calendar-backend-dev example but the development guide tells me to install calendar-backend (wich I have the newest version of) and calendar-backend-dev(wich does not exist). So my thoughts are that this is removed with qt 4.6. If it is, is there any new examples or so for the new calendar api?
| The Following User Says Thank You to danielwilms For This Useful Post: | ||
|
|
2010-05-11
, 10:38
|
|
Posts: 289 |
Thanked: 101 times |
Joined on Oct 2009
|
#10
|
int XML::saveNewEx(QString &name, QString &group, QString &muscle, QString &info) { QDomDocument doc( "Exercises" ); QDomElement root = doc.createElement( "exercise" ); doc.appendChild( root ); root.appendChild(ContactToNode(doc, name, group, muscle, info)); QFile file( "/home/user/MyDocs/Gym/exercises.xml" ); if(!file.open(QIODevice::WriteOnly)) return 1; QTextStream ts( &file ); ts << doc.toString(); file.close(); return 0; } QDomElement XML::ContactToNode( QDomDocument &d, QString name, QString group, QString muscle, QString info) { QDomElement cn = d.createElement( "exercise" ); cn.setAttribute( "name", name ); cn.setAttribute("group", group); cn.setAttribute( "muscle", muscle ); cn.setAttribute( "info", info ); cn.setAttribute( "weight", "0" ); cn.setAttribute( "status", "ok" ); return cn; }A link wich describe this using the dbus, but I do not understand this thing... http://talk.maemo.org/showthread.php...ia+player+dbus
The third problem I have is rotation of the screen. I got it working by seting the attribute to portrait or almost... When I add a new exercise I want to write the name and such so I thought that landscape would be much better here. When I create the landscape-window I set the attribute to landscape(for that window). But it does not work, and as I also have set the attribute(portrait) for every window and remove the first windows attribute only some becomes portrait and yet I have not figured out how this really work. So where do I have the set this argument? Do I have to do something before? Or not do?
And the last problem is about vibration! And here is the code for it:
interface = new QDBusInterface(MCE_SERVICE, MCE_REQUEST_PATH, MCE_REQUEST_IF, QDBusConnection::systemBus(), this); QDBusMessage reply = interface->call(MCE_ENABLE_VIBRATOR); if (reply.type() == QDBusMessage::ErrorMessage) qDebug() << reply.errorMessage(); void WaitWindow::vibrate() { QDBusMessage reply; reply = interface->call(MCE_ACTIVATE_VIBRATOR_PATTERN, "PatternIncomingCall"); if (reply.type() == QDBusMessage::ErrorMessage) qDebug() << reply.errorMessage(); } void WaitWindow::stopVibrate() { QDBusMessage reply; reply = interface->call(MCE_DEACTIVATE_VIBRATOR_PATTERN, "PatternIncomingCall"); if (reply.type() == QDBusMessage::ErrorMessage) qDebug() << reply.errorMessage(); }Code for the timer to call vibrate and stopVibrate
vibrate(); tmr = new QTimer(this); tmr->isSingleShot(); QObject::connect(tmr, SIGNAL(timeout()), this, SLOT(stopVibrate())); tmr->start(5000);