From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ksirc/kstextviewtest.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 ksirc/kstextviewtest.cpp (limited to 'ksirc/kstextviewtest.cpp') diff --git a/ksirc/kstextviewtest.cpp b/ksirc/kstextviewtest.cpp new file mode 100644 index 00000000..f3326351 --- /dev/null +++ b/ksirc/kstextviewtest.cpp @@ -0,0 +1,51 @@ +#include + +#include "kstextview.h" + + +class Timer : public QObject +{ +public: + Timer( KSirc::TextView *view ) + : m_view( view ), m_lines( 0 ) + { + //startTimer( 5000 ); + } + void timerEvent( QTimerEvent * ) + { + m_lines++; + if ( m_lines > 15 ) + m_view->removeParag( m_view->firstParag() ); + m_view->appendParag( QString::fromLatin1( "color testcolor testcolor testcolor testcolor testcolor testcolor testcolor testcolor test" ) ); + m_view->appendParag( QString::fromLatin1( "aaaaaa bbbbbb cccccccc ddddddddd eeeeeee " ) ); + m_view->setContentsPos( 0, m_view->contentsHeight() ); + } +private: + KSirc::TextView *m_view; + int m_lines; +}; + +int main( int argc, char **argv ) +{ + KApplication app( argc, argv, "kstextviewtest" ); + + KSirc::TextView view( 0 ); + app.setMainWidget( &view ); + + view.show(); + view.appendParag( QString::fromLatin1( "boldNormalItalic hey!reverse!" ) ); + view.appendParag( QString::fromLatin1( "bleh foo hey bar schubidu bliep blop" ) ); + view.appendParag( QString::fromLatin1( "more longish paragraphs .. yaddayadda yadda" ) ); + view.appendParag( QString::fromLatin1( "<tronical> hah! &" ) ); + view.appendParag( QString::fromLatin1( "url" ) ); + view.appendParag( QString::fromLatin1( "color test" ) ); + view.appendParag( QString::fromLatin1( "another color test" ) ); + view.appendParag( QString::fromLatin1( "another color test" ) ); + view.appendParag( QString::fromLatin1( "simple attr test 123 \" oof>complicated attr test" ) ); + view.appendParag( QString::fromLatin1( "\" 123 \" oof>\"third attr test 2\"" ) ); + view.appendParag( QString::fromLatin1( "aaaaaa bbbbbb cccccccc ddddddddd eeeeeee" ) ); + Timer t( &view ); + + return app.exec(); +} + -- cgit v1.2.1