63 #include "QtApplication.hh"
69 #include <QWheelEvent>
137 template <
class SomeEvent>
138 static QEvent* clone_event(QEvent* _event)
139 {
return dynamic_cast<QEvent*
>(
new SomeEvent(*(dynamic_cast<SomeEvent*>(_event)) )); }
146 QtApplication::QtApplication(
int _argc,
char** _argv)
147 : QApplication(_argc, _argv),
179 void QtApplication::cleanUpEventBuffer()
182 for(
unsigned int i=0; i<events_.size(); i++)
183 if (events_[i].event)
184 delete events_[i].event;
193 void QtApplication::loop(
bool _b)
202 void QtApplication::play()
205 mainWidget_ = activeWindow();
209 std::cerr <<
"No Main Widget defined!\n";
219 restoreTopLevelSizes();
221 mainWidgetDiff_ = mainWidget_->mapToGlobal(QPoint(0,0)) - oldMainWidgetPos_;
224 timer_id_ = startTimer(10);
231 void QtApplication::stop()
235 killTimer( timer_id_ );
242 void QtApplication::record()
245 mainWidget_ = activeWindow();
249 std::cerr <<
"No Main Widget defined!\n";
255 killTimer( timer_id_ );
259 cleanUpEventBuffer();
261 storeTopLevelSizes();
264 oldMainWidgetPos_ = mainWidget_->mapToGlobal(QPoint(0,0));
274 bool QtApplication::notify (QObject* _receiver, QEvent* _event)
306 return QApplication::notify(_receiver, _event);
313 void QtApplication::recordEvent(QObject* , QEvent* )
420 void QtApplication::playbackEvent(FootPrint & )
523 QWidget* QtApplication::findWidget(FootPrint & )
557 void QtApplication::timerEvent(QTimerEvent* )
560 if (eventnr_ < events_.size())
563 FootPrint fp = events_[eventnr_];
566 if (fp.time < time_.elapsed())
584 else killTimer( timer_id_ );
592 void QtApplication::storeTopLevelSizes()
620 void QtApplication::restoreTopLevelSizes()
640 void QtApplication::saveFile(
const char* )
758 void QtApplication::loadFile(
const char* )
945 void QtApplication::saveTopLevelSizes(std::ostream & )
965 void QtApplication::loadTopLevelSizes(std::istream & )
Namespace providing different geometric functions concerning angles.