--- qsampler/trunk/src/qsamplerMessages.cpp 2005/01/12 11:05:44 339 +++ qsampler/trunk/src/qsamplerMessages.cpp 2007/10/28 23:30:36 1461 @@ -1,7 +1,7 @@ // qsamplerMessages.cpp // /**************************************************************************** - Copyright (C) 2003-2005, rncbc aka Rui Nuno Capela. All rights reserved. + Copyright (C) 2004-2007, rncbc aka Rui Nuno Capela. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -13,9 +13,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *****************************************************************************/ @@ -28,6 +28,9 @@ #include #include +#include +#include + #include "config.h" #if !defined(WIN32) @@ -49,7 +52,7 @@ // Constructor. qsamplerMessages::qsamplerMessages ( QWidget *pParent, const char *pszName ) - : QDockWindow(pParent, pszName) + : QDockWidget(pszName, pParent) { // Intialize stdout capture stuff. m_pStdoutNotifier = NULL; @@ -58,14 +61,14 @@ // Surely a name is crucial (e.g.for storing geometry settings) if (pszName == 0) - QDockWindow::setName("qsamplerMessages"); + QDockWidget::setName("qsamplerMessages"); // Create local text view widget. m_pTextView = new QTextEdit(this); // QFont font(m_pTextView->font()); // font.setFamily("Fixed"); // m_pTextView->setFont(font); - m_pTextView->setWordWrap(QTextEdit::NoWrap); + m_pTextView->setWordWrapMode(QTextOption::NoWrap); m_pTextView->setReadOnly(true); m_pTextView->setUndoRedoEnabled(false); #if QT_VERSION >= 0x030200 @@ -75,15 +78,19 @@ setMessagesLimit(QSAMPLER_MESSAGES_MAXLINES); // Prepare the dockable window stuff. - QDockWindow::setWidget(m_pTextView); - QDockWindow::setOrientation(Qt::Horizontal); - QDockWindow::setCloseMode(QDockWindow::Always); - QDockWindow::setResizeEnabled(true); + QDockWidget::setWidget(m_pTextView); + //QDockWidget::setOrientation(Qt::Horizontal); + QDockWidget::setFeatures( + QDockWidget::DockWidgetClosable + ); + //QDockWidget::setResizeEnabled(true); + // Some specialties to this kind of dock window... + //QDockWidget::setFixedExtentHeight(120); // Finally set the default caption and tooltip. QString sCaption = tr("Messages"); QToolTip::add(this, sCaption); - QDockWindow::setCaption(sCaption); + QDockWidget::setWindowIconText(sCaption); } @@ -198,7 +205,7 @@ m_iMessagesLimit = iMessagesLimit; m_iMessagesHigh = iMessagesLimit + (iMessagesLimit / 3); #if QT_VERSION >= 0x030200 - m_pTextView->setMaxLogLines(iMessagesLimit); + //m_pTextView->setMaxLogLines(iMessagesLimit); #endif } @@ -239,7 +246,8 @@ void qsamplerMessages::scrollToBottom (void) { flushStdoutBuffer(); - m_pTextView->scrollToBottom(); + //m_pTextView->scrollToBottom(); + m_pTextView->verticalScrollBar()->setValue(m_pTextView->verticalScrollBar()->maximum()); }