From 59d6018e53537e15d27cd0174adefba2ec8b8f6e Mon Sep 17 00:00:00 2001 From: ibotty Date: Mon, 14 Oct 2002 08:54:34 +0000 Subject: added sizeHint method, hopefully (dont really think so) fixes size problem VS: ---------------------------------------------------------------------- --- (limited to 'noncore/apps') diff --git a/noncore/apps/opie-console/emulation_widget.cpp b/noncore/apps/opie-console/emulation_widget.cpp index e11c5e4..40199fa 100644 --- a/noncore/apps/opie-console/emulation_widget.cpp +++ b/noncore/apps/opie-console/emulation_widget.cpp @@ -90,6 +90,13 @@ static QChar vt100extended(QChar c) } +QSize EmulationWidget::calcSize( int cols, int lins ) const +{ + int frw = width() - contentsRect().width(); + int frh = height() - contentsRect().height(); + int scw = (scrollLoc == SCRNONE? 0 : m_scrollbar->width() ); + return QSize( f_width * cols + 2 * rimX + frw + scw, f_height * lins + 2 * rimY + frh ); +} void EmulationWidget::setImage( QArray const newimg, int lines, int columns ) { @@ -117,7 +124,7 @@ void EmulationWidget::setImage( QArray const newimg, int lines, int c for ( int y = 0; y < lins; ++y ) { int len; const Character* lcl = &m_image[y * m_columns]; - const Character* ext = &newimg[y * columns]; + const Character* ext = &newimg[y * m_columns]; if ( ! m_resizing ) for ( int x = 0; x < cols; ++x ) { diff --git a/noncore/apps/opie-console/emulation_widget.h b/noncore/apps/opie-console/emulation_widget.h index e185534..5e20dc4 100644 --- a/noncore/apps/opie-console/emulation_widget.h +++ b/noncore/apps/opie-console/emulation_widget.h @@ -60,6 +60,8 @@ public: */ virtual void scroll( int value ); + virtual QSize calcSize( int cols, int lins ) const; + protected: /** diff --git a/noncore/apps/opie-console/widget_layer.cpp b/noncore/apps/opie-console/widget_layer.cpp index e4b0ede..ac84f8b 100644 --- a/noncore/apps/opie-console/widget_layer.cpp +++ b/noncore/apps/opie-console/widget_layer.cpp @@ -53,6 +53,12 @@ WidgetLayer::~WidgetLayer() } +QSize WidgetLayer::sizeHint() +{ + return size(); +} + + /* --------------------------------- audio ---------------------------------- */ void WidgetLayer::bell() diff --git a/noncore/apps/opie-console/widget_layer.h b/noncore/apps/opie-console/widget_layer.h index 0c290f3..6812711 100644 --- a/noncore/apps/opie-console/widget_layer.h +++ b/noncore/apps/opie-console/widget_layer.h @@ -123,6 +123,11 @@ public: virtual bool eventFilter( QObject *obj, QEvent *event ); + + + QSize sizeHint(); + + virtual QSize calcSize( int cols, int lins ) const = 0; signals: /** -- cgit v0.9.0.2