Shared Memory Example▲
Sélectionnez
&
lt;ui version=
"4.0"
&
gt;
&
lt;class
&
gt;Dialog&
lt;/
class
&
gt;
&
lt;widget class
=
"QDialog"
name=
"Dialog"
&
gt;
&
lt;property name=
"geometry"
&
gt;
&
lt;rect&
gt;
&
lt;x&
gt;0
&
lt;/
x&
gt;
&
lt;y&
gt;0
&
lt;/
y&
gt;
&
lt;width&
gt;451
&
lt;/
width&
gt;
&
lt;height&
gt;322
&
lt;/
height&
gt;
&
lt;/
rect&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"windowTitle"
&
gt;
&
lt;string&
gt;Dialog&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;layout class
=
"QGridLayout"
&
gt;
&
lt;item row=
"0"
column=
"0"
&
gt;
&
lt;widget class
=
"QPushButton"
name=
"loadFromFileButton"
&
gt;
&
lt;property name=
"text"
&
gt;
&
lt;string&
gt;Load Image From File...&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;/
widget&
gt;
&
lt;/
item&
gt;
&
lt;item row=
"1"
column=
"0"
&
gt;
&
lt;widget class
=
"QLabel"
name=
"label"
&
gt;
&
lt;property name=
"text"
&
gt;
&
lt;string&
gt;Launch two of these dialogs. In the first, press the top button and
load an image from a file. In the second, press the bottom button and
display the loaded image from shared memory.&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"alignment"
&
gt;
&
lt;set&
gt;Qt::
AlignCenter&
lt;/
set&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"wordWrap"
&
gt;
&
lt;bool
&
gt;true
&
lt;/
bool
&
gt;
&
lt;/
property&
gt;
&
lt;/
widget&
gt;
&
lt;/
item&
gt;
&
lt;item row=
"2"
column=
"0"
&
gt;
&
lt;widget class
=
"QPushButton"
name=
"loadFromSharedMemoryButton"
&
gt;
&
lt;property name=
"text"
&
gt;
&
lt;string&
gt;Display Image From Shared Memory&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;/
widget&
gt;
&
lt;/
item&
gt;
&
lt;/
layout&
gt;
&
lt;/
widget&
gt;
&
lt;resources/&
gt;
&
lt;connections/&
gt;
&
lt;/
ui&
gt;