statustext.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           statustext.cpp  -  description
00003                              -------------------
00004     begin                : Thu Jul 28 2005
00005     copyright            : (C) 2005-2006 by Ben Swerts
00006     email                : bswerts@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00019 
00025 
00026 
00027 
00029 
00030 // Qt header files
00031 
00032 // Xbrabo header files
00033 #include "statustext.h"
00034 
00038 
00040 StatusText::StatusText(QWidget* parent, const char* name) : QTextEdit(parent, name)
00042 {
00043   // Basic setup
00044   setSizePolicy(QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding, false));
00045   setReadOnly(true);
00046   setTextFormat(Qt::LogText);
00047   setMaxLogLines(2000);
00048   setWordWrap(QTextEdit::NoWrap);
00049 
00050   // A fixed pitch font?
00051   QFont font = currentFont();
00052   font.setStyleHint(QFont::TypeWriter); // does nothing on X11 by definition
00053   font.setFixedPitch(true);
00054   setFont(font); // can't get a fixed pitch font in this way on Windows
00055 }
00056 
00058 StatusText::~StatusText()
00060 {
00061 
00062 }
00063 
00067 
00069 void StatusText::append(const QString& text)
00072 {
00073   QTextEdit::append(text);
00074   scrollToBottom();
00075 }
00076 
00080 
00082 QPopupMenu* StatusText::createPopupMenu(const QPoint&)
00086 {
00087   emit rightButtonClicked();
00088   return 0;
00089 }
00090 

Generated on Fri May 19 14:31:56 2006 for Brabosphere by  doxygen 1.4.6-NO