Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
lifo
Nicolas Ollinger
OpenBoard
Commits
ed2996c9
Commit
ed2996c9
authored
Apr 05, 2012
by
Aleksei Kanash
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
c29832a5
80bfc86a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
0 deletions
+71
-0
UBAngleWidget.cpp
src/domain/UBAngleWidget.cpp
+46
-0
UBAngleWidget.h
src/domain/UBAngleWidget.h
+25
-0
No files found.
src/domain/UBAngleWidget.cpp
0 → 100644
View file @
ed2996c9
#include "UBAngleWidget.h"
#include <QPainter>
UBAngleWidget
::
UBAngleWidget
(
QWidget
*
parent
)
:
QWidget
(
parent
)
{
this
->
setFixedSize
(
45
,
30
);
this
->
setWindowFlags
(
Qt
::
FramelessWindowHint
|
Qt
::
WindowStaysOnTopHint
);
this
->
setAttribute
(
Qt
::
WA_TranslucentBackground
);
QImage
mask_img
(
width
(),
height
(),
QImage
::
Format_Mono
);
mask_img
.
fill
(
0xff
);
QPainter
mask_ptr
(
&
mask_img
);
mask_ptr
.
setBrush
(
QBrush
(
QColor
(
0
,
0
,
0
)
)
);
mask_ptr
.
drawRoundedRect
(
0
,
0
,
this
->
geometry
().
width
()
-
6
,
this
->
geometry
().
height
()
-
6
,
1
,
1
);
bmpMask
=
QBitmap
::
fromImage
(
mask_img
);
this
->
setMask
(
bmpMask
);
}
UBAngleWidget
::~
UBAngleWidget
()
{
}
void
UBAngleWidget
::
paintEvent
(
QPaintEvent
*
event
)
{
Q_UNUSED
(
event
);
this
->
move
(
this
->
cursor
().
pos
().
x
(),
this
->
cursor
().
pos
().
y
()
-
30
);
QPainter
painter
(
this
);
painter
.
setRenderHints
(
QPainter
::
Antialiasing
|
QPainter
::
SmoothPixmapTransform
);
QBrush
brush
(
Qt
::
white
);
painter
.
setBrush
(
brush
);
painter
.
drawRoundedRect
(
1
,
1
,
this
->
geometry
().
width
()
-
10
,
this
->
geometry
().
height
()
-
10
,
1
,
1
);
painter
.
setPen
(
QColor
(
85
,
50
,
127
));
painter
.
setFont
(
QFont
(
"Arial"
,
10
));
painter
.
drawText
(
1
,
1
,
this
->
geometry
().
width
()
-
10
,
this
->
geometry
().
height
()
-
10
,
Qt
::
AlignCenter
,
text
);
}
void
UBAngleWidget
::
setText
(
QString
newText
)
{
text
=
newText
;
text
.
append
(
QChar
(
176
));
}
\ No newline at end of file
src/domain/UBAngleWidget.h
0 → 100644
View file @
ed2996c9
#ifndef UBANGLEWIDGET_H
#define UBANGLEWIDGET_H
#include <QWidget>
#include <QBitmap>
class
UBAngleWidget
:
public
QWidget
{
Q_OBJECT
public
:
UBAngleWidget
(
QWidget
*
parent
=
0
);
~
UBAngleWidget
();
void
setText
(
QString
);
protected
:
void
paintEvent
(
QPaintEvent
*
event
);
private
:
QString
text
;
QBitmap
bmpMask
;
};
#endif // UBANGLEWIDGET_H
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