diff options
Diffstat (limited to 'client/videowidget.cc')
-rw-r--r-- | client/videowidget.cc | 59 |
1 files changed, 56 insertions, 3 deletions
diff --git a/client/videowidget.cc b/client/videowidget.cc index cc81ead..a007df8 100644 --- a/client/videowidget.cc +++ b/client/videowidget.cc @@ -27,7 +27,10 @@ #include "videowidget.h" #include "miav_config.h" -VideoWidget::VideoWidget() +#include <QMoveEvent> +#include <QResizeEvent> + +VideoWidget::VideoWidget() : QWidget() { // A welltested hack to force SDL to draw in the QWidget @@ -39,8 +42,8 @@ VideoWidget::VideoWidget() palette.setColor(backgroundRole(), Qt::blue); setPalette(palette); - setLineWidth(10); - setFrameStyle(QFrame::Raised); + // setLineWidth(10); + // setFrameStyle(QFrame::Raised); } @@ -67,3 +70,53 @@ void VideoWidget::mouseReleaseEvent(QMouseEvent *event) } */ } + +void VideoWidget::moveEvent(QMoveEvent *event) +{ + mutex.lock(); + myposition = mapToGlobal(event->pos()); + mutex.unlock(); +} + +void VideoWidget::resizeEvent(QResizeEvent *event) +{ + mutex.lock(); + mysize = event->size(); + mutex.unlock(); +} + +int VideoWidget::getX() +{ + int val; + mutex.lock(); + val = myposition.x(); + mutex.unlock(); + return val; +} + +int VideoWidget::getY() +{ + int val; + mutex.lock(); + val = myposition.y(); + mutex.unlock(); + return val; +} + +int VideoWidget::getWidth() +{ + int val; + mutex.lock(); + val = mysize.width(); + mutex.unlock(); + return val; +} + +int VideoWidget::getHeight() +{ + int val; + mutex.lock(); + val = mysize.height(); + mutex.unlock(); + return val; +} |