Skip to content

Commit

Permalink
Fix tests and docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Jun 10, 2019
1 parent d790ab2 commit 0bd8df5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/core/qobjectuniqueptr.h
Expand Up @@ -137,6 +137,11 @@ class QObjectUniquePtr
return mPtr.isNull();
}

/**
* Checks if the pointer managed by this object is ``nullptr``.
* If it is not ``nullptr`` TRUE will be returned, if it is ``nullptr``
* FALSE will be returned.
*/
inline bool operator bool() const
{
return !mPtr.isNull();
Expand Down
4 changes: 2 additions & 2 deletions tests/src/core/testqobjectuniqueptr.cpp
Expand Up @@ -98,9 +98,9 @@ void TestQObjectUniquePtr::testSwap()
void TestQObjectUniquePtr::testOperatorArrow()
{
QObject *o = new QObject();
o->setName( "Teddy" );
o->setObjectName( "Teddy" );
QObjectUniquePtr<QObject> obj( o );
QCOMPARE( obj->name(), "Teddy" );
QCOMPARE( obj->objectName(), "Teddy" );
}

QGSTEST_MAIN( TestQObjectUniquePtr )
Expand Down

0 comments on commit 0bd8df5

Please sign in to comment.