sharedmemory example: Show error string when failing to create shared memory

Change-Id: I27edc27aec742e1e34c060e48810c4cfba096ee8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Tor Arne Vestbø 2022-11-11 11:11:22 +01:00
parent 523496984c
commit 5a36ee7028
1 changed files with 2 additions and 1 deletions

View File

@ -89,7 +89,8 @@ void Dialog::loadFromFile()
int size = buffer.size();
if (!sharedMemory.create(size)) {
ui.label->setText(tr("Unable to create shared memory segment."));
ui.label->setText(tr("Unable to create shared memory segment: %1")
.arg(sharedMemory.errorString()));
return;
}
sharedMemory.lock();