Controller Class Reference

#include <controller.h>

Inheritance diagram for Controller:

Inheritance graph
[legend]
Collaboration diagram for Controller:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 31 of file controller.h.

Public Member Functions

 Controller (QWidget *parent=0)

Protected Member Functions

void timerEvent (QTimerEvent *event)

Private Slots

void on_accelerate_clicked ()
void on_decelerate_clicked ()
void on_left_clicked ()
void on_right_clicked ()

Private Attributes

Ui::Controller ui
CarInterfacecar


Constructor & Destructor Documentation

Controller::Controller ( QWidget parent = 0  ) 

Definition at line 29 of file controller.cpp.

References car, QDBusConnection::sessionBus(), QObject::startTimer(), and ui.

00030     : QWidget(parent)
00031 {
00032     ui.setupUi(this);
00033     car = new CarInterface("com.trolltech.CarExample", "/Car",
00034                            QDBusConnection::sessionBus(), this);
00035     startTimer(1000);
00036 }

Here is the call graph for this function:


Member Function Documentation

void Controller::timerEvent ( QTimerEvent event  )  [protected, virtual]

This event handler can be reimplemented in a subclass to receive timer events for the object.

QTimer provides a higher-level interface to the timer functionality, and also more general information about timers. The timer event is passed in the event parameter.

See also:
startTimer(), killTimer(), event()

Reimplemented from QObject.

Definition at line 38 of file controller.cpp.

References car, QWidget::event(), QDBusAbstractInterface::isValid(), and ui.

00039 {
00040     Q_UNUSED(event);
00041     if (car->isValid())
00042         ui.label->setText("connected");
00043     else
00044         ui.label->setText("disconnected");
00045 }

Here is the call graph for this function:

void Controller::on_accelerate_clicked (  )  [private, slot]

Definition at line 47 of file controller.cpp.

References CarInterface::accelerate(), and car.

00048 {
00049     car->accelerate();
00050 }

void Controller::on_decelerate_clicked (  )  [private, slot]

Definition at line 52 of file controller.cpp.

References car, and CarInterface::decelerate().

00053 {
00054     car->decelerate();
00055 }

void Controller::on_left_clicked (  )  [private, slot]

Definition at line 57 of file controller.cpp.

References car, and CarInterface::turnLeft().

00058 {
00059     car->turnLeft();
00060 }

void Controller::on_right_clicked (  )  [private, slot]

Definition at line 62 of file controller.cpp.

References car, and CarInterface::turnRight().

00063 {
00064     car->turnRight();
00065 }


Member Data Documentation

Ui::Controller Controller::ui [private]

Definition at line 48 of file controller.h.

Referenced by Controller(), and timerEvent().

CarInterface* Controller::car [private]

Definition at line 49 of file controller.h.

Referenced by Controller(), on_accelerate_clicked(), on_decelerate_clicked(), on_left_clicked(), on_right_clicked(), and timerEvent().


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 14:50:51 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1