SlideShare a Scribd company logo
Ring Documentation, Release 1.5.3
56.20 Using QWebView
In this example we will learn about using the QWebView class
Load "guilib.ring"
New qApp {
win1 = new qMainWindow() {
setwindowtitle("QWebView")
myweb = new qwebview(win1) {
setGeometry(10,10,600,600)
loadpage(new qurl("http://google.com"))
}
setcentralwidget(myweb)
showMaximized()
}
exec()
}
The application during the runtime
56.20. Using QWebView 595
Ring Documentation, Release 1.5.3
56.21 Using QCheckBox
In this example we will learn about using the QCheckBox class
Load "guilib.ring"
New qApp {
win1 = new qMainWindow() {
setwindowtitle("Using QCheckBox")
new qcheckbox(win1) {
setGeometry(100,100,100,30)
settext("New Customer!")
}
showMaximized()
}
exec()
}
The application during the runtime
56.21. Using QCheckBox 596
Ring Documentation, Release 1.5.3
Another Example:
Load "guilib.ring"
New qApp {
win1 = new qMainWindow() {
setGeometry(100,100,400,300)
setwindowtitle("Using QCheckBox")
### 0-Unchecked 1-Checked
CheckBox = new qcheckbox(win1) {
setGeometry(100,100,160,30)
settext("New Customer!")
setclickedEvent("HandleClickEvent()")
}
show()
}
exec()
}
Func HandleClickEvent
if CheckBox.isChecked() = 1
CheckBox.settext("New Customer. Check 1-ON")
else
CheckBox.settext("New Customer. Check 0-OFF")
ok
56.22 Using QRadioButton and QButtonGroup
In this example we will learn about using the QRadioButton and QButtonGroup classes
Load "guilib.ring"
56.22. Using QRadioButton and QButtonGroup 597
Ring Documentation, Release 1.5.3
New qApp {
win1 = new qMainWindow() {
setwindowtitle("Using QRadioButton")
new qradiobutton(win1) {
setGeometry(100,100,100,30)
settext("One")
}
new qradiobutton(win1) {
setGeometry(100,150,100,30)
settext("Two")
}
new qradiobutton(win1) {
setGeometry(100,200,100,30)
settext("Three")
}
group2 = new qbuttongroup(win1) {
btn4 = new qradiobutton(win1) {
setGeometry(200,150,100,30)
settext("Four")
}
btn5 = new qradiobutton(win1) {
setGeometry(200,200,100,30)
settext("Five")
}
addbutton(btn4,0)
addbutton(btn5,0)
}
showMaximized()
}
exec()
}
The application during the runtime
56.22. Using QRadioButton and QButtonGroup 598
Ring Documentation, Release 1.5.3
56.23 Adding Hyperlink to QLabel
In this example we will learn about creating Hyperlink using the QLabel class
Load "guilib.ring"
New qApp {
win1 = new qMainWindow() {
setwindowtitle("QLabel - Hyperlink")
new qlabel(win1) {
setGeometry(100,100,100,30)
setopenexternallinks(true)
settext('<a href="http://google.com">Google</a>')
}
showMaximized()
}
exec()
}
The application during the runtime
56.23. Adding Hyperlink to QLabel 599
Ring Documentation, Release 1.5.3
56.24 QVideoWidget and QMediaPlayer
In this example we will learn about using the QVideoWidget and QMediaPlayer classes to play a group of movies
from different positions at the same time
Load "guilib.ring"
New qApp {
win1 = new qMainWindow() {
setwindowtitle("QVideoWidget")
btn1 = new qpushbutton(win1) {
setGeometry(0,0,100,30)
settext("play")
setclickevent("player.play() player2.play()
player3.play() player4.play()")
}
videowidget = new qvideowidget(win1) {
setGeometry(50,50,600,300)
setstylesheet("background-color: black")
}
videowidget2 = new qvideowidget(win1) {
setGeometry(700,50,600,300)
setstylesheet("background-color: black")
}
videowidget3 = new qvideowidget(win1) {
setGeometry(50,370,600,300)
setstylesheet("background-color: black")
}
videowidget4 = new qvideowidget(win1) {
56.24. QVideoWidget and QMediaPlayer 600
Ring Documentation, Release 1.5.3
setGeometry(700,370,600,300)
setstylesheet("background-color: black")
}
player = new qmediaplayer() {
setmedia(new qurl("1.mp4"))
setvideooutput(videowidget)
setposition(35*60*1000)
}
player2 = new qmediaplayer() {
setmedia(new qurl("2.mp4"))
setvideooutput(videowidget2)
setposition(23*60*1000)
}
player3 = new qmediaplayer() {
setmedia(new qurl("3.mp4"))
setvideooutput(videowidget3)
setposition(14.22*60*1000)
}
player4 = new qmediaplayer() {
setmedia(new qurl("4.avi"))
setvideooutput(videowidget4)
setposition(8*60*1000)
}
showfullscreen()
}
exec()
}
The application during the runtime
56.24. QVideoWidget and QMediaPlayer 601
Ring Documentation, Release 1.5.3
56.25 Using QFrame
In this example we will learn about using the QFrame class
Load "guilib.ring"
New qApp {
win1 = new qMainWindow() {
setwindowtitle("Using QFrame")
for x = 0 to 10
frame1 = new qframe(win1,0) {
setGeometry(100,20+50*x,400,30)
setframestyle(QFrame_Raised | QFrame_WinPanel)
}
next
showMaximized()
}
exec()
}
The application during the runtime
56.25. Using QFrame 602
Ring Documentation, Release 1.5.3
56.26 Display Image using QLabel
In this example we will learn about displaying an image using the QLabel widget
Load "guilib.ring"
New qApp {
win1 = new qMainWindow() {
setwindowtitle("QLabel - Display image")
new qlabel(win1) {
image = new qpixmap("b:/mahmoud/photo/advice.jpg")
setpixmap(image)
setGeometry(0,0,image.width(),image.height())
}
56.26. Display Image using QLabel 603
Ring Documentation, Release 1.5.3
showMaximized()
}
exec()
}
The application during the runtime
56.27 Menubar and StyleSheet Example
In this example we will learn about creating menubar and setting the window stylesheet
Load "guilib.ring"
New qApp {
56.27. Menubar and StyleSheet Example 604

More Related Content

PDF
The Ring programming language version 1.10 book - Part 75 of 212
PDF
The Ring programming language version 1.5.2 book - Part 62 of 181
PDF
The Ring programming language version 1.7 book - Part 67 of 196
PDF
The Ring programming language version 1.9 book - Part 76 of 210
PDF
The Ring programming language version 1.2 book - Part 43 of 84
PDF
The Ring programming language version 1.10 book - Part 74 of 212
PDF
The Ring programming language version 1.5.3 book - Part 72 of 184
PDF
The Ring programming language version 1.5.4 book - Part 63 of 185
The Ring programming language version 1.10 book - Part 75 of 212
The Ring programming language version 1.5.2 book - Part 62 of 181
The Ring programming language version 1.7 book - Part 67 of 196
The Ring programming language version 1.9 book - Part 76 of 210
The Ring programming language version 1.2 book - Part 43 of 84
The Ring programming language version 1.10 book - Part 74 of 212
The Ring programming language version 1.5.3 book - Part 72 of 184
The Ring programming language version 1.5.4 book - Part 63 of 185

What's hot (20)

PDF
The Ring programming language version 1.5.2 book - Part 59 of 181
PDF
The Ring programming language version 1.3 book - Part 45 of 88
PDF
The Ring programming language version 1.8 book - Part 69 of 202
PDF
The Ring programming language version 1.2 book - Part 41 of 84
PDF
The Ring programming language version 1.3 book - Part 46 of 88
PDF
The Ring programming language version 1.6 book - Part 64 of 189
PDF
The Ring programming language version 1.5.1 book - Part 60 of 180
PDF
The Ring programming language version 1.6 book - Part 66 of 189
PDF
The Ring programming language version 1.2 book - Part 46 of 84
PDF
The Ring programming language version 1.5.2 book - Part 60 of 181
PDF
The Ring programming language version 1.9 book - Part 74 of 210
PDF
The Ring programming language version 1.6 book - Part 65 of 189
PDF
The Ring programming language version 1.5.1 book - Part 58 of 180
PDF
The Ring programming language version 1.2 book - Part 48 of 84
PDF
The Ring programming language version 1.7 book - Part 65 of 196
PDF
The Ring programming language version 1.7 book - Part 69 of 196
PDF
The Ring programming language version 1.8 book - Part 67 of 202
PDF
The Ring programming language version 1.5.4 book - Part 62 of 185
PDF
The Ring programming language version 1.5.3 book - Part 76 of 184
PDF
The Ring programming language version 1.4.1 book - Part 16 of 31
The Ring programming language version 1.5.2 book - Part 59 of 181
The Ring programming language version 1.3 book - Part 45 of 88
The Ring programming language version 1.8 book - Part 69 of 202
The Ring programming language version 1.2 book - Part 41 of 84
The Ring programming language version 1.3 book - Part 46 of 88
The Ring programming language version 1.6 book - Part 64 of 189
The Ring programming language version 1.5.1 book - Part 60 of 180
The Ring programming language version 1.6 book - Part 66 of 189
The Ring programming language version 1.2 book - Part 46 of 84
The Ring programming language version 1.5.2 book - Part 60 of 181
The Ring programming language version 1.9 book - Part 74 of 210
The Ring programming language version 1.6 book - Part 65 of 189
The Ring programming language version 1.5.1 book - Part 58 of 180
The Ring programming language version 1.2 book - Part 48 of 84
The Ring programming language version 1.7 book - Part 65 of 196
The Ring programming language version 1.7 book - Part 69 of 196
The Ring programming language version 1.8 book - Part 67 of 202
The Ring programming language version 1.5.4 book - Part 62 of 185
The Ring programming language version 1.5.3 book - Part 76 of 184
The Ring programming language version 1.4.1 book - Part 16 of 31
Ad

Similar to The Ring programming language version 1.5.3 book - Part 73 of 184 (19)

PDF
The Ring programming language version 1.2 book - Part 44 of 84
PDF
The Ring programming language version 1.8 book - Part 70 of 202
PDF
The Ring programming language version 1.4.1 book - Part 17 of 31
PDF
The Ring programming language version 1.9 book - Part 73 of 210
PDF
The Ring programming language version 1.7 book - Part 68 of 196
PDF
The Ring programming language version 1.4 book - Part 16 of 30
PDF
The Ring programming language version 1.5.1 book - Part 59 of 180
PDF
The Ring programming language version 1.3 book - Part 44 of 88
PDF
The Ring programming language version 1.5.1 book - Part 57 of 180
PDF
The Ring programming language version 1.5.4 book - Part 71 of 185
PDF
The Ring programming language version 1.5.4 book - Part 65 of 185
PDF
The Ring programming language version 1.5.4 book - Part 61 of 185
PDF
The Ring programming language version 1.10 book - Part 77 of 212
PDF
The Ring programming language version 1.9 book - Part 82 of 210
PDF
The Ring programming language version 1.2 book - Part 51 of 84
PDF
The Ring programming language version 1.5.2 book - Part 61 of 181
PDF
The Ring programming language version 1.5.3 book - Part 81 of 184
PDF
The Ring programming language version 1.8 book - Part 72 of 202
PDF
The Ring programming language version 1.7 book - Part 70 of 196
The Ring programming language version 1.2 book - Part 44 of 84
The Ring programming language version 1.8 book - Part 70 of 202
The Ring programming language version 1.4.1 book - Part 17 of 31
The Ring programming language version 1.9 book - Part 73 of 210
The Ring programming language version 1.7 book - Part 68 of 196
The Ring programming language version 1.4 book - Part 16 of 30
The Ring programming language version 1.5.1 book - Part 59 of 180
The Ring programming language version 1.3 book - Part 44 of 88
The Ring programming language version 1.5.1 book - Part 57 of 180
The Ring programming language version 1.5.4 book - Part 71 of 185
The Ring programming language version 1.5.4 book - Part 65 of 185
The Ring programming language version 1.5.4 book - Part 61 of 185
The Ring programming language version 1.10 book - Part 77 of 212
The Ring programming language version 1.9 book - Part 82 of 210
The Ring programming language version 1.2 book - Part 51 of 84
The Ring programming language version 1.5.2 book - Part 61 of 181
The Ring programming language version 1.5.3 book - Part 81 of 184
The Ring programming language version 1.8 book - Part 72 of 202
The Ring programming language version 1.7 book - Part 70 of 196
Ad

More from Mahmoud Samir Fayed (20)

PDF
The Ring programming language version 1.10 book - Part 212 of 212
PDF
The Ring programming language version 1.10 book - Part 211 of 212
PDF
The Ring programming language version 1.10 book - Part 210 of 212
PDF
The Ring programming language version 1.10 book - Part 208 of 212
PDF
The Ring programming language version 1.10 book - Part 207 of 212
PDF
The Ring programming language version 1.10 book - Part 205 of 212
PDF
The Ring programming language version 1.10 book - Part 206 of 212
PDF
The Ring programming language version 1.10 book - Part 204 of 212
PDF
The Ring programming language version 1.10 book - Part 203 of 212
PDF
The Ring programming language version 1.10 book - Part 202 of 212
PDF
The Ring programming language version 1.10 book - Part 201 of 212
PDF
The Ring programming language version 1.10 book - Part 200 of 212
PDF
The Ring programming language version 1.10 book - Part 199 of 212
PDF
The Ring programming language version 1.10 book - Part 198 of 212
PDF
The Ring programming language version 1.10 book - Part 197 of 212
PDF
The Ring programming language version 1.10 book - Part 196 of 212
PDF
The Ring programming language version 1.10 book - Part 195 of 212
PDF
The Ring programming language version 1.10 book - Part 194 of 212
PDF
The Ring programming language version 1.10 book - Part 193 of 212
PDF
The Ring programming language version 1.10 book - Part 192 of 212
The Ring programming language version 1.10 book - Part 212 of 212
The Ring programming language version 1.10 book - Part 211 of 212
The Ring programming language version 1.10 book - Part 210 of 212
The Ring programming language version 1.10 book - Part 208 of 212
The Ring programming language version 1.10 book - Part 207 of 212
The Ring programming language version 1.10 book - Part 205 of 212
The Ring programming language version 1.10 book - Part 206 of 212
The Ring programming language version 1.10 book - Part 204 of 212
The Ring programming language version 1.10 book - Part 203 of 212
The Ring programming language version 1.10 book - Part 202 of 212
The Ring programming language version 1.10 book - Part 201 of 212
The Ring programming language version 1.10 book - Part 200 of 212
The Ring programming language version 1.10 book - Part 199 of 212
The Ring programming language version 1.10 book - Part 198 of 212
The Ring programming language version 1.10 book - Part 197 of 212
The Ring programming language version 1.10 book - Part 196 of 212
The Ring programming language version 1.10 book - Part 195 of 212
The Ring programming language version 1.10 book - Part 194 of 212
The Ring programming language version 1.10 book - Part 193 of 212
The Ring programming language version 1.10 book - Part 192 of 212

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
cuic standard and advanced reporting.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
KodekX | Application Modernization Development
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Teaching material agriculture food technology
Chapter 3 Spatial Domain Image Processing.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Empathic Computing: Creating Shared Understanding
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Approach and Philosophy of On baking technology
Unlocking AI with Model Context Protocol (MCP)
Diabetes mellitus diagnosis method based random forest with bat algorithm
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Review of recent advances in non-invasive hemoglobin estimation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
cuic standard and advanced reporting.pdf
Spectroscopy.pptx food analysis technology
KodekX | Application Modernization Development
NewMind AI Weekly Chronicles - August'25 Week I
Spectral efficient network and resource selection model in 5G networks
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

The Ring programming language version 1.5.3 book - Part 73 of 184

  • 1. Ring Documentation, Release 1.5.3 56.20 Using QWebView In this example we will learn about using the QWebView class Load "guilib.ring" New qApp { win1 = new qMainWindow() { setwindowtitle("QWebView") myweb = new qwebview(win1) { setGeometry(10,10,600,600) loadpage(new qurl("http://google.com")) } setcentralwidget(myweb) showMaximized() } exec() } The application during the runtime 56.20. Using QWebView 595
  • 2. Ring Documentation, Release 1.5.3 56.21 Using QCheckBox In this example we will learn about using the QCheckBox class Load "guilib.ring" New qApp { win1 = new qMainWindow() { setwindowtitle("Using QCheckBox") new qcheckbox(win1) { setGeometry(100,100,100,30) settext("New Customer!") } showMaximized() } exec() } The application during the runtime 56.21. Using QCheckBox 596
  • 3. Ring Documentation, Release 1.5.3 Another Example: Load "guilib.ring" New qApp { win1 = new qMainWindow() { setGeometry(100,100,400,300) setwindowtitle("Using QCheckBox") ### 0-Unchecked 1-Checked CheckBox = new qcheckbox(win1) { setGeometry(100,100,160,30) settext("New Customer!") setclickedEvent("HandleClickEvent()") } show() } exec() } Func HandleClickEvent if CheckBox.isChecked() = 1 CheckBox.settext("New Customer. Check 1-ON") else CheckBox.settext("New Customer. Check 0-OFF") ok 56.22 Using QRadioButton and QButtonGroup In this example we will learn about using the QRadioButton and QButtonGroup classes Load "guilib.ring" 56.22. Using QRadioButton and QButtonGroup 597
  • 4. Ring Documentation, Release 1.5.3 New qApp { win1 = new qMainWindow() { setwindowtitle("Using QRadioButton") new qradiobutton(win1) { setGeometry(100,100,100,30) settext("One") } new qradiobutton(win1) { setGeometry(100,150,100,30) settext("Two") } new qradiobutton(win1) { setGeometry(100,200,100,30) settext("Three") } group2 = new qbuttongroup(win1) { btn4 = new qradiobutton(win1) { setGeometry(200,150,100,30) settext("Four") } btn5 = new qradiobutton(win1) { setGeometry(200,200,100,30) settext("Five") } addbutton(btn4,0) addbutton(btn5,0) } showMaximized() } exec() } The application during the runtime 56.22. Using QRadioButton and QButtonGroup 598
  • 5. Ring Documentation, Release 1.5.3 56.23 Adding Hyperlink to QLabel In this example we will learn about creating Hyperlink using the QLabel class Load "guilib.ring" New qApp { win1 = new qMainWindow() { setwindowtitle("QLabel - Hyperlink") new qlabel(win1) { setGeometry(100,100,100,30) setopenexternallinks(true) settext('<a href="http://google.com">Google</a>') } showMaximized() } exec() } The application during the runtime 56.23. Adding Hyperlink to QLabel 599
  • 6. Ring Documentation, Release 1.5.3 56.24 QVideoWidget and QMediaPlayer In this example we will learn about using the QVideoWidget and QMediaPlayer classes to play a group of movies from different positions at the same time Load "guilib.ring" New qApp { win1 = new qMainWindow() { setwindowtitle("QVideoWidget") btn1 = new qpushbutton(win1) { setGeometry(0,0,100,30) settext("play") setclickevent("player.play() player2.play() player3.play() player4.play()") } videowidget = new qvideowidget(win1) { setGeometry(50,50,600,300) setstylesheet("background-color: black") } videowidget2 = new qvideowidget(win1) { setGeometry(700,50,600,300) setstylesheet("background-color: black") } videowidget3 = new qvideowidget(win1) { setGeometry(50,370,600,300) setstylesheet("background-color: black") } videowidget4 = new qvideowidget(win1) { 56.24. QVideoWidget and QMediaPlayer 600
  • 7. Ring Documentation, Release 1.5.3 setGeometry(700,370,600,300) setstylesheet("background-color: black") } player = new qmediaplayer() { setmedia(new qurl("1.mp4")) setvideooutput(videowidget) setposition(35*60*1000) } player2 = new qmediaplayer() { setmedia(new qurl("2.mp4")) setvideooutput(videowidget2) setposition(23*60*1000) } player3 = new qmediaplayer() { setmedia(new qurl("3.mp4")) setvideooutput(videowidget3) setposition(14.22*60*1000) } player4 = new qmediaplayer() { setmedia(new qurl("4.avi")) setvideooutput(videowidget4) setposition(8*60*1000) } showfullscreen() } exec() } The application during the runtime 56.24. QVideoWidget and QMediaPlayer 601
  • 8. Ring Documentation, Release 1.5.3 56.25 Using QFrame In this example we will learn about using the QFrame class Load "guilib.ring" New qApp { win1 = new qMainWindow() { setwindowtitle("Using QFrame") for x = 0 to 10 frame1 = new qframe(win1,0) { setGeometry(100,20+50*x,400,30) setframestyle(QFrame_Raised | QFrame_WinPanel) } next showMaximized() } exec() } The application during the runtime 56.25. Using QFrame 602
  • 9. Ring Documentation, Release 1.5.3 56.26 Display Image using QLabel In this example we will learn about displaying an image using the QLabel widget Load "guilib.ring" New qApp { win1 = new qMainWindow() { setwindowtitle("QLabel - Display image") new qlabel(win1) { image = new qpixmap("b:/mahmoud/photo/advice.jpg") setpixmap(image) setGeometry(0,0,image.width(),image.height()) } 56.26. Display Image using QLabel 603
  • 10. Ring Documentation, Release 1.5.3 showMaximized() } exec() } The application during the runtime 56.27 Menubar and StyleSheet Example In this example we will learn about creating menubar and setting the window stylesheet Load "guilib.ring" New qApp { 56.27. Menubar and StyleSheet Example 604