summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-12-24 00:56:59 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-12-24 00:56:59 +0100
commitf0fbff4c905fd3e21d7aefedd45d98cc9dd54018 (patch)
treec61f47f858a9ac6183676bd7aee378a6a2b84a19 /src/gui
parentd776937df91e46536f404c6868d64016b6038d7b (diff)
parent0e1ce36ae67de940b2d499ec7f23e520dce0f112 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/doc/src/dnd.qdoc4
-rw-r--r--src/gui/image/qimage.h3
-rw-r--r--src/gui/image/qimagewriter.cpp14
-rw-r--r--src/gui/opengl/qopenglversionfunctions.cpp2
-rw-r--r--src/gui/text/qharfbuzzng.cpp2
-rw-r--r--src/gui/text/qplatformfontdatabase.cpp44
-rw-r--r--src/gui/text/qtextengine.cpp4
7 files changed, 56 insertions, 17 deletions
diff --git a/src/gui/doc/src/dnd.qdoc b/src/gui/doc/src/dnd.qdoc
index 1c6ca9c81c..9f7fdc7fbf 100644
--- a/src/gui/doc/src/dnd.qdoc
+++ b/src/gui/doc/src/dnd.qdoc
@@ -80,8 +80,8 @@
The rest of the document focuses mainly on how to implement drag and drop
in C++. For using drag and drop inside a Qt Quick scene, please read the
- documentation for the Qt Quick \l{Drag}, \l{DragEvent} and \l{DropArea} items.
- There is also an example \l{quick/draganddrop}{available}.
+ documentation for the Qt Quick \l{Drag}, \l{DragEvent}, and \l{DropArea} items,
+ as well as the \l {Qt Quick Examples - Drag and Drop}{Qt Quick Drag and Drop} examples.
\section1 Dragging
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h
index 02f0c18243..bc7f3729ad 100644
--- a/src/gui/image/qimage.h
+++ b/src/gui/image/qimage.h
@@ -327,6 +327,7 @@ inline void QImage::setPixel(const QPoint &pt, uint index_or_rgb) { setPixel(pt.
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif defined(Q_CC_MSVC)
+# pragma warning(push)
# pragma warning(disable: 4996)
#endif
@@ -403,7 +404,7 @@ inline void QImage::setText(const char* key, const char* lang, const QString &s)
#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
# pragma GCC diagnostic pop
#elif defined(Q_CC_MSVC)
-# pragma warning(default: 4996)
+# pragma warning(pop)
#endif
inline int QImage::numColors() const
diff --git a/src/gui/image/qimagewriter.cpp b/src/gui/image/qimagewriter.cpp
index 8dd5fdd111..c12dbb6544 100644
--- a/src/gui/image/qimagewriter.cpp
+++ b/src/gui/image/qimagewriter.cpp
@@ -279,7 +279,7 @@ QImageWriterPrivate::QImageWriterPrivate(QImageWriter *qq)
compression = 0;
gamma = 0.0;
imageWriterError = QImageWriter::UnknownError;
- errorString = QT_TRANSLATE_NOOP(QImageWriter, QLatin1String("Unknown error"));
+ errorString = QLatin1String(QT_TRANSLATE_NOOP(QImageWriter, "Unknown error"));
q = qq;
}
@@ -288,22 +288,19 @@ bool QImageWriterPrivate::canWriteHelper()
{
if (!device) {
imageWriterError = QImageWriter::DeviceError;
- errorString = QT_TRANSLATE_NOOP(QImageWriter,
- QLatin1String("Device is not set"));
+ errorString = QLatin1String(QT_TRANSLATE_NOOP(QImageWriter, "Device is not set"));
return false;
}
if (!device->isOpen())
device->open(QIODevice::WriteOnly);
if (!device->isWritable()) {
imageWriterError = QImageWriter::DeviceError;
- errorString = QT_TRANSLATE_NOOP(QImageWriter,
- QLatin1String("Device not writable"));
+ errorString = QLatin1String(QT_TRANSLATE_NOOP(QImageWriter, "Device not writable"));
return false;
}
if (!handler && (handler = createWriteHandlerHelper(device, format)) == 0) {
imageWriterError = QImageWriter::UnsupportedFormatError;
- errorString = QT_TRANSLATE_NOOP(QImageWriter,
- QLatin1String("Unsupported image format"));
+ errorString = QLatin1String(QT_TRANSLATE_NOOP(QImageWriter, "Unsupported image format"));
return false;
}
return true;
@@ -670,8 +667,7 @@ bool QImageWriter::supportsOption(QImageIOHandler::ImageOption option) const
{
if (!d->handler && (d->handler = createWriteHandlerHelper(d->device, d->format)) == 0) {
d->imageWriterError = QImageWriter::UnsupportedFormatError;
- d->errorString = QT_TRANSLATE_NOOP(QImageWriter,
- QLatin1String("Unsupported image format"));
+ d->errorString = QLatin1String(QT_TRANSLATE_NOOP(QImageWriter, "Unsupported image format"));
return false;
}
diff --git a/src/gui/opengl/qopenglversionfunctions.cpp b/src/gui/opengl/qopenglversionfunctions.cpp
index 0b1b6834e3..428f6e8a8b 100644
--- a/src/gui/opengl/qopenglversionfunctions.cpp
+++ b/src/gui/opengl/qopenglversionfunctions.cpp
@@ -198,6 +198,8 @@ bool QAbstractOpenGLFunctions::initializeOpenGLFunctions()
return true;
}
+/*! \internal
+ */
bool QAbstractOpenGLFunctions::isInitialized() const
{
Q_D(const QAbstractOpenGLFunctions);
diff --git a/src/gui/text/qharfbuzzng.cpp b/src/gui/text/qharfbuzzng.cpp
index 08072b1cf3..b4ab5856df 100644
--- a/src/gui/text/qharfbuzzng.cpp
+++ b/src/gui/text/qharfbuzzng.cpp
@@ -581,7 +581,7 @@ static hb_user_data_key_t _useDesignMetricsKey;
void hb_qt_font_set_use_design_metrics(hb_font_t *font, uint value)
{
- hb_font_set_user_data(font, &_useDesignMetricsKey, (void *)value, NULL, true);
+ hb_font_set_user_data(font, &_useDesignMetricsKey, (void *)quintptr(value), NULL, true);
}
uint hb_qt_font_get_use_design_metrics(hb_font_t *font)
diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp
index 7076fba41b..37610a9099 100644
--- a/src/gui/text/qplatformfontdatabase.cpp
+++ b/src/gui/text/qplatformfontdatabase.cpp
@@ -459,10 +459,20 @@ static const ushort requiredUnicodeBits[QFontDatabase::WritingSystemsCount][2] =
};
enum {
+ Latin1CsbBit = 0,
+ CentralEuropeCsbBit = 1,
+ TurkishCsbBit = 4,
+ BalticCsbBit = 7,
+ CyrillicCsbBit = 2,
+ GreekCsbBit = 3,
+ HebrewCsbBit = 5,
+ ArabicCsbBit = 6,
+ VietnameseCsbBit = 8,
SimplifiedChineseCsbBit = 18,
TraditionalChineseCsbBit = 20,
JapaneseCsbBit = 17,
- KoreanCsbBit = 21
+ KoreanCsbBit = 19,
+ KoreanJohabCsbBit = 21
};
/*!
@@ -492,6 +502,36 @@ QSupportedWritingSystems QPlatformFontDatabase::writingSystemsFromTrueTypeBits(q
}
}
}
+ if (codePageRange[0] & ((1 << Latin1CsbBit) | (1 << CentralEuropeCsbBit) | (1 << TurkishCsbBit) | (1 << BalticCsbBit))) {
+ writingSystems.setSupported(QFontDatabase::Latin);
+ hasScript = true;
+ //qDebug("font %s supports Latin", familyName.latin1());
+ }
+ if (codePageRange[0] & (1 << CyrillicCsbBit)) {
+ writingSystems.setSupported(QFontDatabase::Cyrillic);
+ hasScript = true;
+ //qDebug("font %s supports Cyrillic", familyName.latin1());
+ }
+ if (codePageRange[0] & (1 << GreekCsbBit)) {
+ writingSystems.setSupported(QFontDatabase::Greek);
+ hasScript = true;
+ //qDebug("font %s supports Greek", familyName.latin1());
+ }
+ if (codePageRange[0] & (1 << HebrewCsbBit)) {
+ writingSystems.setSupported(QFontDatabase::Hebrew);
+ hasScript = true;
+ //qDebug("font %s supports Hebrew", familyName.latin1());
+ }
+ if (codePageRange[0] & (1 << ArabicCsbBit)) {
+ writingSystems.setSupported(QFontDatabase::Arabic);
+ hasScript = true;
+ //qDebug("font %s supports Arabic", familyName.latin1());
+ }
+ if (codePageRange[0] & (1 << VietnameseCsbBit)) {
+ writingSystems.setSupported(QFontDatabase::Vietnamese);
+ hasScript = true;
+ //qDebug("font %s supports Vietnamese", familyName.latin1());
+ }
if (codePageRange[0] & (1 << SimplifiedChineseCsbBit)) {
writingSystems.setSupported(QFontDatabase::SimplifiedChinese);
hasScript = true;
@@ -507,7 +547,7 @@ QSupportedWritingSystems QPlatformFontDatabase::writingSystemsFromTrueTypeBits(q
hasScript = true;
//qDebug("font %s supports Japanese", familyName.latin1());
}
- if (codePageRange[0] & (1 << KoreanCsbBit)) {
+ if (codePageRange[0] & ((1 << KoreanCsbBit) | (1 << KoreanJohabCsbBit))) {
writingSystems.setSupported(QFontDatabase::Korean);
hasScript = true;
//qDebug("font %s supports Korean", familyName.latin1());
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 08b0491ddc..4e1c8c4c4a 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1098,7 +1098,7 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st
hb_buffer_set_segment_properties(buffer, &props);
hb_buffer_guess_segment_properties(buffer);
- uint buffer_flags = HB_BUFFER_FLAG_DEFAULT;
+ uint buffer_flags = 0; // HB_BUFFER_FLAG_DEFAULT
// Symbol encoding used to encode various crap in the 32..255 character code range,
// and thus might override U+00AD [SHY]; avoid hiding default ignorables
if (actualFontEngine->symbol)
@@ -1124,7 +1124,7 @@ int QTextEngine::shapeTextWithHarfbuzzNG(const QScriptItem &si, const ushort *st
hb_qt_font_set_use_design_metrics(hb_font, option.useDesignMetrics() ? uint(QFontEngine::DesignMetrics) : 0); // ###
const hb_feature_t features[1] = {
- { HB_TAG('k','e','r','n'), !!kerningEnabled, 0, -1 }
+ { HB_TAG('k','e','r','n'), !!kerningEnabled, 0, uint(-1) }
};
const int num_features = 1;
shapedOk = hb_shape_full(hb_font, buffer, features, num_features, 0);