summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/canvas/qsimplecanvasdebugplugin.cpp5
-rw-r--r--src/declarative/debugger/qmldebugger.cpp3
-rw-r--r--src/declarative/debugger/qmlpropertyview.cpp2
-rw-r--r--src/declarative/fx/qfxtextedit.cpp16
-rw-r--r--src/declarative/fx/qfxtextedit.h1
-rw-r--r--src/declarative/qml/qmlcompiler_p.h2
-rw-r--r--src/declarative/qml/qmlprivate.h46
-rw-r--r--src/gui/text/qtextcontrol_p.h2
8 files changed, 33 insertions, 44 deletions
diff --git a/src/declarative/canvas/qsimplecanvasdebugplugin.cpp b/src/declarative/canvas/qsimplecanvasdebugplugin.cpp
index 0fd0f81..12088c1 100644
--- a/src/declarative/canvas/qsimplecanvasdebugplugin.cpp
+++ b/src/declarative/canvas/qsimplecanvasdebugplugin.cpp
@@ -58,6 +58,7 @@ public:
virtual int duration() const { return -1; }
virtual void updateCurrentTime(int msecs) {
+ Q_UNUSED(msecs);
server->frameBreak();
}
@@ -66,7 +67,7 @@ private:
};
QSimpleCanvasDebugPlugin::QSimpleCanvasDebugPlugin(QObject *parent)
-: QmlDebugServerPlugin("CanvasFrameRate", parent), _breaks(0)
+: QmlDebugServerPlugin(QLatin1String("CanvasFrameRate"), parent), _breaks(0)
{
_time.start();
new FrameBreakAnimation(this);
@@ -95,7 +96,7 @@ void QSimpleCanvasDebugPlugin::frameBreak()
}
QSimpleCanvasSceneDebugPlugin::QSimpleCanvasSceneDebugPlugin(QSimpleCanvas *parent)
-: QmlDebugServerPlugin("CanvasScene", parent), m_canvas(parent)
+: QmlDebugServerPlugin(QLatin1String("CanvasScene"), parent), m_canvas(parent)
{
}
diff --git a/src/declarative/debugger/qmldebugger.cpp b/src/declarative/debugger/qmldebugger.cpp
index c925148..9ab3247 100644
--- a/src/declarative/debugger/qmldebugger.cpp
+++ b/src/declarative/debugger/qmldebugger.cpp
@@ -282,7 +282,7 @@ bool QmlDebugger::makeItem(QObject *obj, QmlDebuggerItem *item)
if(!toolTipString.isEmpty())
toolTipString.prepend(QLatin1Char('\n'));
toolTipString.prepend(tr("Root type: ") + text);
- text = p->typeName;
+ text = QString::fromAscii(p->typeName);
}
if(!toolTipString.isEmpty())
@@ -333,6 +333,7 @@ bool operator<(const QPair<quint32, QPair<int, QString> > &lhs,
void QmlDebugger::setCanvas(QSimpleCanvas *c)
{
+ Q_UNUSED(c);
}
void QmlDebugger::setDebugObject(QObject *obj)
diff --git a/src/declarative/debugger/qmlpropertyview.cpp b/src/declarative/debugger/qmlpropertyview.cpp
index 0d34fd9..abe1902 100644
--- a/src/declarative/debugger/qmlpropertyview.cpp
+++ b/src/declarative/debugger/qmlpropertyview.cpp
@@ -210,7 +210,7 @@ void QmlPropertyView::setObject(QObject *object)
++iter) {
QTreeWidgetItem *item = new QTreeWidgetItem(m_tree);
- item->setText(0, iter.key());
+ item->setText(0, QString::fromAscii(iter.key()));
item->setForeground(0, Qt::blue);
item->setText(1, iter.value());
}
diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp
index c7a7700..5492aaa 100644
--- a/src/declarative/fx/qfxtextedit.cpp
+++ b/src/declarative/fx/qfxtextedit.cpp
@@ -772,6 +772,18 @@ void QFxTextEdit::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
\overload
Handles the given mouse \a event.
*/
+void QFxTextEdit::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
+{
+ Q_D(QFxTextEdit);
+ d->control->processEvent(event, QPointF(0, 0));
+ if (!event->isAccepted())
+ QFxPaintedItem::mouseDoubleClickEvent(event);
+}
+
+/*!
+\overload
+Handles the given mouse \a event.
+*/
void QFxTextEdit::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
Q_D(QFxTextEdit);
@@ -859,9 +871,13 @@ void QFxTextEditPrivate::init()
void QFxTextEdit::q_textChanged()
{
+ if (!widthValid())
+ updateSize(); //### optimize: we get 3 calls to updateSize every time a letter is typed
emit textChanged(text());
}
+//### we should perhaps be a bit smarter here -- depending on what has changed, we shouldn't
+// need to do all the calculations each time
void QFxTextEdit::updateSize()
{
Q_D(QFxTextEdit);
diff --git a/src/declarative/fx/qfxtextedit.h b/src/declarative/fx/qfxtextedit.h
index e30b9ed..b761a1b 100644
--- a/src/declarative/fx/qfxtextedit.h
+++ b/src/declarative/fx/qfxtextedit.h
@@ -190,6 +190,7 @@ protected:
// mouse filter?
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+ void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
void inputMethodEvent(QInputMethodEvent *e);
diff --git a/src/declarative/qml/qmlcompiler_p.h b/src/declarative/qml/qmlcompiler_p.h
index eb24b91..6b6e1e2 100644
--- a/src/declarative/qml/qmlcompiler_p.h
+++ b/src/declarative/qml/qmlcompiler_p.h
@@ -162,7 +162,7 @@ private:
int ctxt);
void finalizeComponent(int patch);
- class BindingReference;
+ struct BindingReference;
void finalizeBinding(const BindingReference &);
struct IdReference {
diff --git a/src/declarative/qml/qmlprivate.h b/src/declarative/qml/qmlprivate.h
index 62524aa..3f41fb7 100644
--- a/src/declarative/qml/qmlprivate.h
+++ b/src/declarative/qml/qmlprivate.h
@@ -123,43 +123,13 @@ namespace QmlPrivate
}
};
- template <typename T>
- class has_attachedPropertiesMember
- {
- typedef int yes_type;
- typedef char no_type;
- template <int>
- struct Selector {};
-
- template <typename S>
- static yes_type test(Selector<sizeof(&S::qmlAttachedProperties)>*);
-
- template <typename S>
- static no_type test(...);
-
- public:
- static bool const value = sizeof(test<T>(0)) == sizeof(yes_type);
- };
-
- template <typename T, bool hasMember>
- class has_attachedPropertiesMethod
+ template<typename T, typename Sign = T *(*)(QObject *)>
+ struct has_qmlAttachedProperties
{
- typedef int yes_type;
- typedef char no_type;
-
- template<typename ReturnType>
- static yes_type check(ReturnType *(*)(QObject *));
- static no_type check(...);
-
- public:
- static bool const value = sizeof(check(&T::qmlAttachedProperties)) == sizeof(yes_type);
- };
-
- template <typename T>
- class has_attachedPropertiesMethod<T, false>
- {
- public:
- static bool const value = false;
+ template <typename U, U> struct type_check;
+ template <typename _1> static char check(type_check<Sign, &_1::qmlAttachedProperties> *);
+ template <typename > static int check(...);
+ static bool const value = sizeof(check<T>(0)) == sizeof(char);
};
template<typename T, int N>
@@ -191,13 +161,13 @@ namespace QmlPrivate
template<typename T>
inline QmlAttachedPropertiesFunc attachedPropertiesFunc()
{
- return AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::func();
+ return AttachedPropertySelector<T, has_qmlAttachedProperties<T>::value >::func();
}
template<typename T>
inline const QMetaObject *attachedPropertiesMetaObject()
{
- return AttachedPropertySelector<T, has_attachedPropertiesMethod<T, has_attachedPropertiesMember<T>::value>::value>::metaObject();
+ return AttachedPropertySelector<T, has_qmlAttachedProperties<T>::value >::metaObject();
}
struct MetaTypeIds {
diff --git a/src/gui/text/qtextcontrol_p.h b/src/gui/text/qtextcontrol_p.h
index 4dac4f7..e50540a 100644
--- a/src/gui/text/qtextcontrol_p.h
+++ b/src/gui/text/qtextcontrol_p.h
@@ -83,7 +83,7 @@ class QAbstractScrollArea;
class QEvent;
class QTimerEvent;
-class Q_AUTOTEST_EXPORT QTextControl : public QObject
+class Q_GUI_EXPORT QTextControl : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QTextControl)