Skip to content

PythonQt.QtCore.QSharedMemory · declarations 001

Back to PythonQt.QtCore.QSharedMemory

AccessMode instance-attribute

AccessMode: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

AlreadyExists instance-attribute

AlreadyExists: Any

InvalidSize instance-attribute

InvalidSize: Any

KeyError instance-attribute

KeyError: Any

LockError instance-attribute

LockError: Any

NotFound instance-attribute

NotFound: Any

OutOfResources instance-attribute

OutOfResources: Any

PermissionDenied instance-attribute

PermissionDenied: Any

SharedMemoryError instance-attribute

SharedMemoryError: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

attach

attach(mode: Any) -> bool

X.attach(mode) -> bool

Supplemental documentation: Qt 5 reference:

bool QSharedMemory::attach(QSharedMemory::AccessMode mode \= ReadWrite)

Attempts to attach the process to the shared memory segment identified by the key that was passed to the constructor or to a call to setKey() or setNativeKey(). The access mode is ReadWrite by default. It can also be ReadOnly. Returns true if the attach operation is successful. If false is returned, call error() to determine which error occurred. After attaching the shared memory segment, a pointer to the shared memory can be obtained by calling data().

See also isAttached(), detach(), and create().

Source: https://doc.qt.io/archives/qt-5.15/qsharedmemory.html#attach

constData

constData() -> Any

X.constData()

Supplemental documentation: Qt 5 reference:

const void *QSharedMemory::constData() const

Returns a const pointer to the contents of the shared memory segment, if one is attached. Otherwise it returns null. Remember to lock the shared memory with lock() before reading from or writing to the shared memory, and remember to release the lock with unlock() after you are done.

See also attach() and create().

Source: https://doc.qt.io/archives/qt-5.15/qsharedmemory.html#constData

create

create(size: Any, mode: Any) -> bool

X.create(size, mode) -> bool

Supplemental documentation: Qt 5 reference:

bool QSharedMemory::create(int size, QSharedMemory::AccessMode mode \= ReadWrite)

Creates a shared memory segment of size bytes with the key passed to the constructor, set with setKey() or set with setNativeKey(), then attaches to the new shared memory segment with the given access mode and returns true. If a shared memory segment identified by the key already exists, the attach operation is not performed and false is returned. When the return value is false, call error() to determine which error occurred.

See also error().

Source: https://doc.qt.io/archives/qt-5.15/qsharedmemory.html#create

data

data() -> Any

X.data()

Supplemental documentation: Qt 5 reference:

void *QSharedMemory::data()

Returns a pointer to the contents of the shared memory segment, if one is attached. Otherwise it returns null. Remember to lock the shared memory with lock() before reading from or writing to the shared memory, and remember to release the lock with unlock() after you are done.

See also attach().

const void *QSharedMemory::data() const

This function overloads data().

Source: https://doc.qt.io/archives/qt-5.15/qsharedmemory.html#data

destroyed

destroyed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtCore.QSharedMemory.destroyed; argument details are not documented.

error

error() -> Any

X.error()

Supplemental documentation: Qt 5 reference:

QSharedMemory::SharedMemoryError QSharedMemory::error() const

Returns a value indicating whether an error occurred, and, if so, which error it was.

See also errorString().

Source: https://doc.qt.io/archives/qt-5.15/qsharedmemory.html#error

errorString

errorString() -> str

X.errorString() -> str

Supplemental documentation: Qt 5 reference:

QString QSharedMemory::errorString() const

Returns a text description of the last error that occurred. If error() returns an error value, call this function to get a text string that describes the error.

See also error().

Source: https://doc.qt.io/archives/qt-5.15/qsharedmemory.html#errorString

isAttached

isAttached() -> bool

X.isAttached() -> bool

Supplemental documentation: Qt 5 reference:

bool QSharedMemory::isAttached() const

Returns true if this process is attached to the shared memory segment.

See also attach() and detach().

Source: https://doc.qt.io/archives/qt-5.15/qsharedmemory.html#isAttached

key

key() -> str

X.key() -> str

Supplemental documentation: Qt 5 reference:

QString QSharedMemory::key() const

Returns the key assigned with setKey() to this shared memory, or a null key if no key has been assigned, or if the segment is using a nativeKey(). The key is the identifier used by Qt applications to identify the shared memory segment.

You can find the native, platform specific, key used by the operating system by calling nativeKey().

See also setKey() and setNativeKey().

Source: https://doc.qt.io/archives/qt-5.15/qsharedmemory.html#key

lock

lock() -> bool

X.lock() -> bool

Supplemental documentation: Qt 5 reference:

bool QSharedMemory::lock()

This is a semaphore that locks the shared memory segment for access by this process and returns true. If another process has locked the segment, this function blocks until the lock is released. Then it acquires the lock and returns true. If this function returns false, it means that you have ignored a false return from create() or attach(), that you have set the key with setNativeKey() or that QSystemSemaphore::acquire() failed due to an unknown system error.

See also unlock(), data(), and QSystemSemaphore::acquire().

Source: https://doc.qt.io/archives/qt-5.15/qsharedmemory.html#lock

nativeKey

nativeKey() -> str

X.nativeKey() -> str

Supplemental documentation: Qt 5 reference:

QString QSharedMemory::nativeKey() const

Returns the native, platform specific, key for this shared memory object. The native key is the identifier used by the operating system to identify the shared memory segment.

You can use the native key to access shared memory segments that have not been created by Qt, or to grant shared memory access to non-Qt applications.

This function was introduced in Qt 4.8.

See also setKey() and setNativeKey().

Source: https://doc.qt.io/archives/qt-5.15/qsharedmemory.html#nativeKey

objectNameChanged

objectNameChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtCore.QSharedMemory.objectNameChanged; argument details are not documented.

setKey

setKey(key: Any) -> Any

X.setKey(key)

Supplemental documentation: Qt 5 reference:

void QSharedMemory::setKey(const QString \&key)

Sets the platform independent key for this shared memory object. If key is the same as the current key, the function returns without doing anything.

You can call key() to retrieve the platform independent key. Internally, QSharedMemory converts this key into a platform specific key. If you instead call nativeKey(), you will get the platform specific, converted key.

If the shared memory object is attached to an underlying shared memory segment, it will detach from it before setting the new key. This function does not do an attach().

See also key(), nativeKey(), and isAttached().

Source: https://doc.qt.io/archives/qt-5.15/qsharedmemory.html#setKey

setNativeKey

setNativeKey(key: Any) -> Any

X.setNativeKey(key)

Supplemental documentation: Qt 5 reference:

void QSharedMemory::setNativeKey(const QString \&key)

Sets the native, platform specific, key for this shared memory object. If key is the same as the current native key, the function returns without doing anything. If all you want is to assign a key to a segment, you should call setKey() instead.

You can call nativeKey() to retrieve the native key. If a native key has been assigned, calling key() will return a null string.

If the shared memory object is attached to an underlying shared memory segment, it will detach from it before setting the new key. This function does not do an attach().

The application will not be portable if you set a native key.

This function was introduced in Qt 4.8.

See also nativeKey(), key(), and isAttached().

Source: https://doc.qt.io/archives/qt-5.15/qsharedmemory.html#setNativeKey

size

size() -> int

X.size() -> int

Supplemental documentation: Qt 5 reference:

int QSharedMemory::size() const

Returns the size of the attached shared memory segment. If no shared memory segment is attached, 0 is returned.

Note: The size of the segment may be larger than the requested size that was passed to create().

See also create() and attach().

Source: https://doc.qt.io/archives/qt-5.15/qsharedmemory.html#size

unlock

unlock() -> bool

X.unlock() -> bool

Supplemental documentation: Qt 5 reference:

bool QSharedMemory::unlock()

Releases the lock on the shared memory segment and returns true, if the lock is currently held by this process. If the segment is not locked, or if the lock is held by another process, nothing happens and false is returned.

See also lock().

Source: https://doc.qt.io/archives/qt-5.15/qsharedmemory.html#unlock