Handle QTextBrowser widget class when set/get widget text.

git-svn-id: http://yate.null.ro/svn/yate/trunk@3974 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2010-12-17 14:08:44 +00:00
parent 296b165655
commit 12612be180
1 changed files with 7 additions and 1 deletions

View File

@ -70,7 +70,8 @@ public:
SpinBox = 13,
Calendar = 14,
Splitter = 15,
Unknown = 16, // Unknown type
TextBrowser = 16,
Unknown, // Unknown type
Action, // QAction descendant
CustomTable, // QtTable descendant
CustomTree, // QtTree descendant
@ -429,6 +430,7 @@ String QtWidget::s_types[QtWidget::Unknown] = {
"QSpinBox",
"QCalendarWidget",
"QSplitter",
"QTextBrowser",
};
// QVariant type translation dictionary
@ -1154,6 +1156,7 @@ bool QtWindow::setText(const String& name, const String& text,
case QtWidget::LineEdit:
w.lineEdit()->setText(QtClient::setUtf8(text));
return true;
case QtWidget::TextBrowser:
case QtWidget::TextEdit:
if (richText) {
w.textEdit()->clear();
@ -1418,6 +1421,7 @@ bool QtWindow::addLines(const String& name, const NamedList* lines, unsigned int
return true;
switch (w.type()) {
case QtWidget::TextBrowser:
case QtWidget::TextEdit:
// Limit the maximum number of paragraphs
if (max) {
@ -1787,6 +1791,7 @@ bool QtWindow::clearTable(const String& name)
case QtWidget::Table:
w.table()->setRowCount(0);
break;
case QtWidget::TextBrowser:
case QtWidget::TextEdit:
w.textEdit()->clear();
break;
@ -1821,6 +1826,7 @@ bool QtWindow::getText(const String& name, String& text, bool richText)
case QtWidget::LineEdit:
QtClient::getUtf8(text,w.lineEdit()->text());
return true;
case QtWidget::TextBrowser:
case QtWidget::TextEdit:
if (!richText)
QtClient::getUtf8(text,w.textEdit()->toPlainText());