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) ...@@ -388,7 +388,7 @@ void UBTeacherGuidePresentationWidget::showData(QVector<tUBGEElementNode*> data)
newWidgetItem->setText(0,element->attributes.value("task")); newWidgetItem->setText(0,element->attributes.value("task"));
QString colorString = element->attributes.value("owner").toInt() == 0 ? "red":"green"; QString colorString = element->attributes.value("owner").toInt() == 0 ? "red":"green";
UBTGAdaptableText* textWidget = new UBTGAdaptableText(newWidgetItem,0); UBTGAdaptableText* textWidget = new UBTGAdaptableText(newWidgetItem,0);
textWidget->bottomMargin(15); textWidget->bottomMargin(14);
textWidget->setStyleSheet("QWidget {background: #EEEEEE; border:none; color:" + colorString + ";}"); textWidget->setStyleSheet("QWidget {background: #EEEEEE; border:none; color:" + colorString + ";}");
textWidget->showText(element->attributes.value("task")); textWidget->showText(element->attributes.value("task"));
textWidget->document()->setDefaultFont(QFont(QApplication::font().family(),11)); textWidget->document()->setDefaultFont(QFont(QApplication::font().family(),11));
......
...@@ -194,6 +194,12 @@ void UBTGAdaptableText::bottomMargin(int newValue) ...@@ -194,6 +194,12 @@ void UBTGAdaptableText::bottomMargin(int newValue)
onTextChanged(); onTextChanged();
} }
void UBTGAdaptableText::resizeEvent(QResizeEvent* e)
{
QTextEdit::resizeEvent(e);
onTextChanged();
}
/*************************************************************************** /***************************************************************************
* class UBTGMediaWidget * * class UBTGMediaWidget *
***************************************************************************/ ***************************************************************************/
......
...@@ -99,6 +99,7 @@ protected: ...@@ -99,6 +99,7 @@ protected:
void keyPressEvent(QKeyEvent* e); void keyPressEvent(QKeyEvent* e);
void keyReleaseEvent(QKeyEvent* e); void keyReleaseEvent(QKeyEvent* e);
void showEvent(QShowEvent* e); void showEvent(QShowEvent* e);
void resizeEvent(QResizeEvent* e);
private: private:
int mBottomMargin; 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