summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraavit <qt-info@nokia.com>2011-03-04 13:50:11 (GMT)
committeraavit <qt-info@nokia.com>2011-03-04 13:50:11 (GMT)
commit74a92ce0858b93a9c110c93bd0fb94163d1ee210 (patch)
treeaac7cd421080b3b5cfbdc2aa9d4d2f1492ae3add /src
parent5b77390228cfc32a48a34edbc3077f7755b4e7b0 (diff)
parentbfcd2cabf7b5bc15105c968f80f71132efb65759 (diff)
downloadQt-74a92ce0858b93a9c110c93bd0fb94163d1ee210.zip
Qt-74a92ce0858b93a9c110c93bd0fb94163d1ee210.tar.gz
Qt-74a92ce0858b93a9c110c93bd0fb94163d1ee210.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-fire-team
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qpixmap.cpp5
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index f896572..71fb079 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -112,8 +112,13 @@ void QPixmap::init(int w, int h, Type type)
init(w, h, int(type));
}
+extern QApplication::Type qt_appType;
+
void QPixmap::init(int w, int h, int type)
{
+ if (qt_appType == QApplication::Tty)
+ qFatal("QPixmap: Cannot create a QPixmap when no GUI is being used");
+
if ((w > 0 && h > 0) || type == QPixmapData::BitmapType)
data = QPixmapData::create(w, h, (QPixmapData::PixelType) type);
else
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index ff2dfe7..5e8b37e 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -983,7 +983,7 @@ static int qCocoaViewCount = 0;
QString qtText;
// Cursor position is retrived from the range.
QList<QInputMethodEvent::Attribute> attrs;
- attrs<<QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, selRange.location, 1, QVariant());
+ attrs<<QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, selRange.location + selRange.length, 1, QVariant());
if ([aString isKindOfClass:[NSAttributedString class]]) {
qtText = QCFString::toQString(reinterpret_cast<CFStringRef>([aString string]));
composingLength = qtText.length();