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")); 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)
onTextChanged(); onTextChanged();
} }
void UBTGAdaptableText::resizeEvent(QResizeEvent* e)
{
QTextEdit::resizeEvent(e);
onTextChanged();
}
/*************************************************************************** /***************************************************************************
* class UBTGMediaWidget * * class UBTGMediaWidget *
***************************************************************************/ ***************************************************************************/

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

Loading…
Cancel
Save