Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
ba356e1d
Commit
ba356e1d
authored
Nov 19, 2010
by
tecnosapiens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added slugs camera control
parent
2dfdafca
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
167 additions
and
0 deletions
+167
-0
SlugsVideoCamControl.cpp
src/ui/SlugsVideoCamControl.cpp
+58
-0
SlugsVideoCamControl.h
src/ui/SlugsVideoCamControl.h
+38
-0
SlugsVideoCamControl.ui
src/ui/SlugsVideoCamControl.ui
+71
-0
No files found.
src/ui/SlugsVideoCamControl.cpp
0 → 100644
View file @
ba356e1d
#include "SlugsVideoCamControl.h"
#include "ui_SlugsVideoCamControl.h"
#include <QGraphicsScene>
#include <QGraphicsTextItem>
#include <QTextStream>
#include <QScrollBar>
#include <QMouseEvent>
#include <QWheelEvent>
#include <QDebug>
SlugsVideoCamControl
::
SlugsVideoCamControl
(
QWidget
*
parent
)
:
ui
(
new
Ui
::
SlugsVideoCamControl
)
{
ui
->
setupUi
(
this
);
// QGraphicsScene *scene = new QGraphicsScene(ui->CamControlPanel_graphicsView);
// scene->setItemIndexMethod(QGraphicsScene::NoIndex);
// scene->setSceneRect(-200, -200, 400, 400);
// setScene(scene);
// setCacheMode(CacheBackground);
// setViewportUpdateMode(BoundingRectViewportUpdate);
// setRenderHint(QPainter::Antialiasing);
// setTransformationAnchor(AnchorUnderMouse);
// setResizeAnchor(AnchorViewCenter);
ui
->
CamControlPanel_graphicsView
->
installEventFilter
(
this
);
ui
->
label_x
->
installEventFilter
(
this
);
}
SlugsVideoCamControl
::~
SlugsVideoCamControl
()
{
delete
ui
;
}
void
SlugsVideoCamControl
::
mouseMoveEvent
(
QMouseEvent
*
event
)
{
ui
->
label_x
->
setText
(
QString
::
number
(
event
->
x
()));
ui
->
label_y
->
setText
(
QString
::
number
(
event
->
y
()));
}
//void SlugsVideoCamControl::mousePressEvent(QMouseEvent *evnt)
//{
//}
//void SlugsVideoCamControl::mouseReleaseEvent(QMouseEvent *evnt)
//{
//}
//void SlugsVideoCamControl::mouseDoubleClickEvent(QMouseEvent *evnt)
//{
//}
src/ui/SlugsVideoCamControl.h
0 → 100644
View file @
ba356e1d
#ifndef SLUGSVIDEOCAMCONTROL_H
#define SLUGSVIDEOCAMCONTROL_H
#include <QWidget>
#include <QMouseEvent>
#include <QGraphicsView>
#include <QGraphicsSceneMouseEvent>
#include <QGraphicsScene>
namespace
Ui
{
class
SlugsVideoCamControl
;
}
class
SlugsVideoCamControl
:
public
QGraphicsView
{
Q_OBJECT
public:
explicit
SlugsVideoCamControl
(
QWidget
*
parent
=
0
);
~
SlugsVideoCamControl
();
protected:
// virtual void mousePressEvent(QMouseEvent* event);
//virtual void mouseReleaseEvent(QMouseEvent* event);
//void mouseMoveEvent(QMouseEvent* event);
void
mouseMoveEvent
(
QMouseEvent
*
event
);
// virtual void wheelEvent(QWheelEvent* event);
//virtual void resizeEvent(QResizeEvent* event);
private:
Ui
::
SlugsVideoCamControl
*
ui
;
};
#endif // SLUGSVIDEOCAMCONTROL_H
src/ui/SlugsVideoCamControl.ui
0 → 100644
View file @
ba356e1d
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
SlugsVideoCamControl
</class>
<widget
class=
"QWidget"
name=
"SlugsVideoCamControl"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
443
</width>
<height>
351
</height>
</rect>
</property>
<property
name=
"mouseTracking"
>
<bool>
true
</bool>
</property>
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"QGraphicsView"
name=
"CamControlPanel_graphicsView"
>
<property
name=
"mouseTracking"
>
<bool>
true
</bool>
</property>
<property
name=
"styleSheet"
>
<string
notr=
"true"
>
background-color: rgb(255, 170, 0);
</string>
</property>
<property
name=
"frameShape"
>
<enum>
QFrame::WinPanel
</enum>
</property>
<property
name=
"verticalScrollBarPolicy"
>
<enum>
Qt::ScrollBarAlwaysOff
</enum>
</property>
<property
name=
"horizontalScrollBarPolicy"
>
<enum>
Qt::ScrollBarAlwaysOff
</enum>
</property>
<property
name=
"sceneRect"
>
<rectf>
<x>
0.000000000000000
</x>
<y>
0.000000000000000
</y>
<width>
200.000000000000000
</width>
<height>
200.000000000000000
</height>
</rectf>
</property>
</widget>
</item>
<item
row=
"1"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_y"
>
<property
name=
"mouseTracking"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
TextLabel
</string>
</property>
</widget>
</item>
<item
row=
"2"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_x"
>
<property
name=
"mouseTracking"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
TextLabel
</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment