57 #include "QtApplication.hh" 63 #include <QWheelEvent> 131 template <
class SomeEvent>
132 static QEvent* clone_event(QEvent* _event)
133 {
return dynamic_cast<QEvent*
>(
new SomeEvent(*(dynamic_cast<SomeEvent*>(_event)) )); }
140 QtApplication::QtApplication(
int _argc,
char** _argv)
141 : QApplication(_argc, _argv),
173 void QtApplication::cleanUpEventBuffer()
176 for(
unsigned int i=0; i<events_.size(); i++)
177 if (events_[i].event)
178 delete events_[i].event;
187 void QtApplication::loop(
bool _b)
196 void QtApplication::play()
199 mainWidget_ = activeWindow();
203 std::cerr <<
"No Main Widget defined!\n";
213 restoreTopLevelSizes();
215 mainWidgetDiff_ = mainWidget_->mapToGlobal(QPoint(0,0)) - oldMainWidgetPos_;
218 timer_id_ = startTimer(10);
225 void QtApplication::stop()
229 killTimer( timer_id_ );
236 void QtApplication::record()
239 mainWidget_ = activeWindow();
243 std::cerr <<
"No Main Widget defined!\n";
249 killTimer( timer_id_ );
253 cleanUpEventBuffer();
255 storeTopLevelSizes();
258 oldMainWidgetPos_ = mainWidget_->mapToGlobal(QPoint(0,0));
268 bool QtApplication::notify (QObject* _receiver, QEvent* _event)
300 return QApplication::notify(_receiver, _event);
307 void QtApplication::recordEvent(QObject* , QEvent* )
414 void QtApplication::playbackEvent(FootPrint & )
517 QWidget* QtApplication::findWidget(FootPrint & )
551 void QtApplication::timerEvent(QTimerEvent* )
554 if (eventnr_ < events_.size())
557 FootPrint fp = events_[eventnr_];
560 if (fp.time < time_.elapsed())
578 else killTimer( timer_id_ );
586 void QtApplication::storeTopLevelSizes()
614 void QtApplication::restoreTopLevelSizes()
634 void QtApplication::saveFile(
const char* )
752 void QtApplication::loadFile(
const char* )
939 void QtApplication::saveTopLevelSizes(std::ostream & )
959 void QtApplication::loadTopLevelSizes(std::istream & )
Namespace providing different geometric functions concerning angles.