Commit 6e4e1530 authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: Fixed xtt_multiview.

parent 2ce48869
...@@ -561,7 +561,7 @@ void CoWowQt::PopupPosition( ...@@ -561,7 +561,7 @@ void CoWowQt::PopupPosition(
QPoint p0((int)x_event, (int)y_event); QPoint p0((int)x_event, (int)y_event);
grandparent = parent->parentWidget(); grandparent = parent->parentWidget();
while (!grandparent->isWindow()) { while (grandparent && !grandparent->isWindow()) {
if (parent->geometry().x() || parent->geometry().y()) { if (parent->geometry().x() || parent->geometry().y()) {
p0 = parent->mapToParent(p0); p0 = parent->mapToParent(p0);
} }
......
This diff is collapsed.
...@@ -57,8 +57,6 @@ public: ...@@ -57,8 +57,6 @@ public:
QWidget* comp_widget[MV_SIZE]; QWidget* comp_widget[MV_SIZE];
QWidget* exchange_widget[MV_SIZE]; QWidget* exchange_widget[MV_SIZE];
QHBoxLayout* exchange_widget_layout[MV_SIZE]; QHBoxLayout* exchange_widget_layout[MV_SIZE];
QWidget* box_widget;
QWidget* col_widget;
XttGeQt* gectx[MV_SIZE]; XttGeQt* gectx[MV_SIZE];
XttMultiViewQt* mvctx[MV_SIZE]; XttMultiViewQt* mvctx[MV_SIZE];
EvAlaQt* sala[MV_SIZE]; EvAlaQt* sala[MV_SIZE];
...@@ -95,15 +93,13 @@ private: ...@@ -95,15 +93,13 @@ private:
XttMultiViewQtWidget* toplevel; XttMultiViewQtWidget* toplevel;
}; };
class XttMultiViewQtWidget : public QDialog { class XttMultiViewQtWidget : public QWidget {
public: public:
XttMultiViewQtWidget(XttMultiViewQt* parent_ctx, QWidget* parent) XttMultiViewQtWidget(XttMultiViewQt* parent_ctx, QWidget* parent)
: QDialog(parent), multiview(parent_ctx) : QWidget(parent), multiview(parent_ctx)
{ {
} }
void resize(int width, int height);
protected: protected:
void focusInEvent(QFocusEvent* event); void focusInEvent(QFocusEvent* event);
void closeEvent(QCloseEvent* event); void closeEvent(QCloseEvent* event);
......
...@@ -203,6 +203,13 @@ void XttStreamQtWidget::resizeEvent(QResizeEvent* event) ...@@ -203,6 +203,13 @@ void XttStreamQtWidget::resizeEvent(QResizeEvent* event)
} }
} }
void XttStreamQt::hidePtz()
{
if (ptz_box != NULL) {
ptz_box->setVisible(false);
}
}
void XttStreamQtWidget::mousePressEvent(QMouseEvent* event) void XttStreamQtWidget::mousePressEvent(QMouseEvent* event)
{ {
switch (event->button()) { switch (event->button()) {
...@@ -215,7 +222,7 @@ void XttStreamQtWidget::mousePressEvent(QMouseEvent* event) ...@@ -215,7 +222,7 @@ void XttStreamQtWidget::mousePressEvent(QMouseEvent* event)
int x = event->globalPos().x() + 8; int x = event->globalPos().x() + 8;
int y = event->globalPos().y(); int y = event->globalPos().y();
stream->action_mb3click(x, y); stream->action_mb3click(x, y);
stream->ptz_box->setVisible(false); stream->hidePtz();
break; break;
} }
default: default:
...@@ -259,7 +266,7 @@ void XttStreamQtWidget::mouseReleaseEvent(QMouseEvent* event) ...@@ -259,7 +266,7 @@ void XttStreamQtWidget::mouseReleaseEvent(QMouseEvent* event)
&& ABS(event->pos().y() - stream->mb_press_y) < 10) { && ABS(event->pos().y() - stream->mb_press_y) < 10) {
stream->action_click( stream->action_click(
event->pos().x() - offset_x, event->pos().y() - offset_y); event->pos().x() - offset_x, event->pos().y() - offset_y);
stream->ptz_box->setVisible(false); stream->hidePtz();
} else if (ABS(event->pos().x() - stream->mb_press_x) > 20 } else if (ABS(event->pos().x() - stream->mb_press_x) > 20
&& abs(event->pos().y() - stream->mb_press_y) > 20) { && abs(event->pos().y() - stream->mb_press_y) > 20) {
int x = MIN(event->pos().x(), stream->mb_press_x) - offset_x; int x = MIN(event->pos().x(), stream->mb_press_x) - offset_x;
...@@ -268,7 +275,7 @@ void XttStreamQtWidget::mouseReleaseEvent(QMouseEvent* event) ...@@ -268,7 +275,7 @@ void XttStreamQtWidget::mouseReleaseEvent(QMouseEvent* event)
int h = ABS(event->pos().y() - stream->mb_press_y); int h = ABS(event->pos().y() - stream->mb_press_y);
printf("Mb zoom (%d,%d) rect %d,%d\n", x, y, w, h); printf("Mb zoom (%d,%d) rect %d,%d\n", x, y, w, h);
stream->action_areaselect(x, y, w, h); stream->action_areaselect(x, y, w, h);
stream->ptz_box->setVisible(false); stream->hidePtz();
} }
break; break;
} }
...@@ -318,12 +325,12 @@ void XttStreamQtWidget::wheelEvent(QWheelEvent* event) ...@@ -318,12 +325,12 @@ void XttStreamQtWidget::wheelEvent(QWheelEvent* event)
void XttStreamQt::scroll_cb(void* data) void XttStreamQt::scroll_cb(void* data)
{ {
XttStreamQt* strm = (XttStreamQt*)data; XttStreamQt* stream = (XttStreamQt*)data;
strm->action_scroll( stream->action_scroll(
strm->scroll_direction, strm->scroll_x, strm->scroll_y, strm->scroll_cnt); stream->scroll_direction, stream->scroll_x, stream->scroll_y, stream->scroll_cnt);
strm->scroll_cnt = 0; stream->scroll_cnt = 0;
strm->ptz_box->setVisible(false); stream->hidePtz();
} }
XttStreamQt::XttStreamQt(QWidget* st_parent_wid, void* st_parent_ctx, XttStreamQt::XttStreamQt(QWidget* st_parent_wid, void* st_parent_ctx,
...@@ -519,8 +526,8 @@ XttStreamQt::XttStreamQt(QWidget* st_parent_wid, void* st_parent_ctx, ...@@ -519,8 +526,8 @@ XttStreamQt::XttStreamQt(QWidget* st_parent_wid, void* st_parent_ctx,
} }
toplevel->setLayout(main_layout); toplevel->setLayout(main_layout);
toplevel->setMinimumSize(width, height);
if (!embedded) { if (!embedded) {
toplevel->setMinimumSize(width, height);
toplevel->show(); toplevel->show();
if (options & strm_mOptions_FullScreen) { if (options & strm_mOptions_FullScreen) {
...@@ -604,7 +611,7 @@ void XttStreamQtWidget::zoom_helper() ...@@ -604,7 +611,7 @@ void XttStreamQtWidget::zoom_helper()
} else { } else {
stream->camera_control->zoom_relative(value); stream->camera_control->zoom_relative(value);
} }
stream->ptz_box->setVisible(false); stream->hidePtz();
} }
void XttStreamQtWidget::pan_helper() void XttStreamQtWidget::pan_helper()
...@@ -616,7 +623,7 @@ void XttStreamQtWidget::pan_helper() ...@@ -616,7 +623,7 @@ void XttStreamQtWidget::pan_helper()
int value = ((QAction *) sender())->data().toInt(); int value = ((QAction *) sender())->data().toInt();
stream->camera_control->pan_relative(value); stream->camera_control->pan_relative(value);
stream->ptz_box->setVisible(false); stream->hidePtz();
} }
void XttStreamQtWidget::tilt_helper() void XttStreamQtWidget::tilt_helper()
...@@ -628,21 +635,21 @@ void XttStreamQtWidget::tilt_helper() ...@@ -628,21 +635,21 @@ void XttStreamQtWidget::tilt_helper()
int value = ((QAction *) sender())->data().toInt(); int value = ((QAction *) sender())->data().toInt();
stream->camera_control->tilt_relative(value); stream->camera_control->tilt_relative(value);
stream->ptz_box->setVisible(false); stream->hidePtz();
} }
void XttStreamQtWidget::activate_preset_position() void XttStreamQtWidget::activate_preset_position()
{ {
int idx = ((QAction*)sender())->data().toInt(); int idx = ((QAction*)sender())->data().toInt();
stream->activate_preset_position(idx); stream->activate_preset_position(idx);
stream->ptz_box->setVisible(false); stream->hidePtz();
} }
void XttStreamQtWidget::activate_preset_store_pos() void XttStreamQtWidget::activate_preset_store_pos()
{ {
int idx = ((QAction*)sender())->data().toInt(); int idx = ((QAction*)sender())->data().toInt();
stream->activate_preset_store_pos(idx); stream->activate_preset_store_pos(idx);
stream->ptz_box->setVisible(false); stream->hidePtz();
} }
void XttStreamQtWidget::activate_get_position() void XttStreamQtWidget::activate_get_position()
...@@ -664,5 +671,5 @@ void XttStreamQtWidget::activate_get_position() ...@@ -664,5 +671,5 @@ void XttStreamQtWidget::activate_get_position()
stream->ptz_pan->setText(pan_str); stream->ptz_pan->setText(pan_str);
stream->ptz_tilt->setText(tilt_str); stream->ptz_tilt->setText(tilt_str);
stream->ptz_zoom->setText(zoom_str); stream->ptz_zoom->setText(zoom_str);
stream->ptz_box->setVisible(false); stream->hidePtz();
} }
\ No newline at end of file
...@@ -79,6 +79,7 @@ public: ...@@ -79,6 +79,7 @@ public:
void pop(); void pop();
void set_size(int width, int height); void set_size(int width, int height);
void hidePtz();
void* get_widget() void* get_widget()
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment