Skip to content

Commit

Permalink
Add Qt wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
torarnv committed Apr 8, 2021
1 parent cf0e84a commit d370773
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/wizard/native/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ sentry_capture_event(sentry_value_new_message_event(
/* message */ "It works!"
));
```

If you're new to Sentry, use the email alert to access your account and complete a product tour.

If you're an existing user and have disabled alerts, you won't receive this email.
47 changes: 47 additions & 0 deletions src/wizard/native/qt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
name: Qt
doc_link: https://docs.sentry.io/platforms/native/guides/qt/
support_level: production
type: framework
---

Install the SDK by downloading the [latest release](https://github.com/getsentry/sentry-native/releases). Next, follow the
instructions in the [_Native SDK Documentation_](/platforms/native/guides/qt/) to build the SDK library.

Import and initialize the Sentry SDK early in your application setup:

```cpp
#include <QtWidgets>
#include <sentry.h>

int main(int argc, char *argv[])
{
sentry_options_t *options = sentry_options_new();
sentry_options_set_dsn(options, "___PUBLIC_DSN___");
sentry_init(options);

// Make sure everything flushes
auto sentryShutdown = qScopeGuard([] { sentry_shutdown(); });

QApplication app(argc, argv);
/* ... */
return app.exec();
}
```
Alternatively, the DSN can be passed as `SENTRY_DSN` environment variable during
runtime. This can be especially useful for server applications.
The quickest way to verify Sentry in your Qt application is by capturing a message:
```c
sentry_capture_event(sentry_value_new_message_event(
/* level */ SENTRY_LEVEL_INFO,
/* logger */ "custom",
/* message */ "It works!"
));
```

If you're new to Sentry, use the email alert to access your account and complete a product tour.

If you're an existing user and have disabled alerts, you won't receive this email.

0 comments on commit d370773

Please sign in to comment.