From 12d9dad31b996e2787aef90dbafb18ecd52321ad Mon Sep 17 00:00:00 2001 From: bernie Date: Wed, 6 Aug 2008 11:56:27 +0000 Subject: [PATCH] Fix size hinting for LCD widget git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1556 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/drv/lcd_gfx_qt.cpp | 4 ++++ bertos/drv/lcd_gfx_qt.h | 3 ++- bertos/emul/emulwin.cpp | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bertos/drv/lcd_gfx_qt.cpp b/bertos/drv/lcd_gfx_qt.cpp index 5e862dbb..551b48e5 100644 --- a/bertos/drv/lcd_gfx_qt.cpp +++ b/bertos/drv/lcd_gfx_qt.cpp @@ -85,6 +85,10 @@ QSize EmulLCD::sizeHint() const HEIGHT + frame_width * 2); } +QSize EmulLCD::minimumSizeHint() const +{ + return sizeHint(); +} void EmulLCD::paintEvent(QPaintEvent * /*event*/) { diff --git a/bertos/drv/lcd_gfx_qt.h b/bertos/drv/lcd_gfx_qt.h index 9101db52..93499a24 100644 --- a/bertos/drv/lcd_gfx_qt.h +++ b/bertos/drv/lcd_gfx_qt.h @@ -84,6 +84,7 @@ public: protected: virtual QSizePolicy sizePolicy() const; virtual QSize sizeHint() const; + virtual QSize minimumSizeHint() const; virtual void paintEvent(QPaintEvent *event); // Operations @@ -99,7 +100,7 @@ protected: QColor fg_color, bg_color; /// Pixel storage - unsigned char raster[(WIDTH * HEIGHT) / 8]; + unsigned char raster[(WIDTH + 7 / 8) * HEIGHT]; }; #endif // DRV_LCD_GFX_QT_H diff --git a/bertos/emul/emulwin.cpp b/bertos/emul/emulwin.cpp index fdd088f1..f7dc84d0 100644 --- a/bertos/emul/emulwin.cpp +++ b/bertos/emul/emulwin.cpp @@ -62,7 +62,6 @@ EmulWin::EmulWin(Emulator *e) { setWindowTitle(tr("BeRTOS Emul Demo")); setAttribute(Qt::WA_DeleteOnClose); - setFixedSize(280,240); // Create the menu bar QMenu *file_menu = menuBar()->addMenu(tr("&File")); -- 2.25.1