From: bernie Date: Wed, 6 Aug 2008 11:56:27 +0000 (+0000) Subject: Fix size hinting for LCD widget X-Git-Tag: 2.0.0~378 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=12d9dad31b996e2787aef90dbafb18ecd52321ad;p=bertos.git Fix size hinting for LCD widget git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1556 38d2e660-2303-0410-9eaa-f027e97ec537 --- 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"));