новые иконки в OpenBoard
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
OpenBoard/src/gui/UBTeacherBarDataMgr.cpp

97 lines
2.0 KiB

#include "core/UBApplication.h"
#include "customWidgets/UBGlobals.h"
#include "UBTeacherBarDataMgr.h"
UBTeacherBarDataMgr::UBTeacherBarDataMgr()
{
}
UBTeacherBarDataMgr::~UBTeacherBarDataMgr()
{
}
void UBTeacherBarDataMgr::clearLists()
{
mActionList.clear();
mUrlList.clear();
mMediaList.clear();
}
UBTeacherStudentAction::UBTeacherStudentAction(QWidget *parent, const char *name):QWidget(parent)
, mpText(NULL)
, mpLayout(NULL)
, mpComboLayout(NULL)
, mpCombo(NULL)
{
setObjectName(name);
setAttribute(Qt::WA_StyledBackground, true);
setStyleSheet(UBApplication::globalStyleSheet());
// Create the GUI
mpLayout = new QHBoxLayout(this);
setLayout(mpLayout);
mpComboLayout = new QVBoxLayout();
mpCombo = new QComboBox(this);
mpCombo->setObjectName("DockPaletteWidgetComboBox");
mpCombo->setMinimumWidth(80);
mpCombo->addItem(tr("Teacher"));
mpCombo->addItem(tr("Student"));
mpComboLayout->addWidget(mpCombo, 0);
mpComboLayout->addStretch(1);
mpLayout->addLayout(mpComboLayout, 0);
mpText = new QTextEdit(this);
mpText->setObjectName("DockPaletteWidgetBox");
mpText->setStyleSheet("background:white;");
mpLayout->addWidget(mpText, 1);
}
UBTeacherStudentAction::~UBTeacherStudentAction()
{
DELETEPTR(mpCombo);
DELETEPTR(mpText);
DELETEPTR(mpComboLayout);
DELETEPTR(mpLayout);
}
QString UBTeacherStudentAction::text()
{
QString str;
if(NULL != mpText){
str = mpText->document()->toPlainText();
}
return str;
}
QString UBTeacherStudentAction::comboValue()
{
QString str;
if(NULL != mpCombo){
str = QString("%0").arg(mpCombo->currentIndex());
}
return str;
}
void UBTeacherStudentAction::setComboValue(int value)
{
if(NULL != mpCombo){
mpCombo->setCurrentIndex(value);
}
}
void UBTeacherStudentAction::setText(const QString& text)
{
if(NULL != mpText){
mpText->document()->setPlainText(text);
}
}