Source

Target

Commits (8)
Showing with 95 additions and 50 deletions
......@@ -2718,6 +2718,9 @@ bool Codegen::visit(WithStatement *ast)
_function->hasWith = true;
const int withObject = _block->newTemp();
_block->MOVE(_block->TEMP(withObject), *expression(ast->expression));
// need an exception handler for with to cleanup the with scope
IR::BasicBlock *withExceptionHandler = _function->newBasicBlock(exceptionHandler());
withExceptionHandler->EXP(withExceptionHandler->CALL(withExceptionHandler->NAME(IR::Name::builtin_pop_scope, 0, 0), 0));
......@@ -2732,8 +2735,6 @@ bool Codegen::visit(WithStatement *ast)
_block->JUMP(withBlock);
_block = withBlock;
int withObject = _block->newTemp();
_block->MOVE(_block->TEMP(withObject), *expression(ast->expression));
IR::ExprList *args = _function->New<IR::ExprList>();
args->init(_block->TEMP(withObject));
_block->EXP(_block->CALL(_block->NAME(IR::Name::builtin_push_with_scope, 0, 0), args));
......
......@@ -434,7 +434,7 @@ example shows a simple use of QQmlIncubator.
QQmlIncubator incubator;
component->create(incubator);
while (incubator.isReady()) {
while (!incubator.isReady()) {
QCoreApplication::processEvents(QEventLoop::AllEvents, 50);
}
......
......@@ -1961,7 +1961,8 @@ void QQmlTypeLoader::trimCache()
QList<TypeCache::Iterator> unneededTypes;
for (TypeCache::Iterator iter = m_typeCache.begin(), end = m_typeCache.end(); iter != end; ++iter) {
QQmlTypeData *typeData = iter.value();
if (typeData->m_compiledData && typeData->m_compiledData->count() == 1) {
if (typeData->m_compiledData && typeData->count() == 1
&& typeData->m_compiledData->count() == 1) {
// There are no live objects of this type
unneededTypes.append(iter);
}
......
......@@ -62,70 +62,70 @@ public:
QWindow *window() const Q_DECL_OVERRIDE;
QRect rect() const;
QRect rect() const Q_DECL_OVERRIDE;
QRect viewRect() const;
bool clipsChildren() const;
QAccessibleInterface *childAt(int x, int y) const;
QAccessibleInterface *childAt(int x, int y) const Q_DECL_OVERRIDE;
QAccessibleInterface *parent() const;
QAccessibleInterface *child(int index) const;
int childCount() const;
int indexOfChild(const QAccessibleInterface *iface) const;
QAccessibleInterface *parent() const Q_DECL_OVERRIDE;
QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
int childCount() const Q_DECL_OVERRIDE;
int indexOfChild(const QAccessibleInterface *iface) const Q_DECL_OVERRIDE;
QList<QQuickItem *> childItems() const;
QAccessible::State state() const;
QAccessible::Role role() const;
QString text(QAccessible::Text) const;
QAccessible::State state() const Q_DECL_OVERRIDE;
QAccessible::Role role() const Q_DECL_OVERRIDE;
QString text(QAccessible::Text) const Q_DECL_OVERRIDE;
bool isAccessible() const;
// Action Interface
QStringList actionNames() const;
void doAction(const QString &actionName);
QStringList keyBindingsForAction(const QString &actionName) const;
QStringList actionNames() const Q_DECL_OVERRIDE;
void doAction(const QString &actionName) Q_DECL_OVERRIDE;
QStringList keyBindingsForAction(const QString &actionName) const Q_DECL_OVERRIDE;
// Value Interface
QVariant currentValue() const;
void setCurrentValue(const QVariant &value);
QVariant maximumValue() const;
QVariant minimumValue() const;
QVariant minimumStepSize() const;
QVariant currentValue() const Q_DECL_OVERRIDE;
void setCurrentValue(const QVariant &value) Q_DECL_OVERRIDE;
QVariant maximumValue() const Q_DECL_OVERRIDE;
QVariant minimumValue() const Q_DECL_OVERRIDE;
QVariant minimumStepSize() const Q_DECL_OVERRIDE;
// Text Interface
void selection(int selectionIndex, int *startOffset, int *endOffset) const;
int selectionCount() const;
void addSelection(int startOffset, int endOffset);
void removeSelection(int selectionIndex);
void setSelection(int selectionIndex, int startOffset, int endOffset);
void selection(int selectionIndex, int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
int selectionCount() const Q_DECL_OVERRIDE;
void addSelection(int startOffset, int endOffset) Q_DECL_OVERRIDE;
void removeSelection(int selectionIndex) Q_DECL_OVERRIDE;
void setSelection(int selectionIndex, int startOffset, int endOffset) Q_DECL_OVERRIDE;
// cursor
int cursorPosition() const;
void setCursorPosition(int position);
int cursorPosition() const Q_DECL_OVERRIDE;
void setCursorPosition(int position) Q_DECL_OVERRIDE;
// text
QString text(int startOffset, int endOffset) const;
QString text(int startOffset, int endOffset) const Q_DECL_OVERRIDE;
QString textBeforeOffset(int offset, QAccessible::TextBoundaryType boundaryType,
int *startOffset, int *endOffset) const;
int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
QString textAfterOffset(int offset, QAccessible::TextBoundaryType boundaryType,
int *startOffset, int *endOffset) const;
int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
QString textAtOffset(int offset, QAccessible::TextBoundaryType boundaryType,
int *startOffset, int *endOffset) const;
int characterCount() const;
int *startOffset, int *endOffset) const Q_DECL_OVERRIDE;
int characterCount() const Q_DECL_OVERRIDE;
// character <-> geometry
QRect characterRect(int /* offset */) const { return QRect(); }
int offsetAtPoint(const QPoint & /* point */) const { return -1; }
QRect characterRect(int /* offset */) const Q_DECL_OVERRIDE { return QRect(); }
int offsetAtPoint(const QPoint & /* point */) const Q_DECL_OVERRIDE { return -1; }
void scrollToSubstring(int /* startIndex */, int /* endIndex */) {}
QString attributes(int /* offset */, int *startOffset, int *endOffset) const { *startOffset = 0; *endOffset = 0; return QString(); }
void scrollToSubstring(int /* startIndex */, int /* endIndex */) Q_DECL_OVERRIDE {}
QString attributes(int /* offset */, int *startOffset, int *endOffset) const Q_DECL_OVERRIDE { *startOffset = 0; *endOffset = 0; return QString(); }
QTextDocument *textDocument() const;
protected:
QQuickItem *item() const { return static_cast<QQuickItem*>(object()); }
void *interface_cast(QAccessible::InterfaceType t);
void *interface_cast(QAccessible::InterfaceType t) Q_DECL_OVERRIDE;
private:
QTextDocument *m_doc;
......
......@@ -214,7 +214,7 @@ user input. An event is posted to the render thread to initiate a new
frame.
\li The render thread prepares to draw a new frame and makes the
OpenGL context current and initiates a blocks on the GUI thread.
OpenGL context current and initiates a block on the GUI thread.
\li While the render thread is preparing the new frame, the GUI thread
calls QQuickItem::updatePolish() to do final touch-up of items before
......
......@@ -414,21 +414,44 @@ void QQuickItemKeyFilter::componentComplete()
/*!
\qmlproperty Item QtQuick::KeyNavigation::left
This property holds the item to assign focus to
when the left cursor key is pressed.
*/
/*!
\qmlproperty Item QtQuick::KeyNavigation::right
This property holds the item to assign focus to
when the right cursor key is pressed.
*/
/*!
\qmlproperty Item QtQuick::KeyNavigation::up
This property holds the item to assign focus to
when the up cursor key is pressed.
*/
/*!
\qmlproperty Item QtQuick::KeyNavigation::down
These properties hold the item to assign focus to
when the left, right, up or down cursor keys
are pressed.
This property holds the item to assign focus to
when the down cursor key is pressed.
*/
/*!
\qmlproperty Item QtQuick::KeyNavigation::tab
This property holds the item to assign focus to
when the Tab key is pressed.
*/
/*!
\qmlproperty Item QtQuick::KeyNavigation::backtab
These properties hold the item to assign focus to
when the Tab key or Shift+Tab key combination (Backtab) are pressed.
This property holds the item to assign focus to
when the Shift+Tab key combination (Backtab) is pressed.
*/
QQuickKeyNavigationAttached::QQuickKeyNavigationAttached(QObject *parent)
......
......@@ -331,12 +331,12 @@ QSGNode::~QSGNode()
to the scene graph and will cause the preprocess() function to be called
for every frame the node is rendered.
The preprocess function is called before the update pass that propegates
The preprocess function is called before the update pass that propagates
opacity and transformations through the scene graph. That means that
functions like QSGOpacityNode::combinedOpacity() and
QSGTransformNode::combinedMatrix() will not contain up-to-date values.
If such values are changed during the preprocess, these changes will be
propegated through the scene graph before it is rendered.
propagated through the scene graph before it is rendered.
\warning Beware of deleting nodes while they are being preprocessed. It is
possible, with a small performance hit, to delete a single node during its
......@@ -1331,7 +1331,7 @@ const qreal OPACITY_THRESHOLD = 0.001;
Sets the opacity of this node to \a opacity.
Before rendering the graph, the renderer will do an update pass
over the subtree to propegate the opacity to its children.
over the subtree to propagate the opacity to its children.
The value will be bounded to the range 0 to 1.
*/
......
......@@ -193,6 +193,8 @@ private slots:
void v4FunctionWithoutQML();
void withNoContext();
signals:
void testSignal();
};
......@@ -3840,6 +3842,13 @@ void tst_QJSEngine::v4FunctionWithoutQML()
QVERIFY(obj.called);
}
void tst_QJSEngine::withNoContext()
{
// Don't crash (QTBUG-53794)
QJSEngine engine;
engine.evaluate("with (noContext) true");
}
QTEST_MAIN(tst_QJSEngine)
#include "tst_qjsengine.moc"
......
......@@ -86,10 +86,19 @@ void tst_QQMLTypeLoader::trimCache()
url.setQuery(QString::number(i));
QQmlTypeData *data = loader.getType(url);
if (i % 5 == 0) // keep references to some of them so that they aren't trimmed
data->compiledData()->addref();
// Run an event loop to receive the callback that release()es.
QTRY_COMPARE(data->count(), 2);
data->release();
// keep references to some of them so that they aren't trimmed. References to either the
// QQmlTypeData or its compiledData() should prevent the trimming.
if (i % 10 == 0) {
// keep ref on data, don't add ref on data->compiledData()
} else if (i % 5 == 0) {
data->compiledData()->addref();
data->release();
} else {
data->release();
}
}
for (int i = 0; i < 256; ++i) {
......
......@@ -5,6 +5,8 @@
*
[tst_grabImage::test_equals]
linux
[ListView::test_listInteractiveCurrentIndexEnforce]
linux
[Text::test_linecount]
osx
windows
......