UBTGAdaptableText handling the resize event

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent c4a694e73f
commit a358223478
  1. 2
      src/gui/UBTeacherGuideWidget.cpp
  2. 6
      src/gui/UBTeacherGuideWidgetsTools.cpp
  3. 1
      src/gui/UBTeacherGuideWidgetsTools.h

@ -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;

Loading…
Cancel
Save