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
558f2d47
Commit
558f2d47
authored
Aug 10, 2012
by
shibakaneki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Sankore/Sankore-3.1
parents
f25da1f3
fbb5d875
Changes
48
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
1318 additions
and
399 deletions
+1318
-399
JournalDesModifications.pdf
JournalDesModifications.pdf
+0
-0
ReleaseNotes.pdf
ReleaseNotes.pdf
+0
-0
Sankore_3.1.pro
Sankore_3.1.pro
+1
-1
style.qss
resources/style.qss
+11
-8
UBBoardController.cpp
src/board/UBBoardController.cpp
+115
-12
UBBoardController.h
src/board/UBBoardController.h
+3
-1
UBBoardPaletteManager.cpp
src/board/UBBoardPaletteManager.cpp
+4
-9
UBFeaturesController.cpp
src/board/UBFeaturesController.cpp
+336
-68
UBFeaturesController.h
src/board/UBFeaturesController.h
+63
-19
UBGraphicsGroupContainerItem.cpp
src/domain/UBGraphicsGroupContainerItem.cpp
+17
-6
UBGraphicsGroupContainerItem.h
src/domain/UBGraphicsGroupContainerItem.h
+2
-0
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+18
-17
UBGraphicsItemDelegate.h
src/domain/UBGraphicsItemDelegate.h
+18
-11
UBGraphicsMediaItem.cpp
src/domain/UBGraphicsMediaItem.cpp
+22
-14
UBGraphicsMediaItem.h
src/domain/UBGraphicsMediaItem.h
+2
-0
UBGraphicsPDFItem.cpp
src/domain/UBGraphicsPDFItem.cpp
+16
-7
UBGraphicsPDFItem.h
src/domain/UBGraphicsPDFItem.h
+2
-0
UBGraphicsPixmapItem.cpp
src/domain/UBGraphicsPixmapItem.cpp
+17
-9
UBGraphicsPixmapItem.h
src/domain/UBGraphicsPixmapItem.h
+2
-0
UBGraphicsPolygonItem.cpp
src/domain/UBGraphicsPolygonItem.cpp
+22
-14
UBGraphicsPolygonItem.h
src/domain/UBGraphicsPolygonItem.h
+1
-0
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+6
-2
UBGraphicsScene.h
src/domain/UBGraphicsScene.h
+3
-1
UBGraphicsStrokesGroup.cpp
src/domain/UBGraphicsStrokesGroup.cpp
+15
-6
UBGraphicsStrokesGroup.h
src/domain/UBGraphicsStrokesGroup.h
+1
-0
UBGraphicsSvgItem.cpp
src/domain/UBGraphicsSvgItem.cpp
+17
-8
UBGraphicsSvgItem.h
src/domain/UBGraphicsSvgItem.h
+2
-0
UBGraphicsTextItem.cpp
src/domain/UBGraphicsTextItem.cpp
+24
-16
UBGraphicsTextItem.h
src/domain/UBGraphicsTextItem.h
+3
-0
UBGraphicsWidgetItem.cpp
src/domain/UBGraphicsWidgetItem.cpp
+45
-27
UBGraphicsWidgetItem.h
src/domain/UBGraphicsWidgetItem.h
+5
-0
UBItem.h
src/domain/UBItem.h
+3
-0
UBFeaturesActionBar.cpp
src/gui/UBFeaturesActionBar.cpp
+16
-5
UBFeaturesActionBar.h
src/gui/UBFeaturesActionBar.h
+2
-0
UBFeaturesWidget.cpp
src/gui/UBFeaturesWidget.cpp
+305
-99
UBFeaturesWidget.h
src/gui/UBFeaturesWidget.h
+111
-10
UBGraphicsCache.cpp
src/tools/UBGraphicsCache.cpp
+12
-3
UBGraphicsCache.h
src/tools/UBGraphicsCache.h
+2
-0
UBGraphicsCompass.cpp
src/tools/UBGraphicsCompass.cpp
+12
-3
UBGraphicsCompass.h
src/tools/UBGraphicsCompass.h
+2
-0
UBGraphicsCurtainItem.cpp
src/tools/UBGraphicsCurtainItem.cpp
+16
-8
UBGraphicsCurtainItem.h
src/tools/UBGraphicsCurtainItem.h
+1
-0
UBGraphicsProtractor.cpp
src/tools/UBGraphicsProtractor.cpp
+16
-9
UBGraphicsProtractor.h
src/tools/UBGraphicsProtractor.h
+1
-0
UBGraphicsRuler.cpp
src/tools/UBGraphicsRuler.cpp
+12
-3
UBGraphicsRuler.h
src/tools/UBGraphicsRuler.h
+1
-0
UBGraphicsTriangle.cpp
src/tools/UBGraphicsTriangle.cpp
+12
-3
UBGraphicsTriangle.h
src/tools/UBGraphicsTriangle.h
+1
-0
No files found.
JournalDesModifications.pdf
View file @
558f2d47
No preview for this file type
ReleaseNotes.pdf
View file @
558f2d47
No preview for this file type
Sankore_3.1.pro
View file @
558f2d47
...
@@ -11,7 +11,7 @@ CONFIG += debug_and_release \
...
@@ -11,7 +11,7 @@ CONFIG += debug_and_release \
VERSION_MAJ
=
2
VERSION_MAJ
=
2
VERSION_MIN
=
00
VERSION_MIN
=
00
VERSION_TYPE
=
b
#
a
=
alpha
,
b
=
beta
,
r
=
release
,
other
=>
error
VERSION_TYPE
=
b
#
a
=
alpha
,
b
=
beta
,
r
=
release
,
other
=>
error
VERSION_PATCH
=
0
2
VERSION_PATCH
=
0
3
VERSION
=
"$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}"
VERSION
=
"$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}"
VERSION
=
$$
replace
(
VERSION
,
"\\.r"
,
""
)
VERSION
=
$$
replace
(
VERSION
,
"\\.r"
,
""
)
...
...
resources/style.qss
View file @
558f2d47
...
@@ -5,15 +5,21 @@ QWidget#UBLibNavigatorWidget,
...
@@ -5,15 +5,21 @@ QWidget#UBLibNavigatorWidget,
QWidget#UBLibItemProperties,
QWidget#UBLibItemProperties,
QWidget#UBDownloadWidget,
QWidget#UBDownloadWidget,
QWidget#UBTeacherGuideWidget,
QWidget#UBTeacherGuideWidget,
QWidget#UBFeatureProperties,
QWidget#UBFeaturesNavigatorWidget,
QWidget#UBFeaturesNavigatorWidget,
QWidget#PathList
QWidget#PathList,
QWidget#UBFeaturesCentralWidget
{
{
background: #EEEEEE;
background: #EEEEEE;
border-radius: 10px;
border-radius: 10px;
border: 2px solid #999999;
border: 2px solid #999999;
}
}
QWidget#mAdditionalDataContainer
{
border-radius: 10px;
border: 2px solid #999999;
}
QWidget#UBMediaVideoContainer
QWidget#UBMediaVideoContainer
{
{
background: #000000;
background: #000000;
...
@@ -33,12 +39,9 @@ QListView
...
@@ -33,12 +39,9 @@ QListView
border: 0px;
border: 0px;
}
}
QWidget#UBFeatureProperties
QWidget#UBFeaturesWebView
{
{
background: #EEEEEE;
border: 2px;
border-radius : 10px;
border: 2px solid #999999;
}
}
QWebView#SearchEngineView
QWebView#SearchEngineView
...
...
src/board/UBBoardController.cpp
View file @
558f2d47
...
@@ -53,6 +53,7 @@
...
@@ -53,6 +53,7 @@
#include "domain/UBGraphicsTextItem.h"
#include "domain/UBGraphicsTextItem.h"
#include "domain/UBPageSizeUndoCommand.h"
#include "domain/UBPageSizeUndoCommand.h"
#include "domain/UBGraphicsGroupContainerItem.h"
#include "domain/UBGraphicsGroupContainerItem.h"
#include "domain/UBItem.h"
#include "tools/UBToolsManager.h"
#include "tools/UBToolsManager.h"
...
@@ -529,6 +530,92 @@ void UBBoardController::duplicateScene()
...
@@ -529,6 +530,92 @@ void UBBoardController::duplicateScene()
duplicateScene
(
mActiveSceneIndex
);
duplicateScene
(
mActiveSceneIndex
);
}
}
void
UBBoardController
::
duplicateItem
(
UBItem
*
item
)
{
if
(
!
item
)
return
;
QUrl
sourceUrl
;
QByteArray
pData
;
//common parameters for any item
QPointF
itemPos
;
QSizeF
itemSize
;
QGraphicsItem
*
commonItem
=
dynamic_cast
<
QGraphicsItem
*>
(
item
);
if
(
commonItem
)
{
itemPos
=
commonItem
->
pos
();
itemSize
=
commonItem
->
boundingRect
().
size
();
}
QString
contentTypeHeader
=
UBFileSystemUtils
::
mimeTypeFromFileName
(
item
->
sourceUrl
().
toLocalFile
());
UBMimeType
::
Enum
itemMimeType
=
UBFileSystemUtils
::
mimeTypeFromString
(
contentTypeHeader
);
switch
(
static_cast
<
int
>
(
itemMimeType
))
{
case
UBMimeType
:
:
AppleWidget
:
case
UBMimeType
:
:
W3CWidget
:
{
UBGraphicsWidgetItem
*
witem
=
dynamic_cast
<
UBGraphicsWidgetItem
*>
(
item
);
if
(
witem
)
{
sourceUrl
=
witem
->
getOwnFolder
();
}
}
break
;
case
UBMimeType
:
:
Video
:
case
UBMimeType
:
:
Audio
:
{
UBGraphicsMediaItem
*
mitem
=
dynamic_cast
<
UBGraphicsMediaItem
*>
(
item
);
if
(
mitem
)
{
sourceUrl
=
mitem
->
mediaFileUrl
();
}
}
break
;
case
UBMimeType
:
:
VectorImage
:
{
UBGraphicsSvgItem
*
viitem
=
dynamic_cast
<
UBGraphicsSvgItem
*>
(
item
);
if
(
viitem
)
{
pData
=
viitem
->
fileData
();
sourceUrl
=
item
->
sourceUrl
();
}
}
break
;
case
UBMimeType
:
:
RasterImage
:
{
UBGraphicsPixmapItem
*
pixitem
=
dynamic_cast
<
UBGraphicsPixmapItem
*>
(
item
);
if
(
pixitem
)
{
QBuffer
buffer
(
&
pData
);
buffer
.
open
(
QIODevice
::
WriteOnly
);
QString
format
=
UBFileSystemUtils
::
extension
(
item
->
sourceUrl
().
toLocalFile
());
pixitem
->
pixmap
().
save
(
&
buffer
,
format
.
toLatin1
());
}
}
break
;
case
UBMimeType
:
:
UNKNOWN
:
{
QGraphicsItem
*
gitem
=
dynamic_cast
<
QGraphicsItem
*>
(
item
->
deepCopy
());
if
(
gitem
)
{
mActiveScene
->
addItem
(
gitem
);
gitem
->
setPos
(
itemPos
);
}
return
;
}
break
;
}
UBItem
*
createdItem
=
downloadFinished
(
true
,
sourceUrl
,
contentTypeHeader
,
pData
,
itemPos
,
QSize
(
itemSize
.
width
(),
itemSize
.
height
()),
false
);
if
(
createdItem
)
{
createdItem
->
setSourceUrl
(
item
->
sourceUrl
());
item
->
copyItemParameters
(
createdItem
);
}
}
void
UBBoardController
::
deleteScene
(
int
nIndex
)
void
UBBoardController
::
deleteScene
(
int
nIndex
)
{
{
if
(
selectedDocument
()
->
pageCount
()
>
2
)
if
(
selectedDocument
()
->
pageCount
()
>
2
)
...
@@ -854,7 +941,7 @@ void UBBoardController::downloadURL(const QUrl& url, const QPointF& pPos, const
...
@@ -854,7 +941,7 @@ void UBBoardController::downloadURL(const QUrl& url, const QPointF& pPos, const
}
}
void
UBBoardController
::
downloadFinished
(
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pContentTypeHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
)
UBItem
*
UBBoardController
::
downloadFinished
(
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pContentTypeHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
)
{
{
QString
mimeType
=
pContentTypeHeader
;
QString
mimeType
=
pContentTypeHeader
;
...
@@ -869,7 +956,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
...
@@ -869,7 +956,7 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
if
(
!
pSuccess
)
if
(
!
pSuccess
)
{
{
UBApplication
::
showMessage
(
tr
(
"Downloading content %1 failed"
).
arg
(
sourceUrl
.
toString
()));
UBApplication
::
showMessage
(
tr
(
"Downloading content %1 failed"
).
arg
(
sourceUrl
.
toString
()));
return
;
return
NULL
;
}
}
if
(
!
sourceUrl
.
toString
().
startsWith
(
"file://"
)
&&
!
sourceUrl
.
toString
().
startsWith
(
"uniboardTool://"
))
if
(
!
sourceUrl
.
toString
().
startsWith
(
"file://"
)
&&
!
sourceUrl
.
toString
().
startsWith
(
"uniboardTool://"
))
...
@@ -897,12 +984,14 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
...
@@ -897,12 +984,14 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
pixItem
->
setSelected
(
true
);
pixItem
->
setSelected
(
true
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
}
}
return
pixItem
;
}
}
else
if
(
UBMimeType
::
VectorImage
==
itemMimeType
)
else
if
(
UBMimeType
::
VectorImage
==
itemMimeType
)
{
{
qDebug
()
<<
"accepting mime type"
<<
mimeType
<<
"as vecto image"
;
qDebug
()
<<
"accepting mime type"
<<
mimeType
<<
"as vecto image"
;
UBGraphicsSvgItem
*
svgItem
=
mActiveScene
->
addSvg
(
sourceUrl
,
pPos
);
UBGraphicsSvgItem
*
svgItem
=
mActiveScene
->
addSvg
(
sourceUrl
,
pPos
,
pData
);
svgItem
->
setSourceUrl
(
sourceUrl
);
svgItem
->
setSourceUrl
(
sourceUrl
);
if
(
isBackground
)
if
(
isBackground
)
...
@@ -915,6 +1004,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
...
@@ -915,6 +1004,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
svgItem
->
setSelected
(
true
);
svgItem
->
setSelected
(
true
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
}
}
return
svgItem
;
}
}
else
if
(
UBMimeType
::
AppleWidget
==
itemMimeType
)
//mime type invented by us :-(
else
if
(
UBMimeType
::
AppleWidget
==
itemMimeType
)
//mime type invented by us :-(
{
{
...
@@ -939,6 +1030,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
...
@@ -939,6 +1030,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
{
{
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
}
}
return
appleWidgetItem
;
}
}
else
if
(
UBMimeType
::
W3CWidget
==
itemMimeType
)
else
if
(
UBMimeType
::
W3CWidget
==
itemMimeType
)
{
{
...
@@ -960,6 +1053,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
...
@@ -960,6 +1053,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
{
{
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
}
}
return
w3cWidgetItem
;
}
}
else
if
(
UBMimeType
::
Video
==
itemMimeType
)
else
if
(
UBMimeType
::
Video
==
itemMimeType
)
{
{
...
@@ -989,6 +1084,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
...
@@ -989,6 +1084,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
}
}
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
return
mediaVideoItem
;
}
}
else
if
(
UBMimeType
::
Audio
==
itemMimeType
)
else
if
(
UBMimeType
::
Audio
==
itemMimeType
)
{
{
...
@@ -1018,6 +1115,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
...
@@ -1018,6 +1115,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
}
}
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
return
audioMediaItem
;
}
}
else
if
(
UBMimeType
::
Flash
==
itemMimeType
)
else
if
(
UBMimeType
::
Flash
==
itemMimeType
)
...
@@ -1061,6 +1160,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
...
@@ -1061,6 +1160,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
widgetItem
->
setSourceUrl
(
sourceUrl
);
widgetItem
->
setSourceUrl
(
sourceUrl
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
return
widgetItem
;
}
}
if
(
eduMediaFile
)
if
(
eduMediaFile
)
...
@@ -1182,6 +1283,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
...
@@ -1182,6 +1283,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
widgetItem
->
setSourceUrl
(
sourceUrl
);
widgetItem
->
setSourceUrl
(
sourceUrl
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
UBDrawingController
::
drawingController
()
->
setStylusTool
(
UBStylusTool
::
Selector
);
return
widgetItem
;
}
}
}
}
}
}
...
@@ -1193,6 +1296,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
...
@@ -1193,6 +1296,8 @@ void UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QString
UBApplication
::
showMessage
(
tr
(
"Unknown content type %1"
).
arg
(
pContentTypeHeader
));
UBApplication
::
showMessage
(
tr
(
"Unknown content type %1"
).
arg
(
pContentTypeHeader
));
qWarning
()
<<
"ignoring mime type"
<<
pContentTypeHeader
;
qWarning
()
<<
"ignoring mime type"
<<
pContentTypeHeader
;
}
}
return
NULL
;
}
}
void
UBBoardController
::
setActiveDocumentScene
(
int
pSceneIndex
)
void
UBBoardController
::
setActiveDocumentScene
(
int
pSceneIndex
)
...
@@ -1902,7 +2007,7 @@ UBGraphicsWidgetItem *UBBoardController::addW3cWidget(const QUrl &pUrl, const QP
...
@@ -1902,7 +2007,7 @@ UBGraphicsWidgetItem *UBBoardController::addW3cWidget(const QUrl &pUrl, const QP
}
}
return
0
;
return
w3cWidgetItem
;
}
}
void
UBBoardController
::
cut
()
void
UBBoardController
::
cut
()
...
@@ -1957,7 +2062,11 @@ void UBBoardController::copy()
...
@@ -1957,7 +2062,11 @@ void UBBoardController::copy()
UBItem
*
ubItem
=
dynamic_cast
<
UBItem
*>
(
gi
);
UBItem
*
ubItem
=
dynamic_cast
<
UBItem
*>
(
gi
);
if
(
ubItem
&&
!
mActiveScene
->
tools
().
contains
(
gi
))
if
(
ubItem
&&
!
mActiveScene
->
tools
().
contains
(
gi
))
selected
<<
ubItem
->
deepCopy
();
{
UBItem
*
itemCopy
=
ubItem
->
deepCopy
();
if
(
itemCopy
)
selected
<<
itemCopy
;
}
}
}
if
(
selected
.
size
()
>
0
)
if
(
selected
.
size
()
>
0
)
...
@@ -2014,13 +2123,7 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
...
@@ -2014,13 +2123,7 @@ void UBBoardController::processMimeData(const QMimeData* pMimeData, const QPoint
{
{
foreach
(
UBItem
*
item
,
mimeData
->
items
())
foreach
(
UBItem
*
item
,
mimeData
->
items
())
{
{
QGraphicsItem
*
gi
=
dynamic_cast
<
QGraphicsItem
*>
(
item
->
deepCopy
());
duplicateItem
(
item
);
if
(
gi
)
{
mActiveScene
->
addItem
(
gi
);
gi
->
setPos
(
gi
->
pos
()
+
QPointF
(
50
,
50
));
}
}
}
return
;
return
;
...
...
src/board/UBBoardController.h
View file @
558f2d47
...
@@ -39,6 +39,7 @@ class UBGraphicsVideoItem;
...
@@ -39,6 +39,7 @@ class UBGraphicsVideoItem;
class
UBGraphicsAudioItem
;
class
UBGraphicsAudioItem
;
class
UBGraphicsWidgetItem
;
class
UBGraphicsWidgetItem
;
class
UBBoardPaletteManager
;
class
UBBoardPaletteManager
;
class
UBItem
;
class
UBBoardController
:
public
UBDocumentContainer
class
UBBoardController
:
public
UBDocumentContainer
...
@@ -157,6 +158,7 @@ class UBBoardController : public UBDocumentContainer
...
@@ -157,6 +158,7 @@ class UBBoardController : public UBDocumentContainer
void
moveSceneToIndex
(
int
source
,
int
target
);
void
moveSceneToIndex
(
int
source
,
int
target
);
void
duplicateScene
(
int
index
);
void
duplicateScene
(
int
index
);
void
duplicateItem
(
UBItem
*
item
);
void
deleteScene
(
int
index
);
void
deleteScene
(
int
index
);
bool
cacheIsVisible
()
{
return
mCacheWidgetIsEnabled
;}
bool
cacheIsVisible
()
{
return
mCacheWidgetIsEnabled
;}
...
@@ -188,7 +190,7 @@ class UBBoardController : public UBDocumentContainer
...
@@ -188,7 +190,7 @@ class UBBoardController : public UBDocumentContainer
void
lastScene
();
void
lastScene
();
void
groupButtonClicked
();
void
groupButtonClicked
();
void
downloadURL
(
const
QUrl
&
url
,
const
QPointF
&
pPos
=
QPointF
(
0
.
0
,
0
.
0
),
const
QSize
&
pSize
=
QSize
(),
bool
isBackground
=
false
);
void
downloadURL
(
const
QUrl
&
url
,
const
QPointF
&
pPos
=
QPointF
(
0
.
0
,
0
.
0
),
const
QSize
&
pSize
=
QSize
(),
bool
isBackground
=
false
);
void
downloadFinished
(
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
=
false
);
UBItem
*
downloadFinished
(
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
=
false
);
void
changeBackground
(
bool
isDark
,
bool
isCrossed
);
void
changeBackground
(
bool
isDark
,
bool
isCrossed
);
void
setToolCursor
(
int
tool
);
void
setToolCursor
(
int
tool
);
void
showMessage
(
const
QString
&
message
,
bool
showSpinningWheel
);
void
showMessage
(
const
QString
&
message
,
bool
showSpinningWheel
);
...
...
src/board/UBBoardPaletteManager.cpp
View file @
558f2d47
...
@@ -665,11 +665,8 @@ void UBBoardPaletteManager::addItem(const QUrl& pUrl)
...
@@ -665,11 +665,8 @@ void UBBoardPaletteManager::addItem(const QUrl& pUrl)
mAddItemPalette
->
show
();
mAddItemPalette
->
show
();
mAddItemPalette
->
adjustSizeAndPosition
();
mAddItemPalette
->
adjustSizeAndPosition
();
QRect
controlGeo
=
UBApplication
::
applicationController
->
displayManager
()
->
controlGeometry
();
mAddItemPalette
->
move
((
mContainer
->
width
()
-
mAddItemPalette
->
width
())
/
2
,
(
mContainer
->
height
()
-
mAddItemPalette
->
height
())
/
5
);
mAddItemPalette
->
move
(
controlGeo
.
x
()
+
((
controlGeo
.
width
()
-
mAddItemPalette
->
geometry
().
width
())
/
2
),
(
controlGeo
.
y
()
+
(
controlGeo
.
height
()
-
mAddItemPalette
->
geometry
().
height
())
/
5
));
}
}
void
UBBoardPaletteManager
::
changeMode
(
eUBDockPaletteWidgetMode
newMode
,
bool
isInit
)
void
UBBoardPaletteManager
::
changeMode
(
eUBDockPaletteWidgetMode
newMode
,
bool
isInit
)
...
@@ -835,13 +832,11 @@ void UBBoardPaletteManager::addItem(const QPixmap& pPixmap, const QPointF& pos,
...
@@ -835,13 +832,11 @@ void UBBoardPaletteManager::addItem(const QPixmap& pPixmap, const QPointF& pos,
mPos
=
pos
;
mPos
=
pos
;
mScaleFactor
=
scaleFactor
;
mScaleFactor
=
scaleFactor
;
QRect
controlGeo
=
UBApplication
::
applicationController
->
displayManager
()
->
controlGeometry
();
mAddItemPalette
->
show
();
mAddItemPalette
->
show
();
mAddItemPalette
->
adjustSizeAndPosition
();
mAddItemPalette
->
adjustSizeAndPosition
();
mAddItemPalette
->
move
(
controlGeo
.
x
()
+
((
controlGeo
.
width
()
-
mAddItemPalette
->
geometry
().
width
())
/
2
)
,
mAddItemPalette
->
move
(
(
mContainer
->
width
()
-
mAddItemPalette
->
width
())
/
2
,
(
controlGeo
.
y
()
+
(
controlGeo
.
height
()
-
mAddItemPalette
->
geometry
().
height
())
/
5
)
);
(
mContainer
->
height
()
-
mAddItemPalette
->
height
())
/
5
);
}
}
...
...
src/board/UBFeaturesController.cpp
View file @
558f2d47
This diff is collapsed.
Click to expand it.
src/board/UBFeaturesController.h
View file @
558f2d47
...
@@ -12,6 +12,10 @@
...
@@ -12,6 +12,10 @@
#include <QUrl>
#include <QUrl>
#include <QByteArray>
#include <QByteArray>
#include <QtGui>
#include <QtGui>
#include <QImage>
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
class
UBFeaturesModel
;
class
UBFeaturesModel
;
class
UBFeaturesItemDelegate
;
class
UBFeaturesItemDelegate
;
...
@@ -20,8 +24,45 @@ class UBFeaturesProxyModel;
...
@@ -20,8 +24,45 @@ class UBFeaturesProxyModel;
class
UBFeaturesSearchProxyModel
;
class
UBFeaturesSearchProxyModel
;
class
UBFeaturesPathProxyModel
;
class
UBFeaturesPathProxyModel
;
class
UBFeaturesListView
;
class
UBFeaturesListView
;
class
UBFeature
;
class
UBFeaturesComputingThread
:
public
QThread
{
Q_OBJECT
public
:
explicit
UBFeaturesComputingThread
(
QObject
*
parent
=
0
);
virtual
~
UBFeaturesComputingThread
();
void
compute
(
const
QList
<
QPair
<
QUrl
,
QString
>
>
&
pScanningData
);
protected
:
void
run
();
signals
:
void
sendFeature
(
UBFeature
pFeature
);
void
featureSent
();
void
scanStarted
();
void
scanFinished
();
void
maxFilesCountEvaluated
(
int
max
);
public
slots
:
private
:
void
scanFS
(
const
QUrl
&
currentPath
,
const
QString
&
currVirtualPath
);
void
scanAll
(
QList
<
QPair
<
QUrl
,
QString
>
>
pScanningData
);
int
featuresCount
(
const
QUrl
&
pPath
);
int
featuresCountAll
(
QList
<
QPair
<
QUrl
,
QString
>
>
pScanningData
);
private
:
QMutex
mMutex
;
QWaitCondition
mWaitCondition
;
QUrl
mScanningPath
;
QString
mScanningVirtualPath
;
QList
<
QPair
<
QUrl
,
QString
>
>
mScanningData
;
bool
restart
;
bool
abort
;
};
//#include "UBDockPaletteWidget.h"
enum
UBFeatureElementType
enum
UBFeatureElementType
{
{
...
@@ -41,12 +82,12 @@ class UBFeature
...
@@ -41,12 +82,12 @@ class UBFeature
{
{
public
:
public
:
UBFeature
()
{;}
UBFeature
()
{;}
//
UBFeature(const UBFeature &f);
//
UBFeature(const UBFeature &f);
UBFeature
(
const
QString
&
url
,
const
Q
Pixmap
&
icon
,
const
QString
&
name
,
const
QUrl
&
realPath
,
UBFeatureElementType
type
=
FEATURE_CATEGORY
);
UBFeature
(
const
QString
&
url
,
const
Q
Image
&
icon
,
const
QString
&
name
,
const
QUrl
&
realPath
,
UBFeatureElementType
type
=
FEATURE_CATEGORY
);
// UBFeature();
// UBFeature();
virtual
~
UBFeature
();
virtual
~
UBFeature
();
QString
getName
()
const
{
return
mName
;
}
QString
getName
()
const
{
return
mName
;
}
Q
Pixmap
getThumbnail
()
const
{
return
mThumbnail
;}
Q
Image
getThumbnail
()
const
{
return
mThumbnail
;}
QString
getVirtualPath
()
const
{
return
virtualDir
;
}
QString
getVirtualPath
()
const
{
return
virtualDir
;
}
//QString getPath() const { return mPath; };
//QString getPath() const { return mPath; };
QUrl
getFullPath
()
const
{
return
mPath
;
}
QUrl
getFullPath
()
const
{
return
mPath
;
}
...
@@ -64,20 +105,13 @@ public:
...
@@ -64,20 +105,13 @@ public:
const
QMap
<
QString
,
QString
>
&
getMetadata
()
const
{
return
metadata
;
}
const
QMap
<
QString
,
QString
>
&
getMetadata
()
const
{
return
metadata
;
}
void
setMetadata
(
const
QMap
<
QString
,
QString
>
&
data
)
{
metadata
=
data
;
}
void
setMetadata
(
const
QMap
<
QString
,
QString
>
&
data
)
{
metadata
=
data
;
}
bool
hasChildren
()
const
{
return
mChildren
.
count
();}
bool
hasParents
()
const
{
return
mParents
.
count
();}
bool
hasRelationships
()
const
{
return
mChildren
.
count
()
&&
mParents
.
count
();}
private
:
private
:
QString
virtualDir
;
QString
virtualDir
;
Q
Pixmap
mThumbnail
;
Q
Image
mThumbnail
;
QString
mName
;
QString
mName
;
QUrl
mPath
;
QUrl
mPath
;
UBFeatureElementType
elementType
;
UBFeatureElementType
elementType
;
QMap
<
QString
,
QString
>
metadata
;
QMap
<
QString
,
QString
>
metadata
;
QList
<
UBFeature
*>
mChildren
;
QList
<
UBFeature
*>
mParents
;
};
};
Q_DECLARE_METATYPE
(
UBFeature
)
Q_DECLARE_METATYPE
(
UBFeature
)
...
@@ -111,7 +145,7 @@ public:
...
@@ -111,7 +145,7 @@ public:
void
rescanModel
();
void
rescanModel
();
void
siftElements
(
const
QString
&
pSiftValue
);
void
siftElements
(
const
QString
&
pSiftValue
);
//TODO make less complicated for betteer maintainence
//TODO make less complicated for betteer maintainence
UBFeature
getFeature
(
const
QModelIndex
&
index
,
QListView
*
pOnView
);
UBFeature
getFeature
(
const
QModelIndex
&
index
,
const
QString
&
listName
);
void
searchStarted
(
const
QString
&
pattern
,
QListView
*
pOnView
);
void
searchStarted
(
const
QString
&
pattern
,
QListView
*
pOnView
);
void
refreshModels
();
void
refreshModels
();
...
@@ -119,18 +153,18 @@ public:
...
@@ -119,18 +153,18 @@ public:
void
deleteItem
(
const
UBFeature
&
pFeature
);
void
deleteItem
(
const
UBFeature
&
pFeature
);
bool
isTrash
(
const
QUrl
&
url
);
bool
isTrash
(
const
QUrl
&
url
);
void
moveToTrash
(
UBFeature
feature
,
bool
deleteManualy
=
false
);
void
moveToTrash
(
UBFeature
feature
,
bool
deleteManualy
=
false
);
void
addNewFolder
(
const
QString
&
name
);
void
addToFavorite
(
const
QUrl
&
path
);
void
addToFavorite
(
const
QUrl
&
path
);
void
removeFromFavorite
(
const
QUrl
&
path
,
bool
deleteManualy
=
false
);
void
removeFromFavorite
(
const
QUrl
&
path
,
bool
deleteManualy
=
false
);
void
importImage
(
const
QImage
&
image
,
const
QString
&
fileName
=
QString
());
void
importImage
(
const
QImage
&
image
,
const
QString
&
fileName
=
QString
());
void
importImage
(
const
QImage
&
image
,
const
UBFeature
&
destination
,
const
QString
&
fileName
=
QString
()
);
void
importImage
(
const
QImage
&
image
,
const
UBFeature
&
destination
,
const
QString
&
fileName
=
QString
()
);
QStringList
getFileNamesInFolders
();
void
fileSystemScan
(
const
QUrl
&
currPath
,
const
QString
&
currVirtualPath
);
void
fileSystemScan
(
const
QUrl
&
currPath
,
const
QString
&
currVirtualPath
);
int
featuresCount
(
const
QUrl
&
currPath
);
static
UBFeatureElementType
fileTypeFromUrl
(
const
QString
&
path
);
static
UBFeatureElementType
fileTypeFromUrl
(
const
QString
&
path
);
static
QString
fileNameFromUrl
(
const
QUrl
&
url
);
static
QString
fileNameFromUrl
(
const
QUrl
&
url
);
static
Q
Pixmap
getIcon
(
const
QString
&
path
,
UBFeatureElementType
pFType
);
static
Q
Image
getIcon
(
const
QString
&
path
,
UBFeatureElementType
pFType
);
static
bool
isDeletable
(
const
QUrl
&
url
);
static
bool
isDeletable
(
const
QUrl
&
url
);
static
char
featureTypeSplitter
()
{
return
':'
;}
static
char
featureTypeSplitter
()
{
return
':'
;}
...
@@ -139,6 +173,16 @@ public:
...
@@ -139,6 +173,16 @@ public:
void
assignFeaturesListVeiw
(
UBFeaturesListView
*
pList
);
void
assignFeaturesListVeiw
(
UBFeaturesListView
*
pList
);
void
assignPathListView
(
UBFeaturesListView
*
pList
);
void
assignPathListView
(
UBFeaturesListView
*
pList
);
signals
:
void
maxFilesCountEvaluated
(
int
pLimit
);
void
scanStarted
();
void
scanFinished
();
void
featureAddedFromThread
();
private
slots
:
void
addNewFolder
(
QString
name
);
void
startThread
();
private
:
private
:
UBFeaturesItemDelegate
*
itemDelegate
;
UBFeaturesItemDelegate
*
itemDelegate
;
...
@@ -149,16 +193,16 @@ private:
...
@@ -149,16 +193,16 @@ private:
UBFeaturesSearchProxyModel
*
featuresSearchModel
;
UBFeaturesSearchProxyModel
*
featuresSearchModel
;
UBFeaturesPathProxyModel
*
featuresPathModel
;
UBFeaturesPathProxyModel
*
featuresPathModel
;
QAbstractItemModel
*
curListModel
;
UBFeaturesComputingThread
mCThread
;
private
:
private
:
static
Q
Pixmap
createThumbnail
(
const
QString
&
path
);
static
Q
Image
createThumbnail
(
const
QString
&
path
);
//void addImageToCurrentPage( const QString &path );
//void addImageToCurrentPage( const QString &path );
void
loadFavoriteList
();
void
loadFavoriteList
();
void
saveFavoriteList
();
void
saveFavoriteList
();
QList
<
UBFeature
>
*
featuresList
;
QList
<
UBFeature
>
*
featuresList
;
QUrl
mUserAudioDirectoryPath
;
QUrl
mUserAudioDirectoryPath
;
...
...
src/domain/UBGraphicsGroupContainerItem.cpp
View file @
558f2d47
...
@@ -157,18 +157,29 @@ UBGraphicsGroupContainerItem *UBGraphicsGroupContainerItem::deepCopy() const
...
@@ -157,18 +157,29 @@ UBGraphicsGroupContainerItem *UBGraphicsGroupContainerItem::deepCopy() const
UBGraphicsGroupContainerItem
*
copy
=
new
UBGraphicsGroupContainerItem
(
parentItem
());
UBGraphicsGroupContainerItem
*
copy
=
new
UBGraphicsGroupContainerItem
(
parentItem
());
copy
->
setPos
(
this
->
pos
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
copy
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
this
->
data
(
UBGraphicsItemData
::
ItemLocked
));
copy
->
setUuid
(
this
->
uuid
());
// this is OK for now as long as Widgets are imutable
copy
->
setUuid
(
this
->
uuid
());
// this is OK for now as long as Widgets are imutable
copyItemParameters
(
copy
);
// copy->resize(this->size());
// copy->resize(this->size());
return
copy
;
return
copy
;
}
}
void
UBGraphicsGroupContainerItem
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsGroupContainerItem
*
cp
=
dynamic_cast
<
UBGraphicsGroupContainerItem
*>
(
copy
);
if
(
cp
)
{
cp
->
setPos
(
this
->
pos
());
cp
->
setTransform
(
this
->
transform
());
cp
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
cp
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
cp
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
cp
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
this
->
data
(
UBGraphicsItemData
::
ItemLocked
));
}
}
void
UBGraphicsGroupContainerItem
::
remove
()
void
UBGraphicsGroupContainerItem
::
remove
()
{
{
if
(
mDelegate
)
if
(
mDelegate
)
...
...
src/domain/UBGraphicsGroupContainerItem.h
View file @
558f2d47
...
@@ -24,6 +24,8 @@ public:
...
@@ -24,6 +24,8 @@ public:
virtual
UBGraphicsScene
*
scene
();
virtual
UBGraphicsScene
*
scene
();
virtual
UBGraphicsGroupContainerItem
*
deepCopy
()
const
;
virtual
UBGraphicsGroupContainerItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
virtual
void
remove
();
virtual
void
remove
();
enum
{
Type
=
UBGraphicsItemType
::
groupContainerType
};
enum
{
Type
=
UBGraphicsItemType
::
groupContainerType
};
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
558f2d47
...
@@ -410,6 +410,7 @@ void UBGraphicsItemDelegate::duplicate()
...
@@ -410,6 +410,7 @@ void UBGraphicsItemDelegate::duplicate()
UBApplication
::
boardController
->
copy
();
UBApplication
::
boardController
->
copy
();
UBApplication
::
boardController
->
paste
();
UBApplication
::
boardController
->
paste
();
UBApplication
::
boardController
->
duplicateItem
(
dynamic_cast
<
UBItem
*>
(
delegated
()));
}
}
void
UBGraphicsItemDelegate
::
increaseZLevelUp
()
void
UBGraphicsItemDelegate
::
increaseZLevelUp
()
...
@@ -727,7 +728,11 @@ void UBGraphicsToolBarItem::paint(QPainter *painter, const QStyleOptionGraphicsI
...
@@ -727,7 +728,11 @@ void UBGraphicsToolBarItem::paint(QPainter *painter, const QStyleOptionGraphicsI
}
}
MediaTimer
::
MediaTimer
(
QGraphicsItem
*
parent
)
:
QGraphicsRectItem
(
parent
)
MediaTimer
::
MediaTimer
(
QGraphicsItem
*
parent
)
:
QGraphicsRectItem
(
parent
)
{}
{
val
=
0
;
smallPoint
=
false
;
setNumDigits
(
4
);
}
MediaTimer
::~
MediaTimer
()
MediaTimer
::~
MediaTimer
()
{}
{}
...
@@ -810,9 +815,7 @@ void MediaTimer::drawDigit(const QPoint &pos, QPainter &p, int segLen,
...
@@ -810,9 +815,7 @@ void MediaTimer::drawDigit(const QPoint &pos, QPainter &p, int segLen,
}
}
}
}
char
*
MediaTimer
::
getSegments
(
char
ch
)
// gets list of segments for ch
char
MediaTimer
::
segments
[][
8
]
=
{
char
segments
[
30
][
8
]
=
{
{
{
0
,
1
,
2
,
4
,
5
,
6
,
99
,
0
},
// 0 0
{
0
,
1
,
2
,
4
,
5
,
6
,
99
,
0
},
// 0 0
{
2
,
5
,
99
,
0
,
0
,
0
,
0
,
0
},
// 1 1
{
2
,
5
,
99
,
0
,
0
,
0
,
0
,
0
},
// 1 1
...
@@ -828,15 +831,16 @@ char* MediaTimer::getSegments(char ch) // gets list of segments fo
...
@@ -828,15 +831,16 @@ char* MediaTimer::getSegments(char ch) // gets list of segments fo
{
99
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}
// 11 empty
{
99
,
0
,
0
,
0
,
0
,
0
,
0
,
0
}
// 11 empty
};
};
int
n
;
const
char
*
MediaTimer
::
getSegments
(
char
ch
)
// gets list of segments for ch
{
if
(
ch
>=
'0'
&&
ch
<=
'9'
)
if
(
ch
>=
'0'
&&
ch
<=
'9'
)
return
segments
[
ch
-
'0'
];
return
segments
[
ch
-
'0'
];
if
(
ch
==
':'
)
if
(
ch
==
':'
)
n
=
10
;
return
segments
[
10
]
;
if
(
ch
==
' '
)
if
(
ch
==
' '
)
n
=
11
;
return
segments
[
11
]
;
return
segments
[
n
]
;
return
NULL
;
}
}
void
MediaTimer
::
drawSegment
(
const
QPoint
&
pos
,
char
segmentNo
,
QPainter
&
p
,
void
MediaTimer
::
drawSegment
(
const
QPoint
&
pos
,
char
segmentNo
,
QPainter
&
p
,
...
@@ -1058,13 +1062,6 @@ void MediaTimer::internalSetString(const QString& s)
...
@@ -1058,13 +1062,6 @@ void MediaTimer::internalSetString(const QString& s)
update
();
update
();
}
}
void
MediaTimer
::
init
()
{
val
=
0
;
smallPoint
=
false
;
setNumDigits
(
4
);
}
void
MediaTimer
::
display
(
const
QString
&
s
)
void
MediaTimer
::
display
(
const
QString
&
s
)
{
{
val
=
0
;
val
=
0
;
...
@@ -1132,7 +1129,6 @@ DelegateMediaControl::DelegateMediaControl(UBGraphicsMediaItem* pDelegated, QGra
...
@@ -1132,7 +1129,6 @@ DelegateMediaControl::DelegateMediaControl(UBGraphicsMediaItem* pDelegated, QGra
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Control
));
setData
(
UBGraphicsItemData
::
ItemLayerType
,
QVariant
(
UBItemLayerType
::
Control
));
lcdTimer
=
new
MediaTimer
(
this
);
lcdTimer
=
new
MediaTimer
(
this
);
lcdTimer
->
init
();
update
();
update
();
}
}
...
@@ -1185,6 +1181,8 @@ void DelegateMediaControl::positionHandles()
...
@@ -1185,6 +1181,8 @@ void DelegateMediaControl::positionHandles()
mLCDTimerArea
.
setHeight
(
parentItem
()
->
boundingRect
().
height
());
mLCDTimerArea
.
setHeight
(
parentItem
()
->
boundingRect
().
height
());
lcdTimer
->
setRect
(
mLCDTimerArea
);
lcdTimer
->
setRect
(
mLCDTimerArea
);
lcdTimer
->
setPos
(
mSeecArea
.
width
()
-
mLCDTimerArea
.
width
(),
0
);
lcdTimer
->
setPos
(
mSeecArea
.
width
()
-
mLCDTimerArea
.
width
(),
0
);
//lcdTimer->setRect(mLCDTimerArea);
//lcdTimer->setPos(mSeecArea.width()-mLCDTimerArea.width(),0);
mSeecArea
.
setWidth
(
rect
().
width
()
-
mLCDTimerArea
.
width
());
mSeecArea
.
setWidth
(
rect
().
width
()
-
mLCDTimerArea
.
width
());
...
@@ -1193,6 +1191,7 @@ void DelegateMediaControl::positionHandles()
...
@@ -1193,6 +1191,7 @@ void DelegateMediaControl::positionHandles()
setRect
(
selfRect
);
setRect
(
selfRect
);
lcdTimer
->
setPos
(
rect
().
width
()
-
mLCDTimerArea
.
width
(),
0
);
lcdTimer
->
setPos
(
rect
().
width
()
-
mLCDTimerArea
.
width
(),
0
);
//lcdTimer->setPos(rect().width() - mLCDTimerArea.width(), 0);
}
}
...
@@ -1201,6 +1200,7 @@ void DelegateMediaControl::update()
...
@@ -1201,6 +1200,7 @@ void DelegateMediaControl::update()
QTime
t
;
QTime
t
;
t
=
t
.
addMSecs
(
mCurrentTimeInMs
<
0
?
0
:
mCurrentTimeInMs
);
t
=
t
.
addMSecs
(
mCurrentTimeInMs
<
0
?
0
:
mCurrentTimeInMs
);
lcdTimer
->
display
(
t
.
toString
(
"m:ss"
));
lcdTimer
->
display
(
t
.
toString
(
"m:ss"
));
//lcdTimer->display(t.toString("m:ss"));
QGraphicsRectItem
::
update
();
QGraphicsRectItem
::
update
();
}
}
...
@@ -1253,6 +1253,7 @@ void DelegateMediaControl::seekToMousePos(QPointF mousePos)
...
@@ -1253,6 +1253,7 @@ void DelegateMediaControl::seekToMousePos(QPointF mousePos)
minX
=
frameWidth
;
minX
=
frameWidth
;
length
=
mSeecArea
.
width
()
-
lcdTimer
->
rect
().
width
();
length
=
mSeecArea
.
width
()
-
lcdTimer
->
rect
().
width
();
length
=
mSeecArea
.
width
()
/*- lcdTimer->rect().width()*/
;
qreal
mouseX
=
mousePos
.
x
();
qreal
mouseX
=
mousePos
.
x
();
if
(
mouseX
>=
(
mSeecArea
.
width
()
-
mSeecArea
.
height
()
/
2
))
if
(
mouseX
>=
(
mSeecArea
.
width
()
-
mSeecArea
.
height
()
/
2
))
...
...
src/domain/UBGraphicsItemDelegate.h
View file @
558f2d47
...
@@ -71,33 +71,40 @@ class DelegateButton: public QGraphicsSvgItem
...
@@ -71,33 +71,40 @@ class DelegateButton: public QGraphicsSvgItem
};
};
/*
Code of this class is copied from QT QLCDNumber class sources
See src\gui\widgets\qlcdnumber.cpp for original code
*/
class
MediaTimer
:
public
QGraphicsRectItem
class
MediaTimer
:
public
QGraphicsRectItem
{
{
public
:
public
:
MediaTimer
(
QGraphicsItem
*
parent
=
0
);
MediaTimer
(
QGraphicsItem
*
parent
=
0
);
~
MediaTimer
();
~
MediaTimer
();
char
*
getSegments
(
char
);
void
addPoint
(
QPolygon
&
,
const
QPoint
&
);
void
init
();
void
internalSetString
(
const
QString
&
s
);
void
drawString
(
const
QString
&
s
,
QPainter
&
,
QBitArray
*
=
0
,
bool
=
true
);
void
drawDigit
(
const
QPoint
&
,
QPainter
&
,
int
,
char
,
char
=
' '
);
void
drawSegment
(
const
QPoint
&
,
char
,
QPainter
&
,
int
,
bool
=
false
);
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
QWidget
*
widget
);
void
display
(
const
QString
&
str
);
void
display
(
const
QString
&
str
);
void
setNumDigits
(
int
nDigits
);
private
:
private
:
static
const
char
*
getSegments
(
char
);
void
drawString
(
const
QString
&
s
,
QPainter
&
,
QBitArray
*
=
0
,
bool
=
true
);
void
drawDigit
(
const
QPoint
&
,
QPainter
&
,
int
,
char
,
char
=
' '
);
void
drawSegment
(
const
QPoint
&
,
char
,
QPainter
&
,
int
,
bool
=
false
);
void
addPoint
(
QPolygon
&
,
const
QPoint
&
);
void
internalSetString
(
const
QString
&
s
);
void
setNumDigits
(
int
nDigits
);
static
char
segments
[][
8
];
int
ndigits
;
int
ndigits
;
QString
digitStr
;
QString
digitStr
;
QBitArray
points
;
QBitArray
points
;
double
val
;
double
val
;
uint
shadow
:
1
;
uint
shadow
:
1
;
uint
smallPoint
:
1
;
uint
smallPoint
:
1
;
};
};
class
DelegateMediaControl
:
public
QObject
,
public
QGraphicsRectItem
class
DelegateMediaControl
:
public
QObject
,
public
QGraphicsRectItem
...
...
src/domain/UBGraphicsMediaItem.cpp
View file @
558f2d47
...
@@ -241,26 +241,34 @@ void UBGraphicsMediaItem::showOnDisplayChanged(bool shown)
...
@@ -241,26 +241,34 @@ void UBGraphicsMediaItem::showOnDisplayChanged(bool shown)
UBItem
*
UBGraphicsMediaItem
::
deepCopy
()
const
UBItem
*
UBGraphicsMediaItem
::
deepCopy
()
const
{
{
QUrl
url
=
this
->
mediaFileUrl
();
QUrl
url
=
this
->
mediaFileUrl
();
UBGraphicsMediaItem
*
copy
;
UBGraphicsMediaItem
*
copy
=
new
UBGraphicsMediaItem
(
url
,
parentItem
())
;
copy
=
new
UBGraphicsMediaItem
(
url
,
parentItem
());
copy
->
setUuid
(
this
->
uuid
());
// this is OK for now as long as Widgets are imutable
copy
->
setPos
(
this
->
pos
());
copyItemParameters
(
copy
);
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
copy
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
this
->
data
(
UBGraphicsItemData
::
ItemLocked
));
copy
->
setUuid
(
this
->
uuid
());
// this is OK as long as Videos are imutable
copy
->
setSourceUrl
(
this
->
sourceUrl
());
copy
->
resize
(
this
->
size
());
connect
(
UBApplication
::
boardController
,
SIGNAL
(
activeSceneChanged
()),
copy
,
SLOT
(
activeSceneChanged
()));
// TODO UB 4.7 complete all members
return
copy
;
return
copy
;
}
}
void
UBGraphicsMediaItem
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsMediaItem
*
cp
=
dynamic_cast
<
UBGraphicsMediaItem
*>
(
copy
);
if
(
cp
)
{
cp
->
setPos
(
this
->
pos
());
cp
->
setTransform
(
this
->
transform
());
cp
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
cp
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
cp
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
cp
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
this
->
data
(
UBGraphicsItemData
::
ItemLocked
));
cp
->
setSourceUrl
(
this
->
sourceUrl
());
cp
->
resize
(
this
->
size
());
connect
(
UBApplication
::
boardController
,
SIGNAL
(
activeSceneChanged
()),
cp
,
SLOT
(
activeSceneChanged
()));
// TODO UB 4.7 complete all members
}
}
void
UBGraphicsMediaItem
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
void
UBGraphicsMediaItem
::
mousePressEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
{
if
(
mDelegate
)
if
(
mDelegate
)
...
...
src/domain/UBGraphicsMediaItem.h
View file @
558f2d47
...
@@ -95,6 +95,8 @@ public:
...
@@ -95,6 +95,8 @@ public:
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
virtual
void
setSourceUrl
(
const
QUrl
&
pSourceUrl
)
virtual
void
setSourceUrl
(
const
QUrl
&
pSourceUrl
)
{
{
UBAudioPresentationWidget
*
pAudioWidget
=
dynamic_cast
<
UBAudioPresentationWidget
*>
(
mAudioWidget
);
UBAudioPresentationWidget
*
pAudioWidget
=
dynamic_cast
<
UBAudioPresentationWidget
*>
(
mAudioWidget
);
...
...
src/domain/UBGraphicsPDFItem.cpp
View file @
558f2d47
...
@@ -89,17 +89,26 @@ UBItem* UBGraphicsPDFItem::deepCopy() const
...
@@ -89,17 +89,26 @@ UBItem* UBGraphicsPDFItem::deepCopy() const
{
{
UBGraphicsPDFItem
*
copy
=
new
UBGraphicsPDFItem
(
mRenderer
,
mPageNumber
,
parentItem
());
UBGraphicsPDFItem
*
copy
=
new
UBGraphicsPDFItem
(
mRenderer
,
mPageNumber
,
parentItem
());
copy
->
setPos
(
this
->
pos
());
copy
->
setUuid
(
this
->
uuid
());
// this is OK for now as long as Widgets are imutable
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copyItemParameters
(
copy
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
copy
->
setUuid
(
this
->
uuid
());
// this is OK for now as long as PDF are imutable
copy
->
setSourceUrl
(
this
->
sourceUrl
());
return
copy
;
return
copy
;
}
}
void
UBGraphicsPDFItem
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsPDFItem
*
cp
=
dynamic_cast
<
UBGraphicsPDFItem
*>
(
copy
);
if
(
cp
)
{
cp
->
setPos
(
this
->
pos
());
cp
->
setTransform
(
this
->
transform
());
cp
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
cp
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
cp
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
cp
->
setSourceUrl
(
this
->
sourceUrl
());
}
}
void
UBGraphicsPDFItem
::
setRenderingQuality
(
RenderingQuality
pRenderingQuality
)
void
UBGraphicsPDFItem
::
setRenderingQuality
(
RenderingQuality
pRenderingQuality
)
{
{
...
...
src/domain/UBGraphicsPDFItem.h
View file @
558f2d47
...
@@ -41,6 +41,8 @@ class UBGraphicsPDFItem: public GraphicsPDFItem, public UBItem, public UBGraphic
...
@@ -41,6 +41,8 @@ class UBGraphicsPDFItem: public GraphicsPDFItem, public UBItem, public UBGraphic
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
virtual
void
setRenderingQuality
(
RenderingQuality
pRenderingQuality
);
virtual
void
setRenderingQuality
(
RenderingQuality
pRenderingQuality
);
virtual
UBGraphicsScene
*
scene
();
virtual
UBGraphicsScene
*
scene
();
...
...
src/domain/UBGraphicsPixmapItem.cpp
View file @
558f2d47
...
@@ -114,22 +114,30 @@ UBItem* UBGraphicsPixmapItem::deepCopy() const
...
@@ -114,22 +114,30 @@ UBItem* UBGraphicsPixmapItem::deepCopy() const
{
{
UBGraphicsPixmapItem
*
copy
=
new
UBGraphicsPixmapItem
();
UBGraphicsPixmapItem
*
copy
=
new
UBGraphicsPixmapItem
();
copy
->
setPixmap
(
this
->
pixmap
());
copy
->
setUuid
(
this
->
uuid
());
// this is OK for now as long as Widgets are imutable
copy
->
setPos
(
this
->
pos
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
copy
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
this
->
data
(
UBGraphicsItemData
::
ItemLocked
));
copy
->
setUuid
(
this
->
uuid
());
// This is OK for now, as long as pixmaps are immutable -
copyItemParameters
(
copy
);
copy
->
setSourceUrl
(
this
->
sourceUrl
());
// TODO UB 4.7 ... complete all members ?
// TODO UB 4.7 ... complete all members ?
return
copy
;
return
copy
;
}
}
void
UBGraphicsPixmapItem
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsPixmapItem
*
cp
=
dynamic_cast
<
UBGraphicsPixmapItem
*>
(
copy
);
if
(
cp
)
{
cp
->
setPixmap
(
this
->
pixmap
());
cp
->
setPos
(
this
->
pos
());
cp
->
setTransform
(
this
->
transform
());
cp
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
cp
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
cp
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
cp
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
this
->
data
(
UBGraphicsItemData
::
ItemLocked
));
cp
->
setSourceUrl
(
this
->
sourceUrl
());
}
}
UBGraphicsScene
*
UBGraphicsPixmapItem
::
scene
()
UBGraphicsScene
*
UBGraphicsPixmapItem
::
scene
()
{
{
...
...
src/domain/UBGraphicsPixmapItem.h
View file @
558f2d47
...
@@ -40,6 +40,8 @@ class UBGraphicsPixmapItem : public QObject, public QGraphicsPixmapItem, public
...
@@ -40,6 +40,8 @@ class UBGraphicsPixmapItem : public QObject, public QGraphicsPixmapItem, public
}
}
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
virtual
UBGraphicsScene
*
scene
();
virtual
UBGraphicsScene
*
scene
();
virtual
void
remove
();
virtual
void
remove
();
...
...
src/domain/UBGraphicsPolygonItem.cpp
View file @
558f2d47
...
@@ -156,29 +156,37 @@ UBGraphicsPolygonItem* UBGraphicsPolygonItem::deepCopy(const QPolygonF& pol) con
...
@@ -156,29 +156,37 @@ UBGraphicsPolygonItem* UBGraphicsPolygonItem::deepCopy(const QPolygonF& pol) con
{
{
UBGraphicsPolygonItem
*
copy
=
new
UBGraphicsPolygonItem
(
pol
);
UBGraphicsPolygonItem
*
copy
=
new
UBGraphicsPolygonItem
(
pol
);
copy
->
mOriginalLine
=
QLineF
();
copyItemParameters
(
copy
);
copy
->
mOriginalWidth
=
-
1
;
copy
->
mIsNominalLine
=
false
;
copy
->
setStroke
(
this
->
stroke
());
// TODO UB 4.7 ... complete all members ?
copy
->
setStrokesGroup
(
this
->
strokesGroup
());
copy
->
setBrush
(
this
->
brush
());
copy
->
setPen
(
this
->
pen
());
copy
->
mHasAlpha
=
this
->
mHasAlpha
;
return
copy
;
copy
->
setColorOnDarkBackground
(
this
->
colorOnDarkBackground
());
}
copy
->
setColorOnLightBackground
(
this
->
colorOnLightBackground
());
void
UBGraphicsPolygonItem
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsPolygonItem
*
cp
=
dynamic_cast
<
UBGraphicsPolygonItem
*>
(
copy
);
if
(
cp
)
{
cp
->
mOriginalLine
=
QLineF
();
cp
->
mOriginalWidth
=
-
1
;
cp
->
mIsNominalLine
=
false
;
copy
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
cp
->
setStroke
(
this
->
stroke
());
cp
->
setStrokesGroup
(
this
->
strokesGroup
());
cp
->
setBrush
(
this
->
brush
());
cp
->
setPen
(
this
->
pen
());
cp
->
mHasAlpha
=
this
->
mHasAlpha
;
// TODO UB 4.7 ... complete all members ?
return
copy
;
cp
->
setColorOnDarkBackground
(
this
->
colorOnDarkBackground
());
cp
->
setColorOnLightBackground
(
this
->
colorOnLightBackground
());
cp
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
}
}
}
void
UBGraphicsPolygonItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
void
UBGraphicsPolygonItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
{
{
if
(
mHasAlpha
&&
scene
()
&&
scene
()
->
isLightBackground
())
if
(
mHasAlpha
&&
scene
()
&&
scene
()
->
isLightBackground
())
...
...
src/domain/UBGraphicsPolygonItem.h
View file @
558f2d47
...
@@ -88,6 +88,7 @@ class UBGraphicsPolygonItem : public QGraphicsPolygonItem, public UBItem
...
@@ -88,6 +88,7 @@ class UBGraphicsPolygonItem : public QGraphicsPolygonItem, public UBItem
// optimisation (eraser)
// optimisation (eraser)
UBGraphicsPolygonItem
*
deepCopy
(
const
QPolygonF
&
pol
)
const
;
UBGraphicsPolygonItem
*
deepCopy
(
const
QPolygonF
&
pol
)
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
QLineF
originalLine
()
{
return
mOriginalLine
;}
QLineF
originalLine
()
{
return
mOriginalLine
;}
qreal
originalWidth
()
{
return
mOriginalWidth
;}
qreal
originalWidth
()
{
return
mOriginalWidth
;}
...
...
src/domain/UBGraphicsScene.cpp
View file @
558f2d47
...
@@ -1539,11 +1539,15 @@ void UBGraphicsScene::addGroup(UBGraphicsGroupContainerItem *groupItem)
...
@@ -1539,11 +1539,15 @@ void UBGraphicsScene::addGroup(UBGraphicsGroupContainerItem *groupItem)
setDocumentUpdated
();
setDocumentUpdated
();
}
}
UBGraphicsSvgItem
*
UBGraphicsScene
::
addSvg
(
const
QUrl
&
pSvgFileUrl
,
const
QPointF
&
pPos
)
UBGraphicsSvgItem
*
UBGraphicsScene
::
addSvg
(
const
QUrl
&
pSvgFileUrl
,
const
QPointF
&
pPos
,
const
QByteArray
pData
)
{
{
QString
path
=
pSvgFileUrl
.
toLocalFile
();
QString
path
=
pSvgFileUrl
.
toLocalFile
();
UBGraphicsSvgItem
*
svgItem
=
new
UBGraphicsSvgItem
(
path
);
UBGraphicsSvgItem
*
svgItem
;
if
(
pData
.
isNull
())
svgItem
=
new
UBGraphicsSvgItem
(
path
);
else
svgItem
=
new
UBGraphicsSvgItem
(
pData
);
svgItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
svgItem
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
svgItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
svgItem
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
...
...
src/domain/UBGraphicsScene.h
View file @
558f2d47
...
@@ -109,6 +109,8 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
...
@@ -109,6 +109,8 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
{
Q_UNUSED
(
copy
);}
UBGraphicsScene
*
sceneDeepCopy
()
const
;
UBGraphicsScene
*
sceneDeepCopy
()
const
;
void
clearItemsAndAnnotations
();
void
clearItemsAndAnnotations
();
...
@@ -136,7 +138,7 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
...
@@ -136,7 +138,7 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
UBGraphicsMediaItem
*
addMedia
(
const
QUrl
&
pMediaFileUrl
,
bool
shouldPlayAsap
,
const
QPointF
&
pPos
=
QPointF
(
0
,
0
));
UBGraphicsMediaItem
*
addMedia
(
const
QUrl
&
pMediaFileUrl
,
bool
shouldPlayAsap
,
const
QPointF
&
pPos
=
QPointF
(
0
,
0
));
UBGraphicsMediaItem
*
addVideo
(
const
QUrl
&
pVideoFileUrl
,
bool
shouldPlayAsap
,
const
QPointF
&
pPos
=
QPointF
(
0
,
0
));
UBGraphicsMediaItem
*
addVideo
(
const
QUrl
&
pVideoFileUrl
,
bool
shouldPlayAsap
,
const
QPointF
&
pPos
=
QPointF
(
0
,
0
));
UBGraphicsMediaItem
*
addAudio
(
const
QUrl
&
pAudioFileUrl
,
bool
shouldPlayAsap
,
const
QPointF
&
pPos
=
QPointF
(
0
,
0
));
UBGraphicsMediaItem
*
addAudio
(
const
QUrl
&
pAudioFileUrl
,
bool
shouldPlayAsap
,
const
QPointF
&
pPos
=
QPointF
(
0
,
0
));
UBGraphicsSvgItem
*
addSvg
(
const
QUrl
&
pSvgFileUrl
,
const
QPointF
&
pPos
=
QPointF
(
0
,
0
));
UBGraphicsSvgItem
*
addSvg
(
const
QUrl
&
pSvgFileUrl
,
const
QPointF
&
pPos
=
QPointF
(
0
,
0
)
,
const
QByteArray
pData
=
QByteArray
()
);
UBGraphicsTextItem
*
addText
(
const
QString
&
pString
,
const
QPointF
&
pTopLeft
=
QPointF
(
0
,
0
));
UBGraphicsTextItem
*
addText
(
const
QString
&
pString
,
const
QPointF
&
pTopLeft
=
QPointF
(
0
,
0
));
UBGraphicsTextItem
*
textForObjectName
(
const
QString
&
pString
,
const
QString
&
objectName
=
"UBTGZeroPageSessionTitle"
);
UBGraphicsTextItem
*
textForObjectName
(
const
QString
&
pString
,
const
QString
&
objectName
=
"UBTGZeroPageSessionTitle"
);
...
...
src/domain/UBGraphicsStrokesGroup.cpp
View file @
558f2d47
...
@@ -63,16 +63,25 @@ UBItem* UBGraphicsStrokesGroup::deepCopy() const
...
@@ -63,16 +63,25 @@ UBItem* UBGraphicsStrokesGroup::deepCopy() const
{
{
UBGraphicsStrokesGroup
*
copy
=
new
UBGraphicsStrokesGroup
();
UBGraphicsStrokesGroup
*
copy
=
new
UBGraphicsStrokesGroup
();
copy
->
setPos
(
this
->
pos
());
copyItemParameters
(
copy
);
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
copy
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
this
->
data
(
UBGraphicsItemData
::
ItemLocked
));
return
copy
;
return
copy
;
}
}
void
UBGraphicsStrokesGroup
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsStrokesGroup
*
cp
=
dynamic_cast
<
UBGraphicsStrokesGroup
*>
(
copy
);
{
cp
->
setPos
(
this
->
pos
());
cp
->
setTransform
(
this
->
transform
());
cp
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
cp
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
cp
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
cp
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
this
->
data
(
UBGraphicsItemData
::
ItemLocked
));
}
}
void
UBGraphicsStrokesGroup
::
remove
()
void
UBGraphicsStrokesGroup
::
remove
()
{
{
if
(
mDelegate
)
if
(
mDelegate
)
...
...
src/domain/UBGraphicsStrokesGroup.h
View file @
558f2d47
...
@@ -14,6 +14,7 @@ public:
...
@@ -14,6 +14,7 @@ public:
UBGraphicsStrokesGroup
(
QGraphicsItem
*
parent
=
0
);
UBGraphicsStrokesGroup
(
QGraphicsItem
*
parent
=
0
);
~
UBGraphicsStrokesGroup
();
~
UBGraphicsStrokesGroup
();
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
virtual
void
remove
();
virtual
void
remove
();
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
{
return
mDelegate
;}
enum
{
Type
=
UBGraphicsItemType
::
StrokeItemType
};
enum
{
Type
=
UBGraphicsItemType
::
StrokeItemType
};
...
...
src/domain/UBGraphicsSvgItem.cpp
View file @
558f2d47
...
@@ -135,14 +135,9 @@ UBItem* UBGraphicsSvgItem::deepCopy() const
...
@@ -135,14 +135,9 @@ UBItem* UBGraphicsSvgItem::deepCopy() const
{
{
UBGraphicsSvgItem
*
copy
=
new
UBGraphicsSvgItem
(
this
->
fileData
());
UBGraphicsSvgItem
*
copy
=
new
UBGraphicsSvgItem
(
this
->
fileData
());
copy
->
setPos
(
this
->
pos
());
copy
->
setUuid
(
this
->
uuid
());
// this is OK for now as long as Widgets are imutable
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copyItemParameters
(
copy
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
copy
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
this
->
data
(
UBGraphicsItemData
::
ItemLocked
));
copy
->
setUuid
(
this
->
uuid
());
// this is OK for now as long as SVG are imutable
copy
->
setSourceUrl
(
this
->
sourceUrl
());
// TODO UB 4.7... complete all members ?
// TODO UB 4.7... complete all members ?
...
@@ -150,6 +145,20 @@ UBItem* UBGraphicsSvgItem::deepCopy() const
...
@@ -150,6 +145,20 @@ UBItem* UBGraphicsSvgItem::deepCopy() const
}
}
void
UBGraphicsSvgItem
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsSvgItem
*
cp
=
dynamic_cast
<
UBGraphicsSvgItem
*>
(
copy
);
if
(
cp
)
{
cp
->
setPos
(
this
->
pos
());
cp
->
setTransform
(
this
->
transform
());
cp
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
cp
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
cp
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
cp
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
this
->
data
(
UBGraphicsItemData
::
ItemLocked
));
cp
->
setSourceUrl
(
this
->
sourceUrl
());
}
}
void
UBGraphicsSvgItem
::
setRenderingQuality
(
RenderingQuality
pRenderingQuality
)
void
UBGraphicsSvgItem
::
setRenderingQuality
(
RenderingQuality
pRenderingQuality
)
{
{
...
...
src/domain/UBGraphicsSvgItem.h
View file @
558f2d47
...
@@ -52,6 +52,8 @@ class UBGraphicsSvgItem: public QGraphicsSvgItem, public UBItem, public UBGraphi
...
@@ -52,6 +52,8 @@ class UBGraphicsSvgItem: public QGraphicsSvgItem, public UBItem, public UBGraphi
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
virtual
void
setRenderingQuality
(
RenderingQuality
pRenderingQuality
);
virtual
void
setRenderingQuality
(
RenderingQuality
pRenderingQuality
);
virtual
UBGraphicsScene
*
scene
();
virtual
UBGraphicsScene
*
scene
();
...
...
src/domain/UBGraphicsTextItem.cpp
View file @
558f2d47
...
@@ -201,28 +201,36 @@ UBItem* UBGraphicsTextItem::deepCopy() const
...
@@ -201,28 +201,36 @@ UBItem* UBGraphicsTextItem::deepCopy() const
{
{
UBGraphicsTextItem
*
copy
=
new
UBGraphicsTextItem
();
UBGraphicsTextItem
*
copy
=
new
UBGraphicsTextItem
();
copy
->
setHtml
(
toHtml
());
copyItemParameters
(
copy
);
copy
->
setPos
(
this
->
pos
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
copy
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
this
->
data
(
UBGraphicsItemData
::
ItemLocked
));
copy
->
setData
(
UBGraphicsItemData
::
ItemEditable
,
data
(
UBGraphicsItemData
::
ItemEditable
).
toBool
());
// copy->setDefaultTextColor(this->defaultTextColor());
// copy->setFont(this->font());
// copy->setColorOnDarkBackground(this->colorOnDarkBackground());
// copy->setColorOnLightBackground(this->colorOnLightBackground());
copy
->
setTextWidth
(
this
->
textWidth
());
copy
->
setTextHeight
(
this
->
textHeight
());
copy
->
setSourceUrl
(
this
->
sourceUrl
());
// TODO UB 4.7 ... complete all members ?
// TODO UB 4.7 ... complete all members ?
return
copy
;
return
copy
;
}
}
void
UBGraphicsTextItem
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsTextItem
*
cp
=
dynamic_cast
<
UBGraphicsTextItem
*>
(
copy
);
if
(
cp
)
{
cp
->
setHtml
(
toHtml
());
cp
->
setPos
(
this
->
pos
());
cp
->
setTransform
(
this
->
transform
());
cp
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
cp
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
cp
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
cp
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
this
->
data
(
UBGraphicsItemData
::
ItemLocked
));
cp
->
setData
(
UBGraphicsItemData
::
ItemEditable
,
data
(
UBGraphicsItemData
::
ItemEditable
).
toBool
());
// cp->setDefaultTextColor(this->defaultTextColor());
// cp->setFont(this->font());
// cp->setColorOnDarkBackground(this->colorOnDarkBackground());
// cp->setColorOnLightBackground(this->colorOnLightBackground());
cp
->
setTextWidth
(
this
->
textWidth
());
cp
->
setTextHeight
(
this
->
textHeight
());
cp
->
setSourceUrl
(
this
->
sourceUrl
());
}
}
QRectF
UBGraphicsTextItem
::
boundingRect
()
const
QRectF
UBGraphicsTextItem
::
boundingRect
()
const
{
{
...
...
src/domain/UBGraphicsTextItem.h
View file @
558f2d47
...
@@ -40,6 +40,9 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes
...
@@ -40,6 +40,9 @@ class UBGraphicsTextItem : public QGraphicsTextItem, public UBItem, public UBRes
}
}
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
virtual
UBGraphicsScene
*
scene
();
virtual
UBGraphicsScene
*
scene
();
virtual
QRectF
boundingRect
()
const
;
virtual
QRectF
boundingRect
()
const
;
...
...
src/domain/UBGraphicsWidgetItem.cpp
View file @
558f2d47
...
@@ -330,19 +330,29 @@ UBItem* UBGraphicsAppleWidgetItem::deepCopy() const
...
@@ -330,19 +330,29 @@ UBItem* UBGraphicsAppleWidgetItem::deepCopy() const
{
{
UBGraphicsAppleWidgetItem
*
appleWidget
=
new
UBGraphicsAppleWidgetItem
(
mWebKitWidget
->
widgetUrl
(),
parentItem
());
UBGraphicsAppleWidgetItem
*
appleWidget
=
new
UBGraphicsAppleWidgetItem
(
mWebKitWidget
->
widgetUrl
(),
parentItem
());
copyItemParameters
(
appleWidget
);
return
appleWidget
;
}
void
UBGraphicsAppleWidgetItem
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsAppleWidgetItem
*
cp
=
dynamic_cast
<
UBGraphicsAppleWidgetItem
*>
(
copy
);
if
(
cp
)
{
foreach
(
QString
key
,
mPreferences
.
keys
())
foreach
(
QString
key
,
mPreferences
.
keys
())
{
{
appleWidget
->
setPreference
(
key
,
mPreferences
.
value
(
key
));
cp
->
setPreference
(
key
,
mPreferences
.
value
(
key
));
}
}
foreach
(
QString
key
,
mDatastore
.
keys
())
foreach
(
QString
key
,
mDatastore
.
keys
())
{
{
appleWidget
->
setDatastoreEntry
(
key
,
mDatastore
.
value
(
key
));
cp
->
setDatastoreEntry
(
key
,
mDatastore
.
value
(
key
));
}
}
appleWidget
->
setSourceUrl
(
this
->
sourceUrl
());
cp
->
setSourceUrl
(
this
->
sourceUrl
());
}
return
appleWidget
;
}
}
void
UBGraphicsAppleWidgetItem
::
setUuid
(
const
QUuid
&
pUuid
)
void
UBGraphicsAppleWidgetItem
::
setUuid
(
const
QUuid
&
pUuid
)
...
@@ -431,27 +441,35 @@ UBW3CWidget* UBGraphicsW3CWidgetItem::w3cWidget() const
...
@@ -431,27 +441,35 @@ UBW3CWidget* UBGraphicsW3CWidgetItem::w3cWidget() const
UBItem
*
UBGraphicsW3CWidgetItem
::
deepCopy
()
const
UBItem
*
UBGraphicsW3CWidgetItem
::
deepCopy
()
const
{
{
UBGraphicsW3CWidgetItem
*
copy
=
new
UBGraphicsW3CWidgetItem
(
mWebKitWidget
->
widgetUrl
(),
parentItem
());
UBGraphicsW3CWidgetItem
*
copy
=
new
UBGraphicsW3CWidgetItem
(
mWebKitWidget
->
widgetUrl
(),
parentItem
());
copy
->
setPos
(
this
->
pos
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
copy
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
this
->
data
(
UBGraphicsItemData
::
ItemLocked
));
copy
->
setUuid
(
this
->
uuid
());
// this is OK for now as long as Widgets are imutable
copy
->
setUuid
(
this
->
uuid
());
// this is OK for now as long as Widgets are imutable
copy
->
setSourceUrl
(
this
->
sourceUrl
());
copyItemParameters
(
copy
);
return
copy
;
}
void
UBGraphicsW3CWidgetItem
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsW3CWidgetItem
*
cp
=
dynamic_cast
<
UBGraphicsW3CWidgetItem
*>
(
copy
);
if
(
cp
)
{
cp
->
setPos
(
this
->
pos
());
cp
->
setTransform
(
this
->
transform
());
cp
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
cp
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
cp
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
cp
->
setData
(
UBGraphicsItemData
::
ItemLocked
,
this
->
data
(
UBGraphicsItemData
::
ItemLocked
));
cp
->
setSourceUrl
(
this
->
sourceUrl
());
copy
->
resize
(
this
->
size
());
cp
->
resize
(
this
->
size
());
foreach
(
QString
key
,
mPreferences
.
keys
())
foreach
(
QString
key
,
mPreferences
.
keys
())
{
{
copy
->
setPreference
(
key
,
mPreferences
.
value
(
key
));
cp
->
setPreference
(
key
,
mPreferences
.
value
(
key
));
}
}
foreach
(
QString
key
,
mDatastore
.
keys
())
foreach
(
QString
key
,
mDatastore
.
keys
())
{
{
copy
->
setDatastoreEntry
(
key
,
mDatastore
.
value
(
key
));
cp
->
setDatastoreEntry
(
key
,
mDatastore
.
value
(
key
));
}
}
}
return
copy
;
}
}
\ No newline at end of file
src/domain/UBGraphicsWidgetItem.h
View file @
558f2d47
...
@@ -130,6 +130,9 @@ class UBGraphicsAppleWidgetItem : public UBGraphicsWidgetItem
...
@@ -130,6 +130,9 @@ class UBGraphicsAppleWidgetItem : public UBGraphicsWidgetItem
}
}
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
virtual
void
setUuid
(
const
QUuid
&
pUuid
);
virtual
void
setUuid
(
const
QUuid
&
pUuid
);
};
};
...
@@ -152,6 +155,8 @@ class UBGraphicsW3CWidgetItem : public UBGraphicsWidgetItem
...
@@ -152,6 +155,8 @@ class UBGraphicsW3CWidgetItem : public UBGraphicsWidgetItem
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
UBW3CWidget
::
Metadata
metadatas
()
const
;
UBW3CWidget
::
Metadata
metadatas
()
const
;
UBW3CWidget
*
w3cWidget
()
const
;
UBW3CWidget
*
w3cWidget
()
const
;
...
...
src/domain/UBItem.h
View file @
558f2d47
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "core/UB.h"
#include "core/UB.h"
class
UBGraphicsScene
;
class
UBGraphicsScene
;
class
UBGraphicsItem
;
class
UBItem
class
UBItem
{
{
...
@@ -58,6 +59,8 @@ class UBItem
...
@@ -58,6 +59,8 @@ class UBItem
virtual
UBItem
*
deepCopy
()
const
=
0
;
virtual
UBItem
*
deepCopy
()
const
=
0
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
=
0
;
virtual
UBGraphicsScene
*
scene
()
// TODO UB 4.x should be pure virtual ...
virtual
UBGraphicsScene
*
scene
()
// TODO UB 4.x should be pure virtual ...
{
{
return
0
;
return
0
;
...
...
src/gui/UBFeaturesActionBar.cpp
View file @
558f2d47
...
@@ -53,6 +53,7 @@ UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWid
...
@@ -53,6 +53,7 @@ UBFeaturesActionBar::UBFeaturesActionBar( UBFeaturesController *controller, QWid
//mpSearchBtn = new UBActionButton(this, mpSearchAction);
//mpSearchBtn = new UBActionButton(this, mpSearchAction);
mpRescanModelBtn
=
new
UBActionButton
(
this
,
mpRescanModelAction
);
mpRescanModelBtn
=
new
UBActionButton
(
this
,
mpRescanModelAction
);
mpRescanModelBtn
->
hide
();
mpDeleteBtn
=
new
UBActionButton
(
this
,
mpDeleteAction
);
mpDeleteBtn
=
new
UBActionButton
(
this
,
mpDeleteAction
);
mpCloseBtn
=
new
UBActionButton
(
this
,
mpCloseAction
);
mpCloseBtn
=
new
UBActionButton
(
this
,
mpCloseAction
);
...
@@ -124,7 +125,7 @@ void UBFeaturesActionBar::setButtons()
...
@@ -124,7 +125,7 @@ void UBFeaturesActionBar::setButtons()
mpNewFolderBtn
->
show
();
mpNewFolderBtn
->
show
();
mpNewFolderBtn
->
setEnabled
(
true
);
mpNewFolderBtn
->
setEnabled
(
true
);
mpDeleteBtn
->
setEnabled
(
true
);
mpDeleteBtn
->
setEnabled
(
true
);
mpRescanModelBtn
->
show
();
//
mpRescanModelBtn->show();
break
;
break
;
case
IN_ROOT
:
case
IN_ROOT
:
mpFavoriteBtn
->
show
();
mpFavoriteBtn
->
show
();
...
@@ -136,7 +137,7 @@ void UBFeaturesActionBar::setButtons()
...
@@ -136,7 +137,7 @@ void UBFeaturesActionBar::setButtons()
mpNewFolderBtn
->
show
();
mpNewFolderBtn
->
show
();
mpNewFolderBtn
->
setEnabled
(
false
);
mpNewFolderBtn
->
setEnabled
(
false
);
mpDeleteBtn
->
setEnabled
(
false
);
mpDeleteBtn
->
setEnabled
(
false
);
mpRescanModelBtn
->
show
();
//
mpRescanModelBtn->show();
break
;
break
;
case
IN_PROPERTIES
:
case
IN_PROPERTIES
:
mpFavoriteBtn
->
show
();
mpFavoriteBtn
->
show
();
...
@@ -147,7 +148,7 @@ void UBFeaturesActionBar::setButtons()
...
@@ -147,7 +148,7 @@ void UBFeaturesActionBar::setButtons()
mpCloseBtn
->
hide
();
mpCloseBtn
->
hide
();
mpRemoveFavoriteBtn
->
hide
();
mpRemoveFavoriteBtn
->
hide
();
mpNewFolderBtn
->
hide
();
mpNewFolderBtn
->
hide
();
mpRescanModelBtn
->
hide
();
//
mpRescanModelBtn->hide();
break
;
break
;
case
IN_FAVORITE
:
case
IN_FAVORITE
:
mpFavoriteBtn
->
hide
();
mpFavoriteBtn
->
hide
();
...
@@ -158,7 +159,7 @@ void UBFeaturesActionBar::setButtons()
...
@@ -158,7 +159,7 @@ void UBFeaturesActionBar::setButtons()
mpCloseBtn
->
hide
();
mpCloseBtn
->
hide
();
mpRemoveFavoriteBtn
->
show
();
mpRemoveFavoriteBtn
->
show
();
mpNewFolderBtn
->
hide
();
mpNewFolderBtn
->
hide
();
mpRescanModelBtn
->
hide
();
//
mpRescanModelBtn->hide();
break
;
break
;
case
IN_TRASH
:
case
IN_TRASH
:
mpFavoriteBtn
->
hide
();
mpFavoriteBtn
->
hide
();
...
@@ -171,7 +172,7 @@ void UBFeaturesActionBar::setButtons()
...
@@ -171,7 +172,7 @@ void UBFeaturesActionBar::setButtons()
mpCloseBtn
->
hide
();
mpCloseBtn
->
hide
();
//mpRemoveFavoriteBtn->show();
//mpRemoveFavoriteBtn->show();
mpNewFolderBtn
->
hide
();
mpNewFolderBtn
->
hide
();
mpRescanModelBtn
->
hide
();
//
mpRescanModelBtn->hide();
break
;
break
;
default
:
default
:
break
;
break
;
...
@@ -208,6 +209,16 @@ void UBFeaturesActionBar::onActionRescanModel()
...
@@ -208,6 +209,16 @@ void UBFeaturesActionBar::onActionRescanModel()
emit
rescanModel
();
emit
rescanModel
();
}
}
void
UBFeaturesActionBar
::
lockIt
()
{
setEnabled
(
false
);
}
void
UBFeaturesActionBar
::
unlockIt
()
{
setEnabled
(
true
);
}
void
UBFeaturesActionBar
::
dragEnterEvent
(
QDragEnterEvent
*
event
)
void
UBFeaturesActionBar
::
dragEnterEvent
(
QDragEnterEvent
*
event
)
{
{
const
UBFeaturesMimeData
*
fMimeData
=
qobject_cast
<
const
UBFeaturesMimeData
*>
(
event
->
mimeData
());
const
UBFeaturesMimeData
*
fMimeData
=
qobject_cast
<
const
UBFeaturesMimeData
*>
(
event
->
mimeData
());
...
...
src/gui/UBFeaturesActionBar.h
View file @
558f2d47
...
@@ -45,6 +45,8 @@ private slots:
...
@@ -45,6 +45,8 @@ private slots:
void
onActionRemoveFavorite
();
void
onActionRemoveFavorite
();
void
onActionTrash
();
void
onActionTrash
();
void
onActionRescanModel
();
void
onActionRescanModel
();
void
lockIt
();
void
unlockIt
();
protected
:
protected
:
void
dragEnterEvent
(
QDragEnterEvent
*
event
);
void
dragEnterEvent
(
QDragEnterEvent
*
event
);
...
...
src/gui/UBFeaturesWidget.cpp
View file @
558f2d47
This diff is collapsed.
Click to expand it.
src/gui/UBFeaturesWidget.h
View file @
558f2d47
...
@@ -43,6 +43,8 @@ class UBFeaturesListView;
...
@@ -43,6 +43,8 @@ class UBFeaturesListView;
class
UBFeaturesWebView
;
class
UBFeaturesWebView
;
class
UBFeaturesNavigatorWidget
;
class
UBFeaturesNavigatorWidget
;
class
UBFeaturesMimeData
;
class
UBFeaturesMimeData
;
class
UBFeaturesCentralWidget
;
class
UBFeaturesNewFolderDialog
;
class
UBFeaturesWidget
:
public
UBDockPaletteWidget
class
UBFeaturesWidget
:
public
UBDockPaletteWidget
{
{
...
@@ -63,10 +65,16 @@ public:
...
@@ -63,10 +65,16 @@ public:
static
const
int
maxThumbnailSize
=
100
;
static
const
int
maxThumbnailSize
=
100
;
static
const
int
defaultThumbnailSize
=
40
;
static
const
int
defaultThumbnailSize
=
40
;
static
const
char
*
objNamePathList
;
static
const
char
*
objNameFeatureList
;
public
:
public
:
int
scrollbarHorisontalPadding
()
const
{
return
10
;}
int
scrollbarHorisontalPadding
()
const
{
return
10
;}
int
scrollbarVerticalIndent
()
const
{
return
0
;}
int
scrollbarVerticalIndent
()
const
{
return
0
;}
signals
:
void
sendFileNameList
(
const
QStringList
lst
);
private
slots
:
private
slots
:
void
onPreviewLoaded
(
int
id
,
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pContentTypeHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
);
void
onPreviewLoaded
(
int
id
,
bool
pSuccess
,
QUrl
sourceUrl
,
QString
pContentTypeHeader
,
QByteArray
pData
,
QPointF
pPos
,
QSize
pSize
,
bool
isBackground
);
void
currentSelected
(
const
QModelIndex
&
);
void
currentSelected
(
const
QModelIndex
&
);
...
@@ -82,6 +90,7 @@ private slots:
...
@@ -82,6 +90,7 @@ private slots:
void
removeElementsFromFavorite
();
void
removeElementsFromFavorite
();
void
deleteSelectedElements
();
void
deleteSelectedElements
();
void
rescanModel
();
void
rescanModel
();
void
lockIt
(
bool
pLock
);
private
:
private
:
void
resizeEvent
(
QResizeEvent
*
event
);
void
resizeEvent
(
QResizeEvent
*
event
);
...
@@ -91,17 +100,12 @@ private:
...
@@ -91,17 +100,12 @@ private:
private
:
private
:
UBFeaturesController
*
controller
;
UBFeaturesController
*
controller
;
UBFeaturesNavigatorWidget
*
mNavigator
;
UBFeaturesListView
*
pathListView
;
UBFeaturesListView
*
pathListView
;
QVBoxLayout
*
layout
;
QVBoxLayout
*
layout
;
UBFeaturesActionBar
*
mActionBar
;
UBFeaturesActionBar
*
mActionBar
;
UBFeatureProperties
*
featureProperties
;
UBFeaturesWebView
*
webView
;
QStackedWidget
*
stackedWidget
;
int
currentStackedWidget
;
UBDownloadHttpFile
*
imageGatherer
;
UBDownloadHttpFile
*
imageGatherer
;
UBNewFolderDlg
*
mkFolderDlg
;
UBNewFolderDlg
*
mkFolderDlg
;
UBFeaturesCentralWidget
*
centralWidget
;
};
};
...
@@ -134,6 +138,7 @@ protected:
...
@@ -134,6 +138,7 @@ protected:
private
slots
:
private
slots
:
void
thumbnailSizeChanged
(
int
);
void
thumbnailSizeChanged
(
int
);
};
};
...
@@ -153,6 +158,99 @@ private:
...
@@ -153,6 +158,99 @@ private:
};
};
class
UBFeaturesCentralWidget
:
public
QWidget
{
Q_OBJECT
public
:
enum
StackElement
{
MainList
=
0
,
FeaturePropertiesList
,
FeaturesWebView
};
enum
AddWidget
{
NewFolderDialog
=
0
,
ProgressBarWidget
};
enum
AddWidgetState
{
NonModal
=
0
,
Modal
};
UBFeaturesCentralWidget
(
QWidget
*
parent
=
0
);
void
setSliderPosition
(
int
pValue
)
{
mNavigator
->
setSliderPosition
(
pValue
);}
UBFeaturesListView
*
listView
()
{
return
mNavigator
->
listView
();}
void
showElement
(
const
UBFeature
&
feature
,
StackElement
pView
);
void
switchTo
(
StackElement
pView
);
void
setPropertiesPixmap
(
const
QPixmap
&
pix
);
void
setPropertiesThumbnail
(
const
QPixmap
&
pix
);
StackElement
currentView
()
const
{
return
static_cast
<
StackElement
>
(
mStackedWidget
->
currentIndex
());}
UBFeature
getCurElementFromProperties
();
void
showAdditionalData
(
AddWidget
pWidgetType
,
AddWidgetState
pState
=
NonModal
);
void
setLockedExcludingAdditional
(
bool
pLock
);
QStackedWidget
*
mStackedWidget
;
UBFeaturesNavigatorWidget
*
mNavigator
;
UBFeatureProperties
*
mFeatureProperties
;
UBFeaturesWebView
*
webView
;
QStackedWidget
*
mAdditionalDataContainer
;
signals
:
void
lockMainWidget
(
bool
pLock
);
void
createNewFolderSignal
(
QString
pStr
);
void
sendFileNameList
(
const
QStringList
lst
);
// progressbar widget related signals
void
maxFilesCountEvaluated
(
int
pValue
);
private
slots
:
void
createNewFolderSlot
(
QString
pStr
);
void
hideAdditionalData
();
void
scanStarted
();
void
scanFinished
();
void
increaseStatusBarValue
();
private
:
};
class
UBFeaturesNewFolderDialog
:
public
QWidget
{
Q_OBJECT
public
:
static
const
QString
acceptText
;
static
const
QString
cancelText
;
static
const
QString
labelText
;
UBFeaturesNewFolderDialog
(
QWidget
*
parent
=
0
);
void
setRegexp
(
const
QRegExp
pRegExp
);
bool
validString
(
const
QString
&
pStr
);
signals
:
void
createNewFolder
(
QString
str
);
void
closeDialog
();
private
slots
:
void
accept
();
void
reject
();
void
setFileNameList
(
const
QStringList
&
pLst
);
void
reactOnTextChanged
(
const
QString
&
pStr
);
private
:
QLineEdit
*
mLineEdit
;
QRegExpValidator
*
mValidator
;
QStringList
mFileNameList
;
QPushButton
*
acceptButton
;
};
class
UBFeaturesWebView
:
public
QWidget
class
UBFeaturesWebView
:
public
QWidget
{
{
...
@@ -182,8 +280,8 @@ public:
...
@@ -182,8 +280,8 @@ public:
void
showElement
(
const
UBFeature
&
elem
);
void
showElement
(
const
UBFeature
&
elem
);
UBFeature
getCurrentElement
()
const
;
UBFeature
getCurrentElement
()
const
;
void
setOrigPixmap
(
QPixmap
&
pix
);
void
setOrigPixmap
(
const
QPixmap
&
pix
);
void
setThumbnail
(
QPixmap
&
pix
);
void
setThumbnail
(
const
QPixmap
&
pix
);
protected
:
protected
:
void
resizeEvent
(
QResizeEvent
*
event
);
void
resizeEvent
(
QResizeEvent
*
event
);
...
@@ -231,7 +329,6 @@ public:
...
@@ -231,7 +329,6 @@ public:
UBFeaturesModel
(
QList
<
UBFeature
>
*
pFeaturesList
,
QObject
*
parent
=
0
)
:
QAbstractListModel
(
parent
),
featuresList
(
pFeaturesList
)
{;}
UBFeaturesModel
(
QList
<
UBFeature
>
*
pFeaturesList
,
QObject
*
parent
=
0
)
:
QAbstractListModel
(
parent
),
featuresList
(
pFeaturesList
)
{;}
virtual
~
UBFeaturesModel
(){;}
virtual
~
UBFeaturesModel
(){;}
void
addItem
(
const
UBFeature
&
item
);
void
deleteFavoriteItem
(
const
QString
&
path
);
void
deleteFavoriteItem
(
const
QString
&
path
);
void
deleteItem
(
const
QString
&
path
);
void
deleteItem
(
const
QString
&
path
);
void
deleteItem
(
const
UBFeature
&
feature
);
void
deleteItem
(
const
UBFeature
&
feature
);
...
@@ -251,6 +348,9 @@ public:
...
@@ -251,6 +348,9 @@ public:
Qt
::
DropActions
supportedDropActions
()
const
{
return
Qt
::
MoveAction
|
Qt
::
CopyAction
;
}
Qt
::
DropActions
supportedDropActions
()
const
{
return
Qt
::
MoveAction
|
Qt
::
CopyAction
;
}
// void setFeaturesList(QList <UBFeature> *flist ) { featuresList = flist; }
// void setFeaturesList(QList <UBFeature> *flist ) { featuresList = flist; }
public
slots
:
void
addItem
(
const
UBFeature
&
item
);
private
:
private
:
QList
<
UBFeature
>
*
featuresList
;
QList
<
UBFeature
>
*
featuresList
;
};
};
...
@@ -314,4 +414,5 @@ private:
...
@@ -314,4 +414,5 @@ private:
QPixmap
*
arrowPixmap
;
QPixmap
*
arrowPixmap
;
};
};
#endif // UBFEATURESWIDGET_H
#endif // UBFEATURESWIDGET_H
src/tools/UBGraphicsCache.cpp
View file @
558f2d47
...
@@ -45,15 +45,24 @@ UBItem* UBGraphicsCache::deepCopy() const
...
@@ -45,15 +45,24 @@ UBItem* UBGraphicsCache::deepCopy() const
{
{
UBGraphicsCache
*
copy
=
new
UBGraphicsCache
();
UBGraphicsCache
*
copy
=
new
UBGraphicsCache
();
copy
->
setPos
(
this
->
pos
());
copyItemParameters
(
copy
);
copy
->
setRect
(
this
->
rect
());
copy
->
setTransform
(
this
->
transform
());
// TODO UB 4.7 ... complete all members ?
// TODO UB 4.7 ... complete all members ?
return
copy
;
return
copy
;
}
}
void
UBGraphicsCache
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsCache
*
cp
=
dynamic_cast
<
UBGraphicsCache
*>
(
copy
);
if
(
cp
)
{
cp
->
setPos
(
this
->
pos
());
cp
->
setRect
(
this
->
rect
());
cp
->
setTransform
(
this
->
transform
());
}
}
QColor
UBGraphicsCache
::
maskColor
()
QColor
UBGraphicsCache
::
maskColor
()
{
{
return
mMaskColor
;
return
mMaskColor
;
...
...
src/tools/UBGraphicsCache.h
View file @
558f2d47
...
@@ -39,6 +39,8 @@ public:
...
@@ -39,6 +39,8 @@ public:
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
QColor
maskColor
();
QColor
maskColor
();
void
setMaskColor
(
QColor
color
);
void
setMaskColor
(
QColor
color
);
eMaskShape
maskshape
();
eMaskShape
maskshape
();
...
...
src/tools/UBGraphicsCompass.cpp
View file @
558f2d47
...
@@ -86,15 +86,24 @@ UBItem* UBGraphicsCompass::deepCopy() const
...
@@ -86,15 +86,24 @@ UBItem* UBGraphicsCompass::deepCopy() const
{
{
UBGraphicsCompass
*
copy
=
new
UBGraphicsCompass
();
UBGraphicsCompass
*
copy
=
new
UBGraphicsCompass
();
copy
->
setPos
(
this
->
pos
());
copyItemParameters
(
copy
);
copy
->
setRect
(
this
->
rect
());
copy
->
setTransform
(
this
->
transform
());
// TODO UB 4.7 ... complete all members ?
// TODO UB 4.7 ... complete all members ?
return
copy
;
return
copy
;
}
}
void
UBGraphicsCompass
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsCompass
*
cp
=
dynamic_cast
<
UBGraphicsCompass
*>
(
copy
);
if
(
cp
)
{
cp
->
setPos
(
this
->
pos
());
cp
->
setRect
(
this
->
rect
());
cp
->
setTransform
(
this
->
transform
());
}
}
void
UBGraphicsCompass
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
styleOption
,
QWidget
*
widget
)
void
UBGraphicsCompass
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
styleOption
,
QWidget
*
widget
)
{
{
Q_UNUSED
(
styleOption
);
Q_UNUSED
(
styleOption
);
...
...
src/tools/UBGraphicsCompass.h
View file @
558f2d47
...
@@ -41,6 +41,8 @@ class UBGraphicsCompass: public QObject, public QGraphicsRectItem, public UBItem
...
@@ -41,6 +41,8 @@ class UBGraphicsCompass: public QObject, public QGraphicsRectItem, public UBItem
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
signals
:
signals
:
void
hidden
();
void
hidden
();
...
...
src/tools/UBGraphicsCurtainItem.cpp
View file @
558f2d47
...
@@ -133,20 +133,28 @@ UBItem* UBGraphicsCurtainItem::deepCopy() const
...
@@ -133,20 +133,28 @@ UBItem* UBGraphicsCurtainItem::deepCopy() const
{
{
UBGraphicsCurtainItem
*
copy
=
new
UBGraphicsCurtainItem
();
UBGraphicsCurtainItem
*
copy
=
new
UBGraphicsCurtainItem
();
copy
->
setRect
(
this
->
rect
());
copyItemParameters
(
copy
);
copy
->
setPos
(
this
->
pos
());
copy
->
setBrush
(
this
->
brush
());
copy
->
setPen
(
this
->
pen
());
copy
->
setTransform
(
this
->
transform
());
copy
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
copy
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
copy
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
// TODO UB 4.7 ... complete all members ?
// TODO UB 4.7 ... complete all members ?
return
copy
;
return
copy
;
}
}
void
UBGraphicsCurtainItem
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsCurtainItem
*
cp
=
dynamic_cast
<
UBGraphicsCurtainItem
*>
(
copy
);
if
(
cp
)
{
cp
->
setRect
(
this
->
rect
());
cp
->
setPos
(
this
->
pos
());
cp
->
setBrush
(
this
->
brush
());
cp
->
setPen
(
this
->
pen
());
cp
->
setTransform
(
this
->
transform
());
cp
->
setFlag
(
QGraphicsItem
::
ItemIsMovable
,
true
);
cp
->
setFlag
(
QGraphicsItem
::
ItemIsSelectable
,
true
);
cp
->
setData
(
UBGraphicsItemData
::
ItemLayerType
,
this
->
data
(
UBGraphicsItemData
::
ItemLayerType
));
}
}
QColor
UBGraphicsCurtainItem
::
drawColor
()
const
QColor
UBGraphicsCurtainItem
::
drawColor
()
const
{
{
...
...
src/tools/UBGraphicsCurtainItem.h
View file @
558f2d47
...
@@ -42,6 +42,7 @@ class UBGraphicsCurtainItem : public QObject, public QGraphicsRectItem, public U
...
@@ -42,6 +42,7 @@ class UBGraphicsCurtainItem : public QObject, public QGraphicsRectItem, public U
}
}
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
virtual
void
remove
();
virtual
void
remove
();
...
...
src/tools/UBGraphicsProtractor.cpp
View file @
558f2d47
...
@@ -579,20 +579,27 @@ UBItem* UBGraphicsProtractor::deepCopy() const
...
@@ -579,20 +579,27 @@ UBItem* UBGraphicsProtractor::deepCopy() const
{
{
UBGraphicsProtractor
*
copy
=
new
UBGraphicsProtractor
();
UBGraphicsProtractor
*
copy
=
new
UBGraphicsProtractor
();
copy
->
setPos
(
this
->
pos
());
copyItemParameters
(
copy
);
copy
->
setRect
(
this
->
rect
());
copy
->
setTransform
(
this
->
transform
());
copy
->
mCurrentAngle
=
this
->
mCurrentAngle
;
copy
->
mSpan
=
this
->
mSpan
;
copy
->
mStartAngle
=
this
->
mStartAngle
;
copy
->
mScaleFactor
=
this
->
mScaleFactor
;
// TODO UB 4.7 ... complete all members ?
// TODO UB 4.7 ... complete all members ?
return
copy
;
return
copy
;
}
}
void
UBGraphicsProtractor
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsProtractor
*
cp
=
dynamic_cast
<
UBGraphicsProtractor
*>
(
copy
);
if
(
cp
)
{
cp
->
setPos
(
this
->
pos
());
cp
->
setRect
(
this
->
rect
());
cp
->
setTransform
(
this
->
transform
());
cp
->
mCurrentAngle
=
this
->
mCurrentAngle
;
cp
->
mSpan
=
this
->
mSpan
;
cp
->
mStartAngle
=
this
->
mStartAngle
;
cp
->
mScaleFactor
=
this
->
mScaleFactor
;
}
}
void
UBGraphicsProtractor
::
rotateAroundCenter
(
qreal
angle
)
void
UBGraphicsProtractor
::
rotateAroundCenter
(
qreal
angle
)
{
{
...
...
src/tools/UBGraphicsProtractor.h
View file @
558f2d47
...
@@ -40,6 +40,7 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse
...
@@ -40,6 +40,7 @@ class UBGraphicsProtractor : public UBAbstractDrawRuler, public QGraphicsEllipse
void
setMarkerAngle
(
qreal
angle
)
{
mCurrentAngle
=
angle
;
}
void
setMarkerAngle
(
qreal
angle
)
{
mCurrentAngle
=
angle
;
}
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
enum
{
Type
=
UBGraphicsItemType
::
ProtractorItemType
};
enum
{
Type
=
UBGraphicsItemType
::
ProtractorItemType
};
...
...
src/tools/UBGraphicsRuler.cpp
View file @
558f2d47
...
@@ -75,15 +75,24 @@ UBItem* UBGraphicsRuler::deepCopy() const
...
@@ -75,15 +75,24 @@ UBItem* UBGraphicsRuler::deepCopy() const
{
{
UBGraphicsRuler
*
copy
=
new
UBGraphicsRuler
();
UBGraphicsRuler
*
copy
=
new
UBGraphicsRuler
();
copy
->
setPos
(
this
->
pos
());
copyItemParameters
(
copy
);
copy
->
setRect
(
this
->
rect
());
copy
->
setTransform
(
this
->
transform
());
// TODO UB 4.7 ... complete all members ?
// TODO UB 4.7 ... complete all members ?
return
copy
;
return
copy
;
}
}
void
UBGraphicsRuler
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsRuler
*
cp
=
dynamic_cast
<
UBGraphicsRuler
*>
(
copy
);
if
(
cp
)
{
cp
->
setPos
(
this
->
pos
());
cp
->
setRect
(
this
->
rect
());
cp
->
setTransform
(
this
->
transform
());
}
}
void
UBGraphicsRuler
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
styleOption
,
QWidget
*
widget
)
void
UBGraphicsRuler
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
styleOption
,
QWidget
*
widget
)
{
{
Q_UNUSED
(
styleOption
);
Q_UNUSED
(
styleOption
);
...
...
src/tools/UBGraphicsRuler.h
View file @
558f2d47
...
@@ -41,6 +41,7 @@ class UBGraphicsRuler : public UBAbstractDrawRuler, public QGraphicsRectItem, pu
...
@@ -41,6 +41,7 @@ class UBGraphicsRuler : public UBAbstractDrawRuler, public QGraphicsRectItem, pu
}
}
virtual
UBItem
*
deepCopy
()
const
;
virtual
UBItem
*
deepCopy
()
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
virtual
void
StartLine
(
const
QPointF
&
position
,
qreal
width
);
virtual
void
StartLine
(
const
QPointF
&
position
,
qreal
width
);
virtual
void
DrawLine
(
const
QPointF
&
position
,
qreal
width
);
virtual
void
DrawLine
(
const
QPointF
&
position
,
qreal
width
);
...
...
src/tools/UBGraphicsTriangle.cpp
View file @
558f2d47
...
@@ -94,9 +94,7 @@ UBItem* UBGraphicsTriangle::deepCopy(void) const
...
@@ -94,9 +94,7 @@ UBItem* UBGraphicsTriangle::deepCopy(void) const
{
{
UBGraphicsTriangle
*
copy
=
new
UBGraphicsTriangle
();
UBGraphicsTriangle
*
copy
=
new
UBGraphicsTriangle
();
copy
->
setPos
(
this
->
pos
());
copyItemParameters
(
copy
);
copy
->
setPolygon
(
this
->
polygon
());
copy
->
setTransform
(
this
->
transform
());
// TODO UB 4.7 ... complete all members ?
// TODO UB 4.7 ... complete all members ?
...
@@ -104,6 +102,17 @@ UBItem* UBGraphicsTriangle::deepCopy(void) const
...
@@ -104,6 +102,17 @@ UBItem* UBGraphicsTriangle::deepCopy(void) const
}
}
void
UBGraphicsTriangle
::
copyItemParameters
(
UBItem
*
copy
)
const
{
UBGraphicsTriangle
*
cp
=
dynamic_cast
<
UBGraphicsTriangle
*>
(
copy
);
if
(
cp
)
{
cp
->
setPos
(
this
->
pos
());
cp
->
setPolygon
(
this
->
polygon
());
cp
->
setTransform
(
this
->
transform
());
}
}
void
UBGraphicsTriangle
::
setRect
(
qreal
x
,
qreal
y
,
qreal
w
,
qreal
h
,
UBGraphicsTriangleOrientation
orientation
)
void
UBGraphicsTriangle
::
setRect
(
qreal
x
,
qreal
y
,
qreal
w
,
qreal
h
,
UBGraphicsTriangleOrientation
orientation
)
{
{
QPolygonF
polygon
;
QPolygonF
polygon
;
...
...
src/tools/UBGraphicsTriangle.h
View file @
558f2d47
...
@@ -45,6 +45,7 @@ class UBGraphicsTriangle : public UBAbstractDrawRuler, public QGraphicsPolygonIt
...
@@ -45,6 +45,7 @@ class UBGraphicsTriangle : public UBAbstractDrawRuler, public QGraphicsPolygonIt
virtual
UBItem
*
deepCopy
(
void
)
const
;
virtual
UBItem
*
deepCopy
(
void
)
const
;
virtual
void
copyItemParameters
(
UBItem
*
copy
)
const
;
virtual
void
StartLine
(
const
QPointF
&
scenePos
,
qreal
width
);
virtual
void
StartLine
(
const
QPointF
&
scenePos
,
qreal
width
);
virtual
void
DrawLine
(
const
QPointF
&
position
,
qreal
width
);
virtual
void
DrawLine
(
const
QPointF
&
position
,
qreal
width
);
...
...
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