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
qsharedmemory.h
Go to the documentation of this file.
1// Copyright (C) 2016 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
4#ifndef QSHAREDMEMORY_H
5#define QSHAREDMEMORY_H
6
7#include <QtCore/qtipccommon.h>
8#ifndef QT_NO_QOBJECT
9# include <QtCore/qobject.h>
10#else
11# include <QtCore/qobjectdefs.h>
12# include <QtCore/qscopedpointer.h>
13# include <QtCore/qstring.h>
14#endif
15
17
18#if QT_CONFIG(sharedmemory)
19
21
23{
26
27public:
28 enum AccessMode
29 {
32 };
34
36 {
37 NoError,
46 };
48
49 QSharedMemory(QObject *parent = nullptr);
50 QSharedMemory(const QNativeIpcKey &key, QObject *parent = nullptr);
52
53 QSharedMemory(const QString &key, QObject *parent = nullptr);
54 void setKey(const QString &key);
55 QString key() const;
56
57 void setNativeKey(const QNativeIpcKey &key);
59 { setNativeKey({ key, type }); }
60 QString nativeKey() const;
62#if QT_CORE_REMOVED_SINCE(6, 5)
63 void setNativeKey(const QString &key);
64#endif
65
67 qsizetype size() const;
68
70 bool isAttached() const;
71 bool detach();
72
73 void *data();
74 const void* constData() const;
75 const void *data() const;
76
77#if QT_CONFIG(systemsemaphore)
78 bool lock();
79 bool unlock();
80#endif
81
83 QString errorString() const;
84
90
91private:
93};
94
95#endif // QT_CONFIG(sharedmemory)
96
98
99#endif // QSHAREDMEMORY_H
\inmodule QtSql
Combined button and popup list for selecting options.