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
c7aecd12
Commit
c7aecd12
authored
Nov 19, 2010
by
Mariano Lizarraga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed the dragging frame for a QWidget in the slugs camera control
parent
ba356e1d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
43 deletions
+38
-43
SlugsVideoCamControl.cpp
src/ui/SlugsVideoCamControl.cpp
+10
-2
SlugsVideoCamControl.h
src/ui/SlugsVideoCamControl.h
+1
-1
SlugsVideoCamControl.ui
src/ui/SlugsVideoCamControl.ui
+27
-40
No files found.
src/ui/SlugsVideoCamControl.cpp
View file @
c7aecd12
...
...
@@ -11,6 +11,7 @@
SlugsVideoCamControl
::
SlugsVideoCamControl
(
QWidget
*
parent
)
:
QWidget
(
parent
),
ui
(
new
Ui
::
SlugsVideoCamControl
)
{
ui
->
setupUi
(
this
);
...
...
@@ -25,8 +26,8 @@ SlugsVideoCamControl::SlugsVideoCamControl(QWidget *parent) :
// setTransformationAnchor(AnchorUnderMouse);
// setResizeAnchor(AnchorViewCenter);
ui
->
CamControlPanel_graphicsView
->
installEventFilter
(
this
);
ui
->
label_x
->
installEventFilter
(
this
);
//
ui->CamControlPanel_graphicsView->installEventFilter(this);
//
ui->label_x->installEventFilter(this);
}
...
...
@@ -37,8 +38,15 @@ SlugsVideoCamControl::~SlugsVideoCamControl()
void
SlugsVideoCamControl
::
mouseMoveEvent
(
QMouseEvent
*
event
)
{
QPoint
tL
=
ui
->
widget
->
frameGeometry
().
topLeft
();
QPoint
bR
=
ui
->
widget
->
frameGeometry
().
bottomRight
();
if
(
!
(
event
->
x
()
>
bR
.
x
()
||
event
->
x
()
<
tL
.
x
()
||
event
->
y
()
>
bR
.
y
()
||
event
->
y
()
<
tL
.
y
()
)){
ui
->
label_x
->
setText
(
QString
::
number
(
event
->
x
()));
ui
->
label_y
->
setText
(
QString
::
number
(
event
->
y
()));
}
}
...
...
src/ui/SlugsVideoCamControl.h
View file @
c7aecd12
...
...
@@ -11,7 +11,7 @@ namespace Ui {
class
SlugsVideoCamControl
;
}
class
SlugsVideoCamControl
:
public
Q
GraphicsView
class
SlugsVideoCamControl
:
public
Q
Widget
{
Q_OBJECT
...
...
src/ui/SlugsVideoCamControl.ui
View file @
c7aecd12
...
...
@@ -16,53 +16,40 @@
<property
name=
"windowTitle"
>
<string>
Form
</string>
</property>
<layout
class=
"Q
GridLayout"
name=
"gridLayout
"
>
<item
row=
"0"
column=
"0"
>
<widget
class=
"Q
GraphicsView"
name=
"CamControlPanel_graphicsView
"
>
<layout
class=
"Q
VBoxLayout"
name=
"verticalLayout_2
"
>
<item>
<widget
class=
"Q
Widget"
name=
"widget"
native=
"true
"
>
<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>
<string
notr=
"true"
>
background-color: rgb(255, 193, 76);
</string>
</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
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"label_y"
>
<property
name=
"mouseTracking"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
TextLabel
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_x"
>
<property
name=
"mouseTracking"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
TextLabel
</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
...
...
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