Commit a3582234 authored by Claudio Valerio's avatar Claudio Valerio

UBTGAdaptableText handling the resize event

parent c4a694e7
......@@ -388,7 +388,7 @@ void UBTeacherGuidePresentationWidget::showData(QVector<tUBGEElementNode*> data)
newWidgetItem->setText(0,element->attributes.value("task"));
QString colorString = element->attributes.value("owner").toInt() == 0 ? "red":"green";
UBTGAdaptableText* textWidget = new UBTGAdaptableText(newWidgetItem,0);
textWidget->bottomMargin(15);
textWidget->bottomMargin(14);
textWidget->setStyleSheet("QWidget {background: #EEEEEE; border:none; color:" + colorString + ";}");
textWidget->showText(element->attributes.value("task"));
textWidget->document()->setDefaultFont(QFont(QApplication::font().family(),11));
......
......@@ -194,6 +194,12 @@ void UBTGAdaptableText::bottomMargin(int newValue)
onTextChanged();
}
void UBTGAdaptableText::resizeEvent(QResizeEvent* e)
{
QTextEdit::resizeEvent(e);
onTextChanged();
}
/***************************************************************************
* class UBTGMediaWidget *
***************************************************************************/
......
......@@ -99,6 +99,7 @@ protected:
void keyPressEvent(QKeyEvent* e);
void keyReleaseEvent(QKeyEvent* e);
void showEvent(QShowEvent* e);
void resizeEvent(QResizeEvent* e);
private:
int mBottomMargin;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment