SlideShare a Scribd company logo
Ring Documentation, Release 1.3
setGeometry(100,50,250,300)
setNotchesVisible(true)
setValue(50)
SetValueChangedEvent("pDialMove()")
}
lineedit1 = new qlineedit(win1) {
setGeometry(200,400,50,30)
setalignment(Qt_AlignHCenter)
settext(string(pdial.value()))
setreturnPressedEvent("pPress()")
}
show()
}
exec()
}
func pIncrement
pdial{val=value()}
pdial.setvalue(val+1)
lineedit1{settext(string(val+1))}
func pDecrement
pdial{val=value()}
pdial.setvalue(val-1)
lineedit1{settext(string(val-1))}
func pPress
lineedit1{val=text()}
pdial.setvalue(number(val))
func pDialMove
lineedit1.settext(""+pdial.value())
49.18. Using QDial 428
Ring Documentation, Release 1.3
49.19 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
49.19. Using QWebView 429
Ring Documentation, Release 1.3
49.20 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
49.20. Using QCheckBox 430
Ring Documentation, Release 1.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
49.21 Using QRadioButton and QButtonGroup
In this example we will learn about using the QRadioButton and QButtonGroup classes
Load "guilib.ring"
49.21. Using QRadioButton and QButtonGroup 431
Ring Documentation, Release 1.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
49.21. Using QRadioButton and QButtonGroup 432
Ring Documentation, Release 1.3
49.22 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
49.22. Adding Hyperlink to QLabel 433
Ring Documentation, Release 1.3
49.23 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) {
49.23. QVideoWidget and QMediaPlayer 434
Ring Documentation, Release 1.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
49.23. QVideoWidget and QMediaPlayer 435
Ring Documentation, Release 1.3
49.24 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
49.24. Using QFrame 436
Ring Documentation, Release 1.3
49.25 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())
}
49.25. Display Image using QLabel 437

More Related Content

PDF
The Ring programming language version 1.2 book - Part 46 of 84
PDF
The Ring programming language version 1.2 book - Part 47 of 84
PDF
The Ring programming language version 1.2 book - Part 48 of 84
PDF
The Ring programming language version 1.2 book - Part 41 of 84
PDF
The Ring programming language version 1.2 book - Part 49 of 84
PDF
The Ring programming language version 1.2 book - Part 45 of 84
PDF
The Ring programming language version 1.10 book - Part 76 of 212
PDF
The Ring programming language version 1.7 book - Part 69 of 196
The Ring programming language version 1.2 book - Part 46 of 84
The Ring programming language version 1.2 book - Part 47 of 84
The Ring programming language version 1.2 book - Part 48 of 84
The Ring programming language version 1.2 book - Part 41 of 84
The Ring programming language version 1.2 book - Part 49 of 84
The Ring programming language version 1.2 book - Part 45 of 84
The Ring programming language version 1.10 book - Part 76 of 212
The Ring programming language version 1.7 book - Part 69 of 196

What's hot (20)

PDF
The Ring programming language version 1.8 book - Part 71 of 202
PDF
The Ring programming language version 1.5.1 book - Part 57 of 180
PDF
The Ring programming language version 1.6 book - Part 69 of 189
PDF
The Ring programming language version 1.5.1 book - Part 63 of 180
PDF
The Ring programming language version 1.5.1 book - Part 60 of 180
PDF
The Ring programming language version 1.5.4 book - Part 67 of 185
PDF
The Ring programming language version 1.4 book - Part 16 of 30
PDF
The Ring programming language version 1.10 book - Part 74 of 212
PDF
The Ring programming language version 1.5.4 book - Part 65 of 185
PDF
The Ring programming language version 1.4 book - Part 17 of 30
PDF
The Ring programming language version 1.5 book - Part 11 of 31
PDF
The Ring programming language version 1.6 book - Part 66 of 189
PDF
The Ring programming language version 1.10 book - Part 79 of 212
PDF
The Ring programming language version 1.5.1 book - Part 61 of 180
PDF
The Ring programming language version 1.5.3 book - Part 73 of 184
PDF
The Ring programming language version 1.7 book - Part 65 of 196
PDF
The Ring programming language version 1.5.3 book - Part 70 of 184
PDF
The Ring programming language version 1.7 book - Part 67 of 196
PDF
The Ring programming language version 1.7 book - Part 71 of 196
PDF
The Ring programming language version 1.5.2 book - Part 62 of 181
The Ring programming language version 1.8 book - Part 71 of 202
The Ring programming language version 1.5.1 book - Part 57 of 180
The Ring programming language version 1.6 book - Part 69 of 189
The Ring programming language version 1.5.1 book - Part 63 of 180
The Ring programming language version 1.5.1 book - Part 60 of 180
The Ring programming language version 1.5.4 book - Part 67 of 185
The Ring programming language version 1.4 book - Part 16 of 30
The Ring programming language version 1.10 book - Part 74 of 212
The Ring programming language version 1.5.4 book - Part 65 of 185
The Ring programming language version 1.4 book - Part 17 of 30
The Ring programming language version 1.5 book - Part 11 of 31
The Ring programming language version 1.6 book - Part 66 of 189
The Ring programming language version 1.10 book - Part 79 of 212
The Ring programming language version 1.5.1 book - Part 61 of 180
The Ring programming language version 1.5.3 book - Part 73 of 184
The Ring programming language version 1.7 book - Part 65 of 196
The Ring programming language version 1.5.3 book - Part 70 of 184
The Ring programming language version 1.7 book - Part 67 of 196
The Ring programming language version 1.7 book - Part 71 of 196
The Ring programming language version 1.5.2 book - Part 62 of 181
Ad

Similar to The Ring programming language version 1.3 book - Part 46 of 88 (17)

PDF
The Ring programming language version 1.4.1 book - Part 17 of 31
PDF
The Ring programming language version 1.5.1 book - Part 62 of 180
PDF
The Ring programming language version 1.6 book - Part 68 of 189
PDF
The Ring programming language version 1.5.2 book - Part 61 of 181
PDF
The Ring programming language version 1.5.4 book - Part 64 of 185
PDF
The Ring programming language version 1.5.4 book - Part 66 of 185
PDF
The Ring programming language version 1.3 book - Part 44 of 88
PDF
The Ring programming language version 1.8 book - Part 67 of 202
PDF
The Ring programming language version 1.4.1 book - Part 16 of 31
PDF
The Ring programming language version 1.3 book - Part 47 of 88
PDF
The Ring programming language version 1.8 book - Part 70 of 202
PDF
The Ring programming language version 1.6 book - Part 67 of 189
PDF
The Ring programming language version 1.3 book - Part 45 of 88
PDF
The Ring programming language version 1.5.4 book - Part 63 of 185
PDF
The Ring programming language version 1.5.4 book - Part 68 of 185
PDF
The Ring programming language version 1.3 book - Part 50 of 88
PDF
The Ring programming language version 1.7 book - Part 68 of 196
The Ring programming language version 1.4.1 book - Part 17 of 31
The Ring programming language version 1.5.1 book - Part 62 of 180
The Ring programming language version 1.6 book - Part 68 of 189
The Ring programming language version 1.5.2 book - Part 61 of 181
The Ring programming language version 1.5.4 book - Part 64 of 185
The Ring programming language version 1.5.4 book - Part 66 of 185
The Ring programming language version 1.3 book - Part 44 of 88
The Ring programming language version 1.8 book - Part 67 of 202
The Ring programming language version 1.4.1 book - Part 16 of 31
The Ring programming language version 1.3 book - Part 47 of 88
The Ring programming language version 1.8 book - Part 70 of 202
The Ring programming language version 1.6 book - Part 67 of 189
The Ring programming language version 1.3 book - Part 45 of 88
The Ring programming language version 1.5.4 book - Part 63 of 185
The Ring programming language version 1.5.4 book - Part 68 of 185
The Ring programming language version 1.3 book - Part 50 of 88
The Ring programming language version 1.7 book - Part 68 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)

PPTX
Cloud computing and distributed systems.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Encapsulation theory and applications.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
Teaching material agriculture food technology
PPTX
Programs and apps: productivity, graphics, security and other tools
Cloud computing and distributed systems.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Empathic Computing: Creating Shared Understanding
Digital-Transformation-Roadmap-for-Companies.pptx
Review of recent advances in non-invasive hemoglobin estimation
Encapsulation theory and applications.pdf
Spectroscopy.pptx food analysis technology
The Rise and Fall of 3GPP – Time for a Sabbatical?
Mobile App Security Testing_ A Comprehensive Guide.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
20250228 LYD VKU AI Blended-Learning.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Spectral efficient network and resource selection model in 5G networks
NewMind AI Weekly Chronicles - August'25 Week I
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Teaching material agriculture food technology
Programs and apps: productivity, graphics, security and other tools

The Ring programming language version 1.3 book - Part 46 of 88

  • 1. Ring Documentation, Release 1.3 setGeometry(100,50,250,300) setNotchesVisible(true) setValue(50) SetValueChangedEvent("pDialMove()") } lineedit1 = new qlineedit(win1) { setGeometry(200,400,50,30) setalignment(Qt_AlignHCenter) settext(string(pdial.value())) setreturnPressedEvent("pPress()") } show() } exec() } func pIncrement pdial{val=value()} pdial.setvalue(val+1) lineedit1{settext(string(val+1))} func pDecrement pdial{val=value()} pdial.setvalue(val-1) lineedit1{settext(string(val-1))} func pPress lineedit1{val=text()} pdial.setvalue(number(val)) func pDialMove lineedit1.settext(""+pdial.value()) 49.18. Using QDial 428
  • 2. Ring Documentation, Release 1.3 49.19 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 49.19. Using QWebView 429
  • 3. Ring Documentation, Release 1.3 49.20 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 49.20. Using QCheckBox 430
  • 4. Ring Documentation, Release 1.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 49.21 Using QRadioButton and QButtonGroup In this example we will learn about using the QRadioButton and QButtonGroup classes Load "guilib.ring" 49.21. Using QRadioButton and QButtonGroup 431
  • 5. Ring Documentation, Release 1.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 49.21. Using QRadioButton and QButtonGroup 432
  • 6. Ring Documentation, Release 1.3 49.22 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 49.22. Adding Hyperlink to QLabel 433
  • 7. Ring Documentation, Release 1.3 49.23 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) { 49.23. QVideoWidget and QMediaPlayer 434
  • 8. Ring Documentation, Release 1.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 49.23. QVideoWidget and QMediaPlayer 435
  • 9. Ring Documentation, Release 1.3 49.24 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 49.24. Using QFrame 436
  • 10. Ring Documentation, Release 1.3 49.25 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()) } 49.25. Display Image using QLabel 437