diff options
Diffstat (limited to 'src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp')
-rw-r--r-- | src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp index 6ff4f57945..54b5c95a34 100644 --- a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp @@ -1,12 +1,22 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** ** "Redistribution and use in source and binary forms, with or without ** modification, are permitted provided that the following conditions are @@ -439,6 +449,11 @@ qWarning("%s: %s", qUtf8Printable(key), qUtf8Printable(value)); //! [37] +//! [qUtf16Printable] +qWarning("%ls: %ls", qUtf16Printable(key), qUtf16Printable(value)); +//! [qUtf16Printable] + + //! [38] struct Point2D { @@ -563,6 +578,29 @@ struct A : public B { template<> class QTypeInfo<A> : public QTypeInfoMerger<A, B, C, D> {}; //! [51] +//! [52] + struct Foo { + void overloadedFunction(); + void overloadedFunction(int, QString); + }; + ... qOverload<>(&Foo::overloadedFunction) + ... qOverload<int, QString>(&Foo::overloadedFunction) +//! [52] + +//! [53] + ... QOverload<>::of(&Foo::overloadedFunction) + ... QOverload<int, QString>::of(&Foo::overloadedFunction) +//! [53] + +//! [54] + struct Foo { + void overloadedFunction(int, QString); + void overloadedFunction(int, QString) const; + }; + ... qConstOverload<>(&Foo::overloadedFunction) + ... qNonConstOverload<int, QString>(&Foo::overloadedFunction) +//! [54] + //! [qlikely] // the condition inside the "if" will be successful most of the times for (int i = 1; i <= 365; i++) { |