Fix size hinting for LCD widget
authorbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 6 Aug 2008 11:56:27 +0000 (11:56 +0000)
committerbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 6 Aug 2008 11:56:27 +0000 (11:56 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1556 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/drv/lcd_gfx_qt.cpp
bertos/drv/lcd_gfx_qt.h
bertos/emul/emulwin.cpp

index 5e862dbb681878b46e47da50a7f0fd1a8f12df1e..551b48e548e8ac6be84849bdeb471b9d52e7fd3d 100644 (file)
@@ -85,6 +85,10 @@ QSize EmulLCD::sizeHint() const
                HEIGHT + frame_width * 2);
 }
 
+QSize EmulLCD::minimumSizeHint() const
+{
+       return sizeHint();
+}
 
 void EmulLCD::paintEvent(QPaintEvent * /*event*/)
 {
index 9101db52793ea5317231e6ea86393cac9dbb8f45..93499a24a58895d382c5dec93c94b58c22576bdc 100644 (file)
@@ -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
index fdd088f19dccbc514a51a62ea4505c472cfedc90..f7dc84d004f3a3d1309a6680c1c2436e2ea52a35 100644 (file)
@@ -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"));