summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-04-28 23:36:44 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-04-28 23:36:44 (GMT)
commit6ba666275f7f6a2e64b1cd4f3f5ec7477150c392 (patch)
tree971e312fe4a1dfe2b59a37b7f306ab05210b3097
parente65477020b0b70c105606bab3d6c43fbde027117 (diff)
parentbad50f8a2ef285aa9943291400cd322a6ec7af82 (diff)
downloadQt-6ba666275f7f6a2e64b1cd4f3f5ec7477150c392.zip
Qt-6ba666275f7f6a2e64b1cd4f3f5ec7477150c392.tar.gz
Qt-6ba666275f7f6a2e64b1cd4f3f5ec7477150c392.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
-rw-r--r--demos/qtdemo/colors.cpp7
-rw-r--r--demos/qtdemo/colors.h2
-rw-r--r--demos/qtdemo/mainwindow.cpp7
-rw-r--r--src/corelib/kernel/qvariant.cpp5
-rw-r--r--src/gui/dialogs/qfilesystemmodel_p.h18
-rw-r--r--src/gui/styles/qcommonstyle.cpp4
-rw-r--r--src/gui/widgets/qtabbar.cpp4
7 files changed, 29 insertions, 18 deletions
diff --git a/demos/qtdemo/colors.cpp b/demos/qtdemo/colors.cpp
index bc16296..733b285 100644
--- a/demos/qtdemo/colors.cpp
+++ b/demos/qtdemo/colors.cpp
@@ -73,7 +73,7 @@ int Colors::contentHeight = 510;
// Properties:
bool Colors::openGlRendering = false;
bool Colors::softwareRendering = false;
-bool Colors::openGlAwailable = true;
+bool Colors::openGlAvailable = true;
bool Colors::xRenderPresent = true;
bool Colors::noTicker = false;
@@ -286,7 +286,6 @@ void Colors::parseArgs(int argc, char *argv[])
void Colors::setLowSettings()
{
Colors::openGlRendering = false;
- Colors::direct3dRendering = false;
Colors::softwareRendering = true;
Colors::noTicker = true;
Colors::noTimerUpdate = true;
@@ -321,7 +320,7 @@ void Colors::detectSystemResources()
qDebug() << "- OpenGL not supported by current build of Qt";
#endif
{
- Colors::openGlAwailable = false;
+ Colors::openGlAvailable = false;
if (Colors::verbose)
qDebug("- OpenGL not recommended on this system");
}
@@ -363,7 +362,7 @@ void Colors::postConfigure()
if (!Colors::openGlRendering && !Colors::softwareRendering){
// The user has not decided rendering system. So we do it instead:
- if (Colors::openGlAwailable)
+ if (Colors::openGlAvailable)
Colors::openGlRendering = true;
else
Colors::softwareRendering = true;
diff --git a/demos/qtdemo/colors.h b/demos/qtdemo/colors.h
index b725885..31eb93b 100644
--- a/demos/qtdemo/colors.h
+++ b/demos/qtdemo/colors.h
@@ -81,9 +81,9 @@ public:
static int contentHeight;
// properties:
+ static bool openGlAvailable;
static bool openGlRendering;
static bool softwareRendering;
- static bool direct3dAwailable;
static bool xRenderPresent;
static bool noAdapt;
static bool noTicker;
diff --git a/demos/qtdemo/mainwindow.cpp b/demos/qtdemo/mainwindow.cpp
index 151fa5c..0da69b2 100644
--- a/demos/qtdemo/mainwindow.cpp
+++ b/demos/qtdemo/mainwindow.cpp
@@ -101,7 +101,7 @@ void MainWindow::setRenderingSystem()
QWidget *viewport = 0;
#ifndef QT_NO_OPENGL
- else if (Colors::openGlRendering){
+ if (Colors::openGlRendering) {
QGLWidget *glw = new QGLWidget(QGLFormat(QGL::SampleBuffers));
if (Colors::noScreenSync)
glw->format().setSwapInterval(0);
@@ -110,9 +110,10 @@ void MainWindow::setRenderingSystem()
setCacheMode(QGraphicsView::CacheNone);
if (Colors::verbose)
qDebug() << "- using OpenGL";
- }
+ } else // software rendering
#endif
- else{ // software rendering
+ {
+ // software rendering
viewport = new QWidget;
setCacheMode(QGraphicsView::CacheBackground);
if (Colors::verbose)
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index ff59540..b53e91f 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -2558,10 +2558,11 @@ static const quint32 qCanConvertMatrix[QVariant::LastCoreType + 1] =
bool QVariant::canConvert(Type t) const
{
//we can treat floats as double
- //the reason for not doing it the "proper" way is that QMetaTye Float's value is 135,
+ //the reason for not doing it the "proper" way is that QMetaType::Float's value is 135,
//which can't be handled by qCanConvertMatrix
+ //In addition QVariant::Type doesn't have a Float value, so we're using QMetaType::Float
const uint currentType = ((d.type == QMetaType::Float) ? QVariant::Double : d.type);
- if (t == QMetaType::Float) t = QVariant::Double;
+ if (uint(t) == uint(QMetaType::Float)) t = QVariant::Double;
if (currentType == uint(t))
return true;
diff --git a/src/gui/dialogs/qfilesystemmodel_p.h b/src/gui/dialogs/qfilesystemmodel_p.h
index 0a1265a..61e8b4c 100644
--- a/src/gui/dialogs/qfilesystemmodel_p.h
+++ b/src/gui/dialogs/qfilesystemmodel_p.h
@@ -164,9 +164,12 @@ public:
QHash<QString, QFileSystemNode *>::const_iterator iterator;
for(iterator = children.constBegin() ; iterator != children.constEnd() ; ++iterator) {
//On windows the root (My computer) has no path so we don't want to add a / for nothing (e.g. /C:/)
- if (!path.isEmpty())
- iterator.value()->updateIcon(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName);
- else
+ if (!path.isEmpty()) {
+ if (path.endsWith(QLatin1Char('/')))
+ iterator.value()->updateIcon(iconProvider, path + iterator.value()->fileName);
+ else
+ iterator.value()->updateIcon(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName);
+ } else
iterator.value()->updateIcon(iconProvider, iterator.value()->fileName);
}
}
@@ -177,9 +180,12 @@ public:
QHash<QString, QFileSystemNode *>::const_iterator iterator;
for(iterator = children.constBegin() ; iterator != children.constEnd() ; ++iterator) {
//On windows the root (My computer) has no path so we don't want to add a / for nothing (e.g. /C:/)
- if (!path.isEmpty())
- iterator.value()->retranslateStrings(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName);
- else
+ if (!path.isEmpty()) {
+ if (path.endsWith(QLatin1Char('/')))
+ iterator.value()->retranslateStrings(iconProvider, path + iterator.value()->fileName);
+ else
+ iterator.value()->retranslateStrings(iconProvider, path + QLatin1Char('/') + iterator.value()->fileName);
+ } else
iterator.value()->retranslateStrings(iconProvider, iterator.value()->fileName);
}
}
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index be80d37..f8ae1a6 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -2019,7 +2019,9 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
: QIcon::Disabled);
QPixmap tabIcon = tabV2.icon.pixmap(iconSize,
(tabV2.state & State_Enabled) ? QIcon::Normal
- : QIcon::Disabled);
+ : QIcon::Disabled,
+ (tabV2.state & State_Selected) ? QIcon::On
+ : QIcon::Off);
int offset = 6;
int left = opt->rect.left();
diff --git a/src/gui/widgets/qtabbar.cpp b/src/gui/widgets/qtabbar.cpp
index b562b1f..49de8c1 100644
--- a/src/gui/widgets/qtabbar.cpp
+++ b/src/gui/widgets/qtabbar.cpp
@@ -1941,8 +1941,10 @@ void QTabBar::changeEvent(QEvent *event)
if (event->type() == QEvent::StyleChange) {
d->elideMode = Qt::TextElideMode(style()->styleHint(QStyle::SH_TabBar_ElideMode, 0, this));
d->useScrollButtons = !style()->styleHint(QStyle::SH_TabBar_PreferNoArrows, 0, this);
+ d->refresh();
+ } else if (event->type() == QEvent::FontChange) {
+ d->refresh();
}
- d->refresh();
QWidget::changeEvent(event);
}