projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
timer: Amend previous commit (and Subversion sucks)
[bertos.git]
/
bertos
/
drv
/
lcd_gfx_qt.cpp
diff --git
a/bertos/drv/lcd_gfx_qt.cpp
b/bertos/drv/lcd_gfx_qt.cpp
index 5e862dbb681878b46e47da50a7f0fd1a8f12df1e..8d04471e67df6e622e5d55cc63be3e6a14992822 100644
(file)
--- a/
bertos/drv/lcd_gfx_qt.cpp
+++ b/
bertos/drv/lcd_gfx_qt.cpp
@@
-26,15
+26,14
@@
* invalidate any other reasons why the executable file might be covered by
* the GNU General Public License.
*
* invalidate any other reasons why the executable file might be covered by
* the GNU General Public License.
*
- * Copyright 2006 Develer S.r.l. (http://www.develer.com/)
+ * Copyright 2006
, 2008
Develer S.r.l. (http://www.develer.com/)
*
* -->
*
* \version $Id$
*
* -->
*
* \version $Id$
- *
* \author Bernie Innocenti <bernie@codewiz.org>
*
* \author Bernie Innocenti <bernie@codewiz.org>
*
- * \brief Custom control for graphics LCD emulation (i
nterface
)
+ * \brief Custom control for graphics LCD emulation (i
mplementation
)
*/
#include "lcd_gfx_qt.h"
*/
#include "lcd_gfx_qt.h"
@@
-52,11
+51,14
@@
#define LCD_BG_COLOR 0xBB, 0xCC, 0xBB
#define LCD_BG_COLOR 0xBB, 0xCC, 0xBB
-EmulLCD::EmulLCD(QWidget *parent
, const char *name
) :
- QFrame(parent
, name, Qt::WRepaintNoErase | Qt::WResizeNoErase
),
+EmulLCD::EmulLCD(QWidget *parent) :
+ QFrame(parent),
fg_color(LCD_FG_COLOR),
fg_color(LCD_FG_COLOR),
- bg_
color(LCD_BG_COLOR
)
+ bg_
brush(QColor(LCD_BG_COLOR)
)
{
{
+ // Optimized rendering: we repaint everything anyway
+ setAttribute(Qt::WA_NoSystemBackground);
+
// initialize bitmap
memset(raster, 0xAA, sizeof(raster));
// initialize bitmap
memset(raster, 0xAA, sizeof(raster));
@@
-74,7
+76,7
@@
EmulLCD::~EmulLCD()
QSizePolicy EmulLCD::sizePolicy() const
{
QSizePolicy EmulLCD::sizePolicy() const
{
- return QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed,
fals
e);
+ return QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed,
QSizePolicy::Fram
e);
}
}
@@
-85,16
+87,20
@@
QSize EmulLCD::sizeHint() const
HEIGHT + frame_width * 2);
}
HEIGHT + frame_width * 2);
}
+QSize EmulLCD::minimumSizeHint() const
+{
+ return sizeHint();
+}
void EmulLCD::paintEvent(QPaintEvent * /*event*/)
{
QPainter p(this);
void EmulLCD::paintEvent(QPaintEvent * /*event*/)
{
QPainter p(this);
- QImage img(raster, WIDTH, HEIGHT,
1, NULL, 0, QImage::BigEndian
);
+ QImage img(raster, WIDTH, HEIGHT,
QImage::Format_Mono
);
p.setBackgroundMode(Qt::OpaqueMode);
p.setBackgroundMode(Qt::OpaqueMode);
+ p.setBackground(bg_brush);
p.setPen(fg_color);
p.setPen(fg_color);
- p.setBackgroundColor(bg_color);
- p.drawImage(frame_width, frame_width, img);
+ p.drawImage(QPoint(frame_width, frame_width), img);
}
void EmulLCD::writeRaster(uint8_t *new_raster)
}
void EmulLCD::writeRaster(uint8_t *new_raster)