-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Import and initialize the Sentry SDK early in your application setup: | ||
|
||
```cpp | ||
#include <QApplication> | ||
|
||
#include <sentry.h> | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
sentry_options_t *options = sentry_options_new(); | ||
sentry_options_set_dsn(options, "___PUBLIC_DSN___"); | ||
sentry_options_set_release(options, "my-project-name@2.3.12"); | ||
sentry_init(options); | ||
|
||
// Make sure everything flushes | ||
auto sentryShutdown = qScopeGuard([] { sentry_shutdown(); }); | ||
|
||
QApplication app(argc, argv); | ||
QWidget widget; | ||
widget.show(); | ||
|
||
return app.exec(); | ||
} | ||
``` | ||
Alternatively, the DSN can be passed as `SENTRY_DSN` environment variable during runtime. This can be especially useful for server applications. | ||
<Alert level="warning" title="Warning"> | ||
Calling `sentry_shutdown()` before exiting the application is critical. It | ||
ensures that events can be sent to Sentry before execution stops. Otherwise, | ||
event data may be lost. | ||
</Alert> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
The Qt integration is part of the [`sentry-native`](https://github.com/getsentry/sentry-native/) SDK, | ||
which currently supports Windows, macOS, Linux, and Android. Both Qt 5 and Qt 6 is supported. | ||
|
||
To build the SDK, download the latest release of the SDK from the [Releases page](https://github.com/getsentry/sentry-native/releases). The SDK is managed as a [CMake] project, which additionally supports several configuration options, such as the backend to use. | ||
|
||
To enable the Qt integration set the `SENTRY_INTEGRATION_QT` option to `YES`. | ||
|
||
<Note> | ||
|
||
If the Qt libraries are not installed in one of the predefined `CMake` [system prefix paths](https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_PREFIX_PATH.html), where they can be found by `CMake`, you will need to set [`CMAKE_PREFIX_PATH`](https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html) explicitly. | ||
|
||
</Note> | ||
|
||
For example (on macOS): | ||
|
||
```shell | ||
# Configure the cmake build into the `build` directory, | ||
# with crashpad, and Qt integration (on macOS). | ||
cmake -B build \ | ||
-D SENTRY_BACKEND=crashpad \ | ||
-D SENTRY_INTEGRATION_QT=YES \ | ||
--config RelWithDebInfo \ | ||
-S . | ||
|
||
# Build the project | ||
cmake --build build --config RelWithDebInfo --parallel | ||
|
||
# Install the resulting artifacts into a specific prefix | ||
cmake --install build --prefix install | ||
|
||
# Which will result in the following (on macOS): | ||
exa --tree install --level 2 | ||
install | ||
├── bin | ||
│ └── crashpad_handler | ||
├── include | ||
│ └── sentry.h | ||
└── lib | ||
├── cmake | ||
├── libsentry.dylib | ||
└── libsentry.dylib.dSYM | ||
``` | ||
|
||
[cmake]: https://cmake.org/cmake/help/latest/ | ||
|
||
<Alert level="warning" title="Bundling crashpad_handler"> | ||
|
||
When using the _Crashpad backend_, which is the default on Windows and macOS, the `crashpad_handler` binary has to be shipped alongside the application binary. See the [Crashpad documentation](configuration/backends/crashpad/) for more information. | ||
|
||
</Alert> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<Note> | ||
|
||
_Sentry's Qt integration enables automatic reporting of errors, exceptions, and log messages._ | ||
|
||
</Note> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
title: Qt | ||
description: "Learn how to use Sentry with Qt." | ||
categories: | ||
- desktop | ||
- mobile | ||
redirect_from: | ||
- /platforms/qt/ | ||
- /platforms/native/qt/ |