Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qexceptionhandling.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QEXCEPTIONHANDLING_H
6#define QEXCEPTIONHANDLING_H
7
8#include <QtCore/qtconfigmacros.h>
9#include <QtCore/qcompilerdetection.h>
10#include <QtCore/qtcoreexports.h>
11
12#if 0
13#pragma qt_class(QtExceptionHandling)
14#pragma qt_sync_stop_processing
15#endif
16
18
19/* These wrap try/catch so we can switch off exceptions later.
20
21 Beware - do not use more than one QT_CATCH per QT_TRY, and do not use
22 the exception instance in the catch block.
23 If you can't live with those constraints, don't use these macros.
24 Use the QT_NO_EXCEPTIONS macro to protect your code instead.
25*/
26#ifdef QT_NO_EXCEPTIONS
27# define QT_TRY if (true)
28# define QT_CATCH(A) else
29# define QT_THROW(A) qt_noop()
30# define QT_RETHROW qt_noop()
31#else
32# define QT_TRY try
33# define QT_CATCH(A) catch (A)
34# define QT_THROW(A) throw A
35# define QT_RETHROW throw
36#endif
37
38#if QT_CORE_REMOVED_SINCE(6, 9)
40#endif
41
43
44#endif // QEXCEPTIONHANDLING_H
\inmodule QtSql