diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-05-22 04:41:04 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-05-22 04:41:04 (GMT) |
commit | ba9caa7181282109ea8def0994838b6538da0b13 (patch) | |
tree | f1ae3f595fe6f601ce411d69179d6c0c8c650386 /demos | |
parent | 2575eac4c26ad92dde95959a82f576edc3e76e1d (diff) | |
parent | f9d26f0bebd5bcc32d15c4a627251c44cf78389e (diff) | |
download | Qt-ba9caa7181282109ea8def0994838b6538da0b13.zip Qt-ba9caa7181282109ea8def0994838b6538da0b13.tar.gz Qt-ba9caa7181282109ea8def0994838b6538da0b13.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Conflicts:
src/corelib/kernel/kernel.pri
src/corelib/tools/tools.pri
tools/qdoc3/htmlgenerator.cpp
tools/qdoc3/htmlgenerator.h
Diffstat (limited to 'demos')
-rw-r--r-- | demos/boxes/glextensions.h | 7 | ||||
-rw-r--r-- | demos/chip/chip.cpp | 17 | ||||
-rw-r--r-- | demos/demos.pro | 2 |
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 |