WebEngine Markdown Editor Example▲
Sélectionnez
&
lt;?xml version=
"1.0"
encoding=
"UTF-8"
?&
gt;
&
lt;ui version=
"4.0"
&
gt;
&
lt;class
&
gt;MainWindow&
lt;/
class
&
gt;
&
lt;widget class
=
"QMainWindow"
name=
"MainWindow"
&
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;800
&
lt;/
width&
gt;
&
lt;height&
gt;600
&
lt;/
height&
gt;
&
lt;/
rect&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"windowTitle"
&
gt;
&
lt;string&
gt;MarkDown Editor&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;widget class
=
"QWidget"
name=
"centralwidget"
&
gt;
&
lt;layout class
=
"QHBoxLayout"
name=
"horizontalLayout"
&
gt;
&
lt;item&
gt;
&
lt;widget class
=
"QSplitter"
name=
"splitter"
&
gt;
&
lt;property name=
"orientation"
&
gt;
&
lt;enum
&
gt;Qt::
Horizontal&
lt;/
enum
&
gt;
&
lt;/
property&
gt;
&
lt;widget class
=
"QPlainTextEdit"
name=
"editor"
/&
gt;
&
lt;widget class
=
"QWebEngineView"
name=
"preview"
native=
"true"
/&
gt;
&
lt;/
widget&
gt;
&
lt;/
item&
gt;
&
lt;/
layout&
gt;
&
lt;/
widget&
gt;
&
lt;widget class
=
"QMenuBar"
name=
"menubar"
&
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;800
&
lt;/
width&
gt;
&
lt;height&
gt;26
&
lt;/
height&
gt;
&
lt;/
rect&
gt;
&
lt;/
property&
gt;
&
lt;widget class
=
"QMenu"
name=
"menu_File"
&
gt;
&
lt;property name=
"title"
&
gt;
&
lt;string&
gt;&
amp;amp;File&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;addaction name=
"actionNew"
/&
gt;
&
lt;addaction name=
"actionOpen"
/&
gt;
&
lt;addaction name=
"actionSave"
/&
gt;
&
lt;addaction name=
"actionSaveAs"
/&
gt;
&
lt;addaction name=
"separator"
/&
gt;
&
lt;addaction name=
"actionExit"
/&
gt;
&
lt;/
widget&
gt;
&
lt;addaction name=
"menu_File"
/&
gt;
&
lt;/
widget&
gt;
&
lt;widget class
=
"QStatusBar"
name=
"statusbar"
/&
gt;
&
lt;action name=
"actionOpen"
&
gt;
&
lt;property name=
"text"
&
gt;
&
lt;string&
gt;&
amp;amp;Open...&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"toolTip"
&
gt;
&
lt;string&
gt;Open document&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"shortcut"
&
gt;
&
lt;string&
gt;Ctrl+
O&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;/
action&
gt;
&
lt;action name=
"actionSave"
&
gt;
&
lt;property name=
"text"
&
gt;
&
lt;string&
gt;&
amp;amp;Save&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"toolTip"
&
gt;
&
lt;string&
gt;Save current document&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"shortcut"
&
gt;
&
lt;string&
gt;Ctrl+
S&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;/
action&
gt;
&
lt;action name=
"actionExit"
&
gt;
&
lt;property name=
"text"
&
gt;
&
lt;string&
gt;E&
amp;amp;xit&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"toolTip"
&
gt;
&
lt;string&
gt;Exit editor&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"shortcut"
&
gt;
&
lt;string&
gt;Ctrl+
Q&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;/
action&
gt;
&
lt;action name=
"actionSaveAs"
&
gt;
&
lt;property name=
"text"
&
gt;
&
lt;string&
gt;Save &
amp;amp;As...&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"toolTip"
&
gt;
&
lt;string&
gt;Save document under different name&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;/
action&
gt;
&
lt;action name=
"actionNew"
&
gt;
&
lt;property name=
"text"
&
gt;
&
lt;string&
gt;&
amp;amp;New&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"toolTip"
&
gt;
&
lt;string&
gt;Create new
document&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;property name=
"shortcut"
&
gt;
&
lt;string&
gt;Ctrl+
N&
lt;/
string&
gt;
&
lt;/
property&
gt;
&
lt;/
action&
gt;
&
lt;/
widget&
gt;
&
lt;customwidgets&
gt;
&
lt;customwidget&
gt;
&
lt;class
&
gt;QWebEngineView&
lt;/
class
&
gt;
&
lt;extends&
gt;QWidget&
lt;/
extends&
gt;
&
lt;header&
gt;qwebengineview.h&
lt;/
header&
gt;
&
lt;container&
gt;1
&
lt;/
container&
gt;
&
lt;/
customwidget&
gt;
&
lt;/
customwidgets&
gt;
&
lt;resources/&
gt;
&
lt;connections/&
gt;
&
lt;/
ui&
gt;