SlideShare a Scribd company logo
Ring Documentation, Release 1.5.2
55.18 Using QDial
In this example we will learn about using the QDial class
Load "guilib.ring"
New qApp {
win1 = new qMainWindow() {
setGeometry(100,100,450,500)
setwindowtitle("Using QDial")
new qdial(win1) {
setGeometry(100,100,250,300)
}
show()
}
exec()
}
The application during the runtime
55.18. Using QDial 565
Ring Documentation, Release 1.5.2
Another Example
Load "guilib.ring"
New qApp {
win1 = new qMainWindow()
{
setGeometry(100,100,450,500)
setwindowtitle("Using QDial")
button1 = new QPushButton(win1){
setGeometry(100,350,100,30)
settext("Increment")
setClickEvent("pIncrement()")
}
button2 = new QPushButton(win1){
setGeometry(250,350,100,30)
settext("Decrement")
setClickEvent("pDecrement()")
}
pdial = new qdial(win1) {
55.18. Using QDial 566
Ring Documentation, Release 1.5.2
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())
55.18. Using QDial 567
Ring Documentation, Release 1.5.2
55.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
55.19. Using QWebView 568
Ring Documentation, Release 1.5.2
55.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
55.20. Using QCheckBox 569
Ring Documentation, Release 1.5.2
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
55.21 Using QRadioButton and QButtonGroup
In this example we will learn about using the QRadioButton and QButtonGroup classes
Load "guilib.ring"
55.21. Using QRadioButton and QButtonGroup 570
Ring Documentation, Release 1.5.2
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
55.21. Using QRadioButton and QButtonGroup 571
Ring Documentation, Release 1.5.2
55.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
55.22. Adding Hyperlink to QLabel 572
Ring Documentation, Release 1.5.2
55.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) {
55.23. QVideoWidget and QMediaPlayer 573
Ring Documentation, Release 1.5.2
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
55.23. QVideoWidget and QMediaPlayer 574

More Related Content

PDF
The Ring programming language version 1.5.4 book - Part 63 of 185
PDF
The Ring programming language version 1.5.2 book - Part 62 of 181
PDF
The Ring programming language version 1.5.1 book - Part 57 of 180
PDF
The Ring programming language version 1.6 book - Part 65 of 189
PDF
The Ring programming language version 1.5.1 book - Part 59 of 180
PDF
The Ring programming language version 1.7 book - Part 67 of 196
PDF
The Ring programming language version 1.8 book - Part 69 of 202
PDF
The Ring programming language version 1.9 book - Part 76 of 210
The Ring programming language version 1.5.4 book - Part 63 of 185
The Ring programming language version 1.5.2 book - Part 62 of 181
The Ring programming language version 1.5.1 book - Part 57 of 180
The Ring programming language version 1.6 book - Part 65 of 189
The Ring programming language version 1.5.1 book - Part 59 of 180
The Ring programming language version 1.7 book - Part 67 of 196
The Ring programming language version 1.8 book - Part 69 of 202
The Ring programming language version 1.9 book - Part 76 of 210

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.5.2 book - Part 58 of 181
PDF
The Ring programming language version 1.4.1 book - Part 17 of 31
PDF
The Ring programming language version 1.4.1 book - Part 16 of 31
PDF
The Ring programming language version 1.2 book - Part 41 of 84
PDF
The Ring programming language version 1.5.3 book - Part 72 of 184
PDF
The Ring programming language version 1.10 book - Part 74 of 212
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.6 book - Part 63 of 189
PDF
The Ring programming language version 1.7 book - Part 68 of 196
PDF
The Ring programming language version 1.7 book - Part 69 of 196
PDF
The Ring programming language version 1.4 book - Part 16 of 30
PDF
The Ring programming language version 1.2 book - Part 43 of 84
PDF
The Ring programming language version 1.5.2 book - Part 61 of 181
PDF
The Ring programming language version 1.8 book - Part 70 of 202
PDF
The Ring programming language version 1.2 book - Part 46 of 84
PDF
The Ring programming language version 1.2 book - Part 48 of 84
PDF
The Ring programming language version 1.3 book - Part 45 of 88
PDF
The Ring programming language version 1.3 book - Part 46 of 88
The Ring programming language version 1.5.2 book - Part 59 of 181
The Ring programming language version 1.5.2 book - Part 58 of 181
The Ring programming language version 1.4.1 book - Part 17 of 31
The Ring programming language version 1.4.1 book - Part 16 of 31
The Ring programming language version 1.2 book - Part 41 of 84
The Ring programming language version 1.5.3 book - Part 72 of 184
The Ring programming language version 1.10 book - Part 74 of 212
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.6 book - Part 63 of 189
The Ring programming language version 1.7 book - Part 68 of 196
The Ring programming language version 1.7 book - Part 69 of 196
The Ring programming language version 1.4 book - Part 16 of 30
The Ring programming language version 1.2 book - Part 43 of 84
The Ring programming language version 1.5.2 book - Part 61 of 181
The Ring programming language version 1.8 book - Part 70 of 202
The Ring programming language version 1.2 book - Part 46 of 84
The Ring programming language version 1.2 book - Part 48 of 84
The Ring programming language version 1.3 book - Part 45 of 88
The Ring programming language version 1.3 book - Part 46 of 88
Ad

Similar to The Ring programming language version 1.5.2 book - Part 60 of 181 (15)

PDF
The Ring programming language version 1.5.4 book - Part 61 of 185
PDF
The Ring programming language version 1.7 book - Part 66 of 196
PDF
The Ring programming language version 1.10 book - Part 77 of 212
PDF
The Ring programming language version 1.5.3 book - Part 76 of 184
PDF
The Ring programming language version 1.8 book - Part 68 of 202
PDF
The Ring programming language version 1.5.1 book - Part 58 of 180
PDF
The Ring programming language version 1.5.4 book - Part 62 of 185
PDF
The Ring programming language version 1.10 book - Part 75 of 212
PDF
The Ring programming language version 1.5.4 book - Part 66 of 185
PDF
The Ring programming language version 1.5 book - Part 11 of 31
PDF
The Ring programming language version 1.10 book - Part 76 of 212
PDF
The Ring programming language version 1.9 book - Part 72 of 210
PDF
The Ring programming language version 1.6 book - Part 64 of 189
PDF
The Ring programming language version 1.2 book - Part 45 of 84
PDF
The Ring programming language version 1.3 book - Part 49 of 88
The Ring programming language version 1.5.4 book - Part 61 of 185
The Ring programming language version 1.7 book - Part 66 of 196
The Ring programming language version 1.10 book - Part 77 of 212
The Ring programming language version 1.5.3 book - Part 76 of 184
The Ring programming language version 1.8 book - Part 68 of 202
The Ring programming language version 1.5.1 book - Part 58 of 180
The Ring programming language version 1.5.4 book - Part 62 of 185
The Ring programming language version 1.10 book - Part 75 of 212
The Ring programming language version 1.5.4 book - Part 66 of 185
The Ring programming language version 1.5 book - Part 11 of 31
The Ring programming language version 1.10 book - Part 76 of 212
The Ring programming language version 1.9 book - Part 72 of 210
The Ring programming language version 1.6 book - Part 64 of 189
The Ring programming language version 1.2 book - Part 45 of 84
The Ring programming language version 1.3 book - Part 49 of 88
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)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
KodekX | Application Modernization Development
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
Spectroscopy.pptx food analysis technology
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
cuic standard and advanced reporting.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Approach and Philosophy of On baking technology
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation_ Review paper, used for researhc scholars
Network Security Unit 5.pdf for BCA BBA.
Spectral efficient network and resource selection model in 5G networks
KodekX | Application Modernization Development
Reach Out and Touch Someone: Haptics and Empathic Computing
Spectroscopy.pptx food analysis technology
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Advanced methodologies resolving dimensionality complications for autism neur...
Programs and apps: productivity, graphics, security and other tools
cuic standard and advanced reporting.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Approach and Philosophy of On baking technology
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows

The Ring programming language version 1.5.2 book - Part 60 of 181

  • 1. Ring Documentation, Release 1.5.2 55.18 Using QDial In this example we will learn about using the QDial class Load "guilib.ring" New qApp { win1 = new qMainWindow() { setGeometry(100,100,450,500) setwindowtitle("Using QDial") new qdial(win1) { setGeometry(100,100,250,300) } show() } exec() } The application during the runtime 55.18. Using QDial 565
  • 2. Ring Documentation, Release 1.5.2 Another Example Load "guilib.ring" New qApp { win1 = new qMainWindow() { setGeometry(100,100,450,500) setwindowtitle("Using QDial") button1 = new QPushButton(win1){ setGeometry(100,350,100,30) settext("Increment") setClickEvent("pIncrement()") } button2 = new QPushButton(win1){ setGeometry(250,350,100,30) settext("Decrement") setClickEvent("pDecrement()") } pdial = new qdial(win1) { 55.18. Using QDial 566
  • 3. Ring Documentation, Release 1.5.2 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()) 55.18. Using QDial 567
  • 4. Ring Documentation, Release 1.5.2 55.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 55.19. Using QWebView 568
  • 5. Ring Documentation, Release 1.5.2 55.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 55.20. Using QCheckBox 569
  • 6. Ring Documentation, Release 1.5.2 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 55.21 Using QRadioButton and QButtonGroup In this example we will learn about using the QRadioButton and QButtonGroup classes Load "guilib.ring" 55.21. Using QRadioButton and QButtonGroup 570
  • 7. Ring Documentation, Release 1.5.2 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 55.21. Using QRadioButton and QButtonGroup 571
  • 8. Ring Documentation, Release 1.5.2 55.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 55.22. Adding Hyperlink to QLabel 572
  • 9. Ring Documentation, Release 1.5.2 55.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) { 55.23. QVideoWidget and QMediaPlayer 573
  • 10. Ring Documentation, Release 1.5.2 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 55.23. QVideoWidget and QMediaPlayer 574