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
c8a88bbb
Commit
c8a88bbb
authored
Feb 06, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
c570dce9
e9936c45
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
241 additions
and
21 deletions
+241
-21
UBActionableWidget.cpp
src/customWidgets/UBActionableWidget.cpp
+70
-0
UBActionableWidget.h
src/customWidgets/UBActionableWidget.h
+35
-0
UBMediaWidget.cpp
src/customWidgets/UBMediaWidget.cpp
+2
-3
UBMediaWidget.h
src/customWidgets/UBMediaWidget.h
+2
-1
UBWidgetList.cpp
src/customWidgets/UBWidgetList.cpp
+41
-0
UBWidgetList.h
src/customWidgets/UBWidgetList.h
+6
-1
customWidgets.pri
src/customWidgets/customWidgets.pri
+4
-2
UBGlobals.h
src/globals/UBGlobals.h
+2
-1
UBTBPageEditWidget.cpp
src/gui/UBTBPageEditWidget.cpp
+59
-11
UBTBPageEditWidget.h
src/gui/UBTBPageEditWidget.h
+20
-2
No files found.
src/customWidgets/UBActionableWidget.cpp
0 → 100644
View file @
c8a88bbb
#include <QPainter>
#include <QDebug>
#include "UBActionableWidget.h"
UBActionableWidget
::
UBActionableWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mShowActions
(
false
)
{
setObjectName
(
name
);
mActions
.
clear
();
}
UBActionableWidget
::~
UBActionableWidget
()
{
}
void
UBActionableWidget
::
addAction
(
eAction
act
)
{
if
(
!
mActions
.
contains
(
act
)){
mActions
<<
act
;
}
}
void
UBActionableWidget
::
removeAction
(
eAction
act
)
{
if
(
mActions
.
contains
(
act
)){
mActions
.
remove
(
mActions
.
indexOf
(
act
));
}
}
void
UBActionableWidget
::
removeAllActions
()
{
mActions
.
clear
();
}
void
UBActionableWidget
::
setActionsVisible
(
bool
bVisible
)
{
mShowActions
=
bVisible
;
}
bool
UBActionableWidget
::
shouldClose
(
QPoint
p
)
{
qDebug
()
<<
"Should close: "
<<
p
.
x
()
<<
","
<<
p
.
y
();
bool
close
=
false
;
if
(
mShowActions
&&
p
.
x
()
>=
0
&&
p
.
x
()
<=
ACTIONSIZE
&&
p
.
y
()
>=
0
&&
p
.
y
()
<=
ACTIONSIZE
){
close
=
true
;
}
return
close
;
}
void
UBActionableWidget
::
paintEvent
(
QPaintEvent
*
ev
)
{
if
(
mShowActions
){
QPainter
p
(
this
);
if
(
mActions
.
contains
(
eAction_Close
)){
p
.
drawPixmap
(
0
,
0
,
16
,
16
,
QPixmap
(
":images/close.svg"
));
}
else
if
(
mActions
.
contains
(
eAction_MoveUp
)){
// Implement me later
}
else
if
(
mActions
.
contains
(
eAction_MoveDown
)){
// Implement me later
}
}
}
src/customWidgets/UBActionableWidget.h
0 → 100644
View file @
c8a88bbb
#ifndef UBACTIONABLEWIDGET_H
#define UBACTIONABLEWIDGET_H
#include <QWidget>
#include <QPaintEvent>
#define ACTIONSIZE 16
typedef
enum
{
eAction_Close
,
eAction_MoveUp
,
eAction_MoveDown
}
eAction
;
class
UBActionableWidget
:
public
QWidget
{
Q_OBJECT
public
:
UBActionableWidget
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBActionableWidget"
);
~
UBActionableWidget
();
void
addAction
(
eAction
act
);
void
removeAction
(
eAction
act
);
void
removeAllActions
();
void
setActionsVisible
(
bool
bVisible
);
bool
shouldClose
(
QPoint
p
);
protected
:
void
paintEvent
(
QPaintEvent
*
ev
);
QVector
<
eAction
>
mActions
;
private
:
bool
mShowActions
;
};
#endif // UBACTIONABLEWIDGET_H
src/customWidgets/UBMediaWidget.cpp
View file @
c8a88bbb
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
* @param parent as the parent widget
* @param parent as the parent widget
* @param name as the object name
* @param name as the object name
*/
*/
UBMediaWidget
::
UBMediaWidget
(
eMediaType
type
,
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
UBMediaWidget
::
UBMediaWidget
(
eMediaType
type
,
QWidget
*
parent
,
const
char
*
name
)
:
UBActionableWidget
(
parent
,
name
)
,
mpMediaObject
(
NULL
)
,
mpMediaObject
(
NULL
)
,
mpVideoWidget
(
NULL
)
,
mpVideoWidget
(
NULL
)
,
mpAudioOutput
(
NULL
)
,
mpAudioOutput
(
NULL
)
...
@@ -35,11 +35,10 @@ UBMediaWidget::UBMediaWidget(eMediaType type, QWidget *parent, const char *name)
...
@@ -35,11 +35,10 @@ UBMediaWidget::UBMediaWidget(eMediaType type, QWidget *parent, const char *name)
,
mpMediaContainer
(
NULL
)
,
mpMediaContainer
(
NULL
)
,
mpCover
(
NULL
)
,
mpCover
(
NULL
)
{
{
setObjectName
(
name
);
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
addAction
(
eAction_Close
);
mType
=
type
;
mType
=
type
;
setLayout
(
&
mLayout
);
setLayout
(
&
mLayout
);
...
...
src/customWidgets/UBMediaWidget.h
View file @
c8a88bbb
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include <phonon/AudioOutput>
#include <phonon/AudioOutput>
#include "interfaces/IResizeable.h"
#include "interfaces/IResizeable.h"
#include "UBActionableWidget.h"
#define UBMEDIABUTTON_SIZE 32
#define UBMEDIABUTTON_SIZE 32
#define TICK_INTERVAL 1000
#define TICK_INTERVAL 1000
...
@@ -58,7 +59,7 @@ private:
...
@@ -58,7 +59,7 @@ private:
bool
mPressed
;
bool
mPressed
;
};
};
class
UBMediaWidget
:
public
Q
Widget
class
UBMediaWidget
:
public
UBActionable
Widget
{
{
Q_OBJECT
Q_OBJECT
public
:
public
:
...
...
src/customWidgets/UBWidgetList.cpp
View file @
c8a88bbb
#include <QDebug>
#include <QDebug>
#include <QScrollBar>
#include <QScrollBar>
#include <QApplication>
#include <QPainter>
#include "globals/UBGlobals.h"
#include "globals/UBGlobals.h"
#include "UBWidgetList.h"
#include "UBWidgetList.h"
...
@@ -136,8 +138,47 @@ void UBWidgetList::mousePressEvent(QMouseEvent *ev)
...
@@ -136,8 +138,47 @@ void UBWidgetList::mousePressEvent(QMouseEvent *ev)
{
{
Q_UNUSED
(
ev
);
Q_UNUSED
(
ev
);
if
(
mCanRemove
){
if
(
mCanRemove
){
QWidget
*
pWAt
=
widgetAt
(
ev
->
pos
());
if
(
NULL
!=
mpCurrentWidget
){
if
(
pWAt
==
mpCurrentWidget
){
QPoint
p
;
p
.
setX
(
ev
->
x
());
p
.
setY
(
ev
->
y
());
if
(
mpCurrentWidget
->
shouldClose
(
p
)){
emit
closeWidget
(
mpCurrentWidget
);
return
;
}
}
else
{
mpCurrentWidget
->
setActionsVisible
(
false
);
}
}
mpCurrentWidget
=
dynamic_cast
<
UBActionableWidget
*>
(
pWAt
);
if
(
NULL
!=
mpCurrentWidget
){
mpCurrentWidget
->
setActionsVisible
(
true
);
}
}
update
();
}
QWidget
*
UBWidgetList
::
widgetAt
(
QPoint
p
)
{
QWidget
*
pW
=
NULL
;
pW
=
childAt
(
p
);
if
(
NULL
!=
pW
){
do
{
if
(
"UBTeacherStudentAction"
==
pW
->
objectName
()
||
"UBUrlWidget"
==
pW
->
objectName
()
||
"UBTBMediaPicture"
==
pW
->
objectName
()
||
"UBMediaWidget"
==
pW
->
objectName
()){
return
pW
;
}
else
{
pW
=
pW
->
parentWidget
();
}
}
while
(
NULL
!=
pW
&&
this
!=
pW
);
}
}
return
pW
;
}
}
void
UBWidgetList
::
updateSizes
()
void
UBWidgetList
::
updateSizes
()
...
...
src/customWidgets/UBWidgetList.h
View file @
c8a88bbb
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#include <QLabel>
#include <QLabel>
#include "interfaces/IResizeable.h"
#include "interfaces/IResizeable.h"
#include "customWidgets/UBActionableWidget.h"
typedef
enum
{
typedef
enum
{
eWidgetListOrientation_Vertical
,
eWidgetListOrientation_Vertical
,
...
@@ -40,6 +41,9 @@ public:
...
@@ -40,6 +41,9 @@ public:
void
setListElementSpacing
(
int
margin
)
{
mListElementsSpacing
=
margin
;
}
void
setListElementSpacing
(
int
margin
)
{
mListElementsSpacing
=
margin
;
}
int
listElementsSpacing
()
{
return
mListElementsSpacing
;
}
int
listElementsSpacing
()
{
return
mListElementsSpacing
;
}
signals
:
void
closeWidget
(
QWidget
*
w
);
protected
:
protected
:
bool
mCanRemove
;
bool
mCanRemove
;
...
@@ -47,6 +51,7 @@ protected:
...
@@ -47,6 +51,7 @@ protected:
void
mousePressEvent
(
QMouseEvent
*
ev
);
void
mousePressEvent
(
QMouseEvent
*
ev
);
private
:
private
:
QWidget
*
widgetAt
(
QPoint
p
);
int
scaleWidgets
(
QSize
pSize
);
int
scaleWidgets
(
QSize
pSize
);
void
scaleContainer
(
QSize
pSize
,
int
updateValue
);
void
scaleContainer
(
QSize
pSize
,
int
updateValue
);
void
updateView
(
QSize
pSize
);
void
updateView
(
QSize
pSize
);
...
@@ -58,7 +63,7 @@ private:
...
@@ -58,7 +63,7 @@ private:
int
mListElementsSpacing
;
int
mListElementsSpacing
;
QMap
<
QWidget
*
,
QSize
>
mWidgetInfo
;
QMap
<
QWidget
*
,
QSize
>
mWidgetInfo
;
QLabel
*
mpEmptyLabel
;
QLabel
*
mpEmptyLabel
;
Q
Widget
*
mpCurrentWidget
;
UBActionable
Widget
*
mpCurrentWidget
;
};
};
#endif // UBWIDGETLIST_H
#endif // UBWIDGETLIST_H
src/customWidgets/customWidgets.pri
View file @
c8a88bbb
...
@@ -3,9 +3,11 @@ HEADERS += src/customWidgets/UBWidgetList.h \
...
@@ -3,9 +3,11 @@ HEADERS += src/customWidgets/UBWidgetList.h \
src/customWidgets/UBDraggableLabel.h \
src/customWidgets/UBDraggableLabel.h \
src/customWidgets/UBMediaWidget.h \
src/customWidgets/UBMediaWidget.h \
src/globals/UBGlobals.h \
src/globals/UBGlobals.h \
src/customWidgets/UBDraggableMedia.h
src/customWidgets/UBDraggableMedia.h \
src/customWidgets/UBActionableWidget.h
SOURCES += src/customWidgets/UBWidgetList.cpp \
SOURCES += src/customWidgets/UBWidgetList.cpp \
src/customWidgets/UBDraggableLabel.cpp \
src/customWidgets/UBDraggableLabel.cpp \
src/customWidgets/UBMediaWidget.cpp \
src/customWidgets/UBMediaWidget.cpp \
src/customWidgets/UBDraggableMedia.cpp
src/customWidgets/UBDraggableMedia.cpp \
src/customWidgets/UBActionableWidget.cpp
src/globals/UBGlobals.h
View file @
c8a88bbb
...
@@ -33,6 +33,7 @@ _Pragma("GCC diagnostic ignored \"-Wsign-compare\"");
...
@@ -33,6 +33,7 @@ _Pragma("GCC diagnostic ignored \"-Wsign-compare\"");
#ifdef NO_THIRD_PARTY_WARNINGS
#ifdef NO_THIRD_PARTY_WARNINGS
//disabling some warnings
//disabling some warnings
#define THIRD_PARTY_WARNINGS_DISABLE WARNINGS_DISABLE
#define THIRD_PARTY_WARNINGS_DISABLE WARNINGS_DISABLE
#define THIRD_PARTY_WARNINGS_ENABLE WARNINGS_ENABLE
#define THIRD_PARTY_WARNINGS_ENABLE WARNINGS_ENABLE
#else
#else
// just save old state (needs for not empty define)
// just save old state (needs for not empty define)
...
@@ -43,4 +44,4 @@ _Pragma("GCC diagnostic ignored \"-Wsign-compare\"");
...
@@ -43,4 +44,4 @@ _Pragma("GCC diagnostic ignored \"-Wsign-compare\"");
#endif //#ifdef Q_WS_WIN
#endif //#ifdef Q_WS_WIN
#endif // UBGLOBALS_H
#endif // UBGLOBALS_H
\ No newline at end of file
src/gui/UBTBPageEditWidget.cpp
View file @
c8a88bbb
...
@@ -100,6 +100,9 @@ UBTBPageEditWidget::UBTBPageEditWidget(UBTeacherBarDataMgr *pDataMgr, QWidget *p
...
@@ -100,6 +100,9 @@ UBTBPageEditWidget::UBTBPageEditWidget(UBTeacherBarDataMgr *pDataMgr, QWidget *p
connect
(
mpDocumentEditbutton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onDocumentEditClicked
()));
connect
(
mpDocumentEditbutton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onDocumentEditClicked
()));
connect
(
mpPagePreviewButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onPagePreviewClicked
()));
connect
(
mpPagePreviewButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onPagePreviewClicked
()));
connect
(
mpMediaContainer
,
SIGNAL
(
mediaDropped
(
QString
)),
this
,
SLOT
(
onMediaDropped
(
QString
)));
connect
(
mpMediaContainer
,
SIGNAL
(
mediaDropped
(
QString
)),
this
,
SLOT
(
onMediaDropped
(
QString
)));
connect
(
mpActions
,
SIGNAL
(
closeWidget
(
QWidget
*
)),
this
,
SLOT
(
onCloseWidget
(
QWidget
*
)));
connect
(
mpLinks
,
SIGNAL
(
closeWidget
(
QWidget
*
)),
this
,
SLOT
(
onCloseWidget
(
QWidget
*
)));
connect
(
mpMediaContainer
,
SIGNAL
(
closeWidget
(
QWidget
*
)),
this
,
SLOT
(
onCloseWidget
(
QWidget
*
)));
}
}
UBTBPageEditWidget
::~
UBTBPageEditWidget
()
UBTBPageEditWidget
::~
UBTBPageEditWidget
()
...
@@ -271,15 +274,36 @@ void UBTBPageEditWidget::clearFields()
...
@@ -271,15 +274,36 @@ void UBTBPageEditWidget::clearFields()
mClearingFields
=
false
;
mClearingFields
=
false
;
}
}
void
UBTBPageEditWidget
::
onCloseWidget
(
QWidget
*
w
)
{
if
(
NULL
!=
w
){
if
(
"UBTeacherStudentAction"
==
w
->
objectName
()){
UBTeacherStudentAction
*
pW
=
dynamic_cast
<
UBTeacherStudentAction
*>
(
w
);
mpActions
->
removeWidget
(
pW
);
mActions
.
remove
(
mActions
.
indexOf
(
pW
));
DELETEPTR
(
w
);
}
else
if
(
"UBUrlWidget"
==
w
->
objectName
()){
UBUrlWidget
*
pW
=
dynamic_cast
<
UBUrlWidget
*>
(
w
);
mpLinks
->
removeWidget
(
pW
);
mUrls
.
remove
(
mUrls
.
indexOf
(
pW
));
DELETEPTR
(
w
);
}
else
if
(
"UBTBMediaPicture"
==
w
->
objectName
()
||
"UBMediaWidget"
==
w
->
objectName
()){
mpMediaContainer
->
removeWidget
(
w
);
mMedias
.
remove
(
mMedias
.
indexOf
(
w
));
DELETEPTR
(
w
);
}
}
}
// ---------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------
UBUrlWidget
::
UBUrlWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
UBUrlWidget
::
UBUrlWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
UBActionableWidget
(
parent
,
name
)
,
mpLayout
(
NULL
)
,
mpLayout
(
NULL
)
,
mpUrlLabel
(
NULL
)
,
mpUrlLabel
(
NULL
)
,
mpUrl
(
NULL
)
,
mpUrl
(
NULL
)
{
{
setObjectName
(
name
);
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
addAction
(
eAction_Close
);
mpLayout
=
new
QVBoxLayout
(
this
);
mpLayout
=
new
QVBoxLayout
(
this
);
setLayout
(
mpLayout
);
setLayout
(
mpLayout
);
...
@@ -435,12 +459,13 @@ QWidget* UBTBMediaContainer::generateMediaWidget(const QString& url)
...
@@ -435,12 +459,13 @@ QWidget* UBTBMediaContainer::generateMediaWidget(const QString& url)
QString
mimeType
=
UBFileSystemUtils
::
mimeTypeFromFileName
(
url
);
QString
mimeType
=
UBFileSystemUtils
::
mimeTypeFromFileName
(
url
);
if
(
mimeType
.
contains
(
"image"
)){
if
(
mimeType
.
contains
(
"image"
)){
QPixmap
pix
=
QPixmap
(
url
);
QPixmap
pix
=
QPixmap
(
url
);
QLabel
*
label
=
new
QLabel
();
UBPictureWidget
*
pic
=
new
UBPictureWidget
();
pix
.
scaledToWidth
(
label
->
width
());
pix
.
scaledToWidth
(
pic
->
label
()
->
width
());
label
->
resize
(
pix
.
width
(),
pix
.
height
());
pic
->
label
()
->
resize
(
pix
.
width
(),
pix
.
height
());
label
->
setPixmap
(
pix
);
pic
->
label
()
->
setPixmap
(
pix
);
label
->
setScaledContents
(
true
);
pic
->
label
()
->
setScaledContents
(
true
);
pW
=
label
;
pic
->
setObjectName
(
"UBTBMediaPicture"
);
pW
=
pic
;
}
}
else
if
(
mimeType
.
contains
(
"video"
)
||
mimeType
.
contains
(
"audio"
)){
else
if
(
mimeType
.
contains
(
"video"
)
||
mimeType
.
contains
(
"audio"
)){
UBMediaWidget
*
mediaPlayer
=
new
UBMediaWidget
(
mimeType
.
contains
(
"audio"
)
?
eMediaType_Audio
:
eMediaType_Video
);
UBMediaWidget
*
mediaPlayer
=
new
UBMediaWidget
(
mimeType
.
contains
(
"audio"
)
?
eMediaType_Audio
:
eMediaType_Video
);
...
@@ -455,16 +480,15 @@ QWidget* UBTBMediaContainer::generateMediaWidget(const QString& url)
...
@@ -455,16 +480,15 @@ QWidget* UBTBMediaContainer::generateMediaWidget(const QString& url)
return
pW
;
return
pW
;
}
}
UBTeacherStudentAction
::
UBTeacherStudentAction
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
UBTeacherStudentAction
::
UBTeacherStudentAction
(
QWidget
*
parent
,
const
char
*
name
)
:
UBActionableWidget
(
parent
,
name
)
,
mpText
(
NULL
)
,
mpText
(
NULL
)
,
mpLayout
(
NULL
)
,
mpLayout
(
NULL
)
,
mpComboLayout
(
NULL
)
,
mpComboLayout
(
NULL
)
,
mpCombo
(
NULL
)
,
mpCombo
(
NULL
)
{
{
setObjectName
(
name
);
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
addAction
(
eAction_Close
);
// Create the GUI
// Create the GUI
mpLayout
=
new
QHBoxLayout
(
this
);
mpLayout
=
new
QHBoxLayout
(
this
);
...
@@ -532,3 +556,27 @@ void UBTeacherStudentAction::setText(const QString& text)
...
@@ -532,3 +556,27 @@ void UBTeacherStudentAction::setText(const QString& text)
}
}
}
}
// -------------------------------------------------------------
UBPictureWidget
::
UBPictureWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
UBActionableWidget
(
parent
,
name
)
,
mpLayout
(
NULL
)
,
mpLabel
(
NULL
)
{
addAction
(
eAction_Close
);
mpLayout
=
new
QVBoxLayout
(
this
);
setLayout
(
mpLayout
);
mpLayout
->
setContentsMargins
(
10
,
0
,
10
,
0
);
mpLabel
=
new
QLabel
(
this
);
mpLayout
->
addWidget
(
mpLabel
);
mpLabel
->
setGeometry
(
10
,
10
,
width
()
-
2
*
10
,
height
());
}
UBPictureWidget
::~
UBPictureWidget
()
{
DELETEPTR
(
mpLabel
);
DELETEPTR
(
mpLayout
);
}
void
UBPictureWidget
::
resizeEvent
(
QResizeEvent
*
ev
)
{
mpLabel
->
setGeometry
(
10
,
10
,
width
()
-
2
*
10
,
height
());
}
src/gui/UBTBPageEditWidget.h
View file @
c8a88bbb
...
@@ -11,10 +11,11 @@
...
@@ -11,10 +11,11 @@
#include "core/UBPersistenceManager.h"
#include "core/UBPersistenceManager.h"
#include "customWidgets/UBWidgetList.h"
#include "customWidgets/UBWidgetList.h"
#include "customWidgets/UBActionableWidget.h"
#include "interfaces/IDropable.h"
#include "interfaces/IDropable.h"
#include "UBTeacherBarDataMgr.h"
#include "UBTeacherBarDataMgr.h"
class
UBTeacherStudentAction
:
public
Q
Widget
class
UBTeacherStudentAction
:
public
UBActionable
Widget
{
{
Q_OBJECT
Q_OBJECT
...
@@ -33,7 +34,7 @@ private:
...
@@ -33,7 +34,7 @@ private:
QComboBox
*
mpCombo
;
QComboBox
*
mpCombo
;
};
};
class
UBUrlWidget
:
public
Q
Widget
class
UBUrlWidget
:
public
UBActionable
Widget
{
{
public
:
public
:
UBUrlWidget
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBUrlWidget"
);
UBUrlWidget
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBUrlWidget"
);
...
@@ -56,6 +57,22 @@ private:
...
@@ -56,6 +57,22 @@ private:
QLineEdit
*
mpTitle
;
QLineEdit
*
mpTitle
;
};
};
class
UBPictureWidget
:
public
UBActionableWidget
{
public
:
UBPictureWidget
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBPictureWidget"
);
~
UBPictureWidget
();
QLabel
*
label
(){
return
mpLabel
;}
protected
:
void
resizeEvent
(
QResizeEvent
*
ev
);
private
:
QVBoxLayout
*
mpLayout
;
QLabel
*
mpLabel
;
};
class
UBTBMediaContainer
:
public
UBWidgetList
class
UBTBMediaContainer
:
public
UBWidgetList
,
public
IDropable
,
public
IDropable
{
{
...
@@ -104,6 +121,7 @@ private slots:
...
@@ -104,6 +121,7 @@ private slots:
void
onMediaDropped
(
const
QString
&
url
);
void
onMediaDropped
(
const
QString
&
url
);
void
onDocumentEditClicked
();
void
onDocumentEditClicked
();
void
onPagePreviewClicked
();
void
onPagePreviewClicked
();
void
onCloseWidget
(
QWidget
*
w
);
private
:
private
:
QVBoxLayout
mLayout
;
QVBoxLayout
mLayout
;
...
...
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