From eae9fffeaa7c54d92d219a84fde1ff7bf49fc35a Mon Sep 17 00:00:00 2001 From: marian Date: Tue, 7 Oct 2008 15:39:47 +0000 Subject: [PATCH] Handle spin boxes in set/get text. git-svn-id: http://yate.null.ro/svn/yate/trunk@2254 acf43c95-373e-0410-b603-e72c3f656dc1 --- clients/qt4/qt4client.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/clients/qt4/qt4client.cpp b/clients/qt4/qt4client.cpp index 62428ee8..11b73fb6 100644 --- a/clients/qt4/qt4client.cpp +++ b/clients/qt4/qt4client.cpp @@ -69,7 +69,8 @@ public: AbstractButton = 10, Slider = 11, ProgressBar = 12, - Unknown = 13, // Unknown type + SpinBox = 13, + Unknown = 14, // Unknown type Action, // QAction descendant CustomTable, // QtTable descendant Missing // Invalid pointer @@ -143,6 +144,8 @@ public: { return static_cast(m_widget); } inline QProgressBar* progressBar() { return static_cast(m_widget); } + inline QSpinBox* spinBox() + { return static_cast(m_widget); } inline QtTable* customTable() { return qobject_cast(m_widget); } inline QAction* action() @@ -301,7 +304,8 @@ String QtWidget::s_types[QtWidget::Unknown] = { "QLineEdit", "QAbstractButton", "QSlider", - "QProgressBar" + "QProgressBar", + "QSpinBox" }; // Connect a sender's signal to a receiver's slot @@ -717,6 +721,9 @@ bool QtWindow::setText(const String& name, const String& text, case QtWidget::Action: w.action()->setText(QtClient::setUtf8(text)); return true; + case QtWidget::SpinBox: + w.spinBox()->setValue(text.toInteger()); + return true; } // Handle some known base classes having a setText() method @@ -1282,6 +1289,9 @@ bool QtWindow::getText(const String& name, String& text, bool richText) case QtWidget::Action: QtClient::getUtf8(text,w.action()->text()); return true; + case QtWidget::SpinBox: + text = w.spinBox()->value(); + return true; default: if (w.inherits(QtWidget::AbstractButton)) { QtClient::getUtf8(text,w.abstractButton()->text());