summaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-05-20 16:43:10 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-05-20 16:43:10 (GMT)
commitbfde87dcc8d0f363ecf1da59482c15445b00484c (patch)
tree0d0c01b1611caf91ba900bd2b67a8806590254cc /demos
parent27fadaa7eb2d58b47e7f0f508e3402e7a8de3894 (diff)
parentf9d26f0bebd5bcc32d15c4a627251c44cf78389e (diff)
downloadQt-bfde87dcc8d0f363ecf1da59482c15445b00484c.zip
Qt-bfde87dcc8d0f363ecf1da59482c15445b00484c.tar.gz
Qt-bfde87dcc8d0f363ecf1da59482c15445b00484c.tar.bz2
Merge commit 'qt/master'
Diffstat (limited to 'demos')
-rw-r--r--demos/boxes/glextensions.h7
-rw-r--r--demos/chip/chip.cpp17
-rw-r--r--demos/demos.pro2
3 files changed, 15 insertions, 11 deletions
diff --git a/demos/boxes/glextensions.h b/demos/boxes/glextensions.h
index 4755532..af36e29 100644
--- a/demos/boxes/glextensions.h
+++ b/demos/boxes/glextensions.h
@@ -103,8 +103,11 @@ glUnmapBuffer
//#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
#endif
+#ifndef GL_ARB_vertex_buffer_object
+typedef ptrdiff_t GLsizeiptrARB;
+#endif
+
#ifndef GL_VERSION_1_5
-typedef ptrdiff_t GLsizeiptr;
#define GL_ARRAY_BUFFER 0x8892
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
#define GL_READ_WRITE 0x88BA
@@ -135,7 +138,7 @@ typedef void (APIENTRY *_glTexImage3D) (GLenum, GLint, GLenum, GLsizei, GLsizei,
typedef void (APIENTRY *_glGenBuffers) (GLsizei, GLuint *);
typedef void (APIENTRY *_glBindBuffer) (GLenum, GLuint);
-typedef void (APIENTRY *_glBufferData) (GLenum, GLsizeiptr, const GLvoid *, GLenum);
+typedef void (APIENTRY *_glBufferData) (GLenum, GLsizeiptrARB, const GLvoid *, GLenum);
typedef void (APIENTRY *_glDeleteBuffers) (GLsizei, const GLuint *);
typedef void *(APIENTRY *_glMapBuffer) (GLenum, GLenum);
typedef GLboolean (APIENTRY *_glUnmapBuffer) (GLenum);
diff --git a/demos/chip/chip.cpp b/demos/chip/chip.cpp
index c2b22da..4b6579e 100644
--- a/demos/chip/chip.cpp
+++ b/demos/chip/chip.cpp
@@ -74,8 +74,9 @@ void Chip::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
if (option->state & QStyle::State_MouseOver)
fillColor = fillColor.light(125);
- if (option->levelOfDetail < 0.2) {
- if (option->levelOfDetail < 0.125) {
+ const qreal lod = option->levelOfDetailFromTransform(painter->worldTransform());
+ if (lod < 0.2) {
+ if (lod < 0.125) {
painter->fillRect(QRectF(0, 0, 110, 70), fillColor);
return;
}
@@ -100,7 +101,7 @@ void Chip::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
painter->drawRect(QRect(14, 14, 79, 39));
painter->setBrush(b);
- if (option->levelOfDetail >= 1) {
+ if (lod >= 1) {
painter->setPen(QPen(Qt::gray, 1));
painter->drawLine(15, 54, 94, 54);
painter->drawLine(94, 53, 94, 15);
@@ -108,7 +109,7 @@ void Chip::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
}
// Draw text
- if (option->levelOfDetail >= 2) {
+ if (lod >= 2) {
QFont font("Times", 10);
font.setStyleStrategy(QFont::ForceOutline);
painter->setFont(font);
@@ -122,17 +123,17 @@ void Chip::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
// Draw lines
QVarLengthArray<QLineF, 36> lines;
- if (option->levelOfDetail >= 0.5) {
- for (int i = 0; i <= 10; i += (option->levelOfDetail > 0.5 ? 1 : 2)) {
+ if (lod >= 0.5) {
+ for (int i = 0; i <= 10; i += (lod > 0.5 ? 1 : 2)) {
lines.append(QLineF(18 + 7 * i, 13, 18 + 7 * i, 5));
lines.append(QLineF(18 + 7 * i, 54, 18 + 7 * i, 62));
}
- for (int i = 0; i <= 6; i += (option->levelOfDetail > 0.5 ? 1 : 2)) {
+ for (int i = 0; i <= 6; i += (lod > 0.5 ? 1 : 2)) {
lines.append(QLineF(5, 18 + i * 5, 13, 18 + i * 5));
lines.append(QLineF(94, 18 + i * 5, 102, 18 + i * 5));
}
}
- if (option->levelOfDetail >= 0.4) {
+ if (lod >= 0.4) {
const QLineF lineData[] = {
QLineF(25, 35, 35, 35),
QLineF(35, 30, 35, 40),
diff --git a/demos/demos.pro b/demos/demos.pro
index 9248ab8..6084550 100644
--- a/demos/demos.pro
+++ b/demos/demos.pro
@@ -30,7 +30,7 @@ contains(QT_BUILD_PARTS, tools):{
wince*: SUBDIRS += demos_sqlbrowser
}
}
-contains(QT_CONFIG, phonon)!static:SUBDIRS += demos_mediaplayer
+contains(QT_CONFIG, phonon):!static:SUBDIRS += demos_mediaplayer
contains(QT_CONFIG, webkit):contains(QT_CONFIG, svg):SUBDIRS += demos_browser
# install