4#ifndef QSYSTEMSEMAPHORE_H
5#define QSYSTEMSEMAPHORE_H
7#include <QtCore/qcoreapplication.h>
8#include <QtCore/qtipccommon.h>
9#include <QtCore/qstring.h>
10#include <QtCore/qscopedpointer.h>
14#if QT_CONFIG(systemsemaphore)
16class QSystemSemaphorePrivate;
18class Q_CORE_EXPORT QSystemSemaphore
21 Q_DECLARE_TR_FUNCTIONS(QSystemSemaphore)
30 enum SystemSemaphoreError
41 QSystemSemaphore(
const QNativeIpcKey &key,
int initialValue = 0, AccessMode = Open);
44 void setNativeKey(
const QNativeIpcKey &key,
int initialValue = 0, AccessMode = Open);
45 void setNativeKey(
const QString &key,
int initialValue = 0, AccessMode mode = Open,
46 QNativeIpcKey::Type type = QNativeIpcKey::legacyDefaultTypeForOs())
47 { setNativeKey({ key, type }, initialValue, mode); }
48 QNativeIpcKey nativeIpcKey()
const;
50 QSystemSemaphore(
const QString &key,
int initialValue = 0, AccessMode mode = Open);
51 void setKey(
const QString &key,
int initialValue = 0, AccessMode mode = Open);
55 bool release(
int n = 1);
57 SystemSemaphoreError error()
const;
58 QString errorString()
const;
60 static bool isKeyTypeSupported(QNativeIpcKey::Type type) Q_DECL_CONST_FUNCTION;
61 static QNativeIpcKey platformSafeKey(
const QString &key,
62 QNativeIpcKey::Type type = QNativeIpcKey::DefaultTypeForOs);
63 static QNativeIpcKey legacyNativeKey(
const QString &key,
64 QNativeIpcKey::Type type = QNativeIpcKey::legacyDefaultTypeForOs());
67 Q_DISABLE_COPY(QSystemSemaphore)
68 QScopedPointer<QSystemSemaphorePrivate> d;
Combined button and popup list for selecting options.