|
|
@ -386,10 +386,14 @@ void UBTeacherGuidePresentationWidget::showData(QVector<tUBGEElementNode*> data) |
|
|
|
else if(element->type == "action"){ |
|
|
|
else if(element->type == "action"){ |
|
|
|
QTreeWidgetItem* newWidgetItem = new QTreeWidgetItem(mpRootWidgetItem); |
|
|
|
QTreeWidgetItem* newWidgetItem = new QTreeWidgetItem(mpRootWidgetItem); |
|
|
|
newWidgetItem->setText(0,element->attributes.value("task")); |
|
|
|
newWidgetItem->setText(0,element->attributes.value("task")); |
|
|
|
QColor color = element->attributes.value("owner").toInt() == 0 ? QColor(Qt::red):QColor(Qt::green); |
|
|
|
QString colorString = element->attributes.value("owner").toInt() == 0 ? "red":"green"; |
|
|
|
newWidgetItem->setData(0,Qt::ForegroundRole,QBrush(color)); |
|
|
|
UBTGAdaptableText* textWidget = new UBTGAdaptableText(newWidgetItem,0); |
|
|
|
newWidgetItem->setData(0,tUBTGTreeWidgetItemRole_HasAnAction,tUBTGActionAssociateOnClickItem_NONE); |
|
|
|
textWidget->bottomMargin(15); |
|
|
|
newWidgetItem->setData(0,Qt::FontRole, QVariant(QFont(QApplication::font().family(),11))); |
|
|
|
textWidget->setStyleSheet("QWidget {background: #EEEEEE; border:none; color:" + colorString + ";}"); |
|
|
|
|
|
|
|
textWidget->showText(element->attributes.value("task")); |
|
|
|
|
|
|
|
textWidget->document()->setDefaultFont(QFont(QApplication::font().family(),11)); |
|
|
|
|
|
|
|
mpTreeWidget->setItemWidget(newWidgetItem,0,textWidget); |
|
|
|
|
|
|
|
|
|
|
|
mpRootWidgetItem->addChild(newWidgetItem); |
|
|
|
mpRootWidgetItem->addChild(newWidgetItem); |
|
|
|
} |
|
|
|
} |
|
|
|
else if(element->type == "media"){ |
|
|
|
else if(element->type == "media"){ |
|
|
|