SlideShare a Scribd company logo
Ring Documentation, Release 1.7
exec()
}
The application during the runtime
59.15 Using QProgressBar
In this example we will learn about using the QProgressBar class
Load "guilib.ring"
New qApp {
win1 = new qMainWindow() {
setGeometry(100,100,600,150)
setwindowtitle("Using QProgressBar")
for x = 10 to 100 step 10
new qprogressbar(win1) {
setGeometry(100,x,350,30)
setvalue(x)
}
next
show()
}
exec()
}
The application during the runtime
59.15. Using QProgressBar 632
Ring Documentation, Release 1.7
59.16 Using QSpinBox
In this example we will learn about using the QSpinBox class
Load "guilib.ring"
New qApp {
win1 = new qMainWindow() {
setGeometry(100,100,450,260)
setwindowtitle("Using QSpinBox")
new qspinbox(win1) {
setGeometry(50,100,350,30)
setvalue(50)
}
show()
}
exec()
}
The application during the runtime
59.16. Using QSpinBox 633
Ring Documentation, Release 1.7
59.17 Using QSlider
In this example we will learn about using the QSlider class
Load "guilib.ring"
New qApp {
win1 = new qMainWindow() {
setGeometry(100,100,500,400)
setwindowtitle("Using QSlider")
new qslider(win1) {
setGeometry(100,100,50,130)
settickinterval(50)
}
new qslider(win1) {
setGeometry(100,250,250,30)
settickinterval(50)
setorientation(Qt_Horizontal)
}
show()
}
exec()
}
The application during the runtime
59.17. Using QSlider 634
Ring Documentation, Release 1.7
59.18 Using QDateEdit
In this example we will learn about using the QDateEdit class
Load "guilib.ring"
New qApp {
win1 = new qMainWindow() {
setwindowtitle("Using QDateEdit")
setGeometry(100,100,250,100)
new qdateedit(win1) {
setGeometry(20,40,220,30)
}
show()
}
exec()
}
The application during the runtime
59.18. Using QDateEdit 635
Ring Documentation, Release 1.7
59.19 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
59.19. Using QDial 636
Ring Documentation, Release 1.7
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) {
59.19. Using QDial 637
Ring Documentation, Release 1.7
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())
59.19. Using QDial 638
Ring Documentation, Release 1.7
59.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
59.20. Using QWebView 639
Ring Documentation, Release 1.7
59.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
59.21. Using QCheckBox 640
Ring Documentation, Release 1.7
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
59.22 Using QRadioButton and QButtonGroup
In this example we will learn about using the QRadioButton and QButtonGroup classes
Load "guilib.ring"
59.22. Using QRadioButton and QButtonGroup 641

More Related Content

PDF
The Ring programming language version 1.8 book - Part 69 of 202
PDF
The Ring programming language version 1.3 book - Part 45 of 88
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.2 book - Part 59 of 181
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 62 of 185
PDF
The Ring programming language version 1.5.4 book - Part 63 of 185
The Ring programming language version 1.8 book - Part 69 of 202
The Ring programming language version 1.3 book - Part 45 of 88
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.2 book - Part 59 of 181
The Ring programming language version 1.5.3 book - Part 72 of 184
The Ring programming language version 1.5.4 book - Part 62 of 185
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.1 book - Part 58 of 180
PDF
The Ring programming language version 1.6 book - Part 65 of 189
PDF
The Ring programming language version 1.9 book - Part 76 of 210
PDF
The Ring programming language version 1.5.3 book - Part 73 of 184
PDF
The Ring programming language version 1.6 book - Part 63 of 189
PDF
The Ring programming language version 1.9 book - Part 73 of 210
PDF
The Ring programming language version 1.2 book - Part 41 of 84
PDF
The Ring programming language version 1.5.2 book - Part 62 of 181
PDF
The Ring programming language version 1.6 book - Part 64 of 189
PDF
The Ring programming language version 1.2 book - Part 42 of 84
PDF
The Ring programming language version 1.8 book - Part 67 of 202
PDF
The Ring programming language version 1.7 book - Part 69 of 196
PDF
The Ring programming language version 1.5.1 book - Part 57 of 180
PDF
The Ring programming language version 1.7 book - Part 71 of 196
PDF
The Ring programming language version 1.5.2 book - Part 60 of 181
PDF
The Ring programming language version 1.7 book - Part 65 of 196
PDF
The Ring programming language version 1.8 book - Part 71 of 202
PDF
The Ring programming language version 1.5.2 book - Part 58 of 181
PDF
The Ring programming language version 1.9 book - Part 72 of 210
PDF
The Ring programming language version 1.2 book - Part 46 of 84
The Ring programming language version 1.5.1 book - Part 58 of 180
The Ring programming language version 1.6 book - Part 65 of 189
The Ring programming language version 1.9 book - Part 76 of 210
The Ring programming language version 1.5.3 book - Part 73 of 184
The Ring programming language version 1.6 book - Part 63 of 189
The Ring programming language version 1.9 book - Part 73 of 210
The Ring programming language version 1.2 book - Part 41 of 84
The Ring programming language version 1.5.2 book - Part 62 of 181
The Ring programming language version 1.6 book - Part 64 of 189
The Ring programming language version 1.2 book - Part 42 of 84
The Ring programming language version 1.8 book - Part 67 of 202
The Ring programming language version 1.7 book - Part 69 of 196
The Ring programming language version 1.5.1 book - Part 57 of 180
The Ring programming language version 1.7 book - Part 71 of 196
The Ring programming language version 1.5.2 book - Part 60 of 181
The Ring programming language version 1.7 book - Part 65 of 196
The Ring programming language version 1.8 book - Part 71 of 202
The Ring programming language version 1.5.2 book - Part 58 of 181
The Ring programming language version 1.9 book - Part 72 of 210
The Ring programming language version 1.2 book - Part 46 of 84
Ad

Similar to The Ring programming language version 1.7 book - Part 67 of 196 (20)

PDF
The Ring programming language version 1.5.1 book - Part 59 of 180
PDF
The Ring programming language version 1.4.1 book - Part 17 of 31
PDF
The Ring programming language version 1.4 book - Part 16 of 30
PDF
The Ring programming language version 1.5 book - Part 11 of 31
PDF
The Ring programming language version 1.5.2 book - Part 61 of 181
PDF
The Ring programming language version 1.4 book - Part 17 of 30
PDF
The Ring programming language version 1.3 book - Part 48 of 88
PDF
The Ring programming language version 1.4.1 book - Part 16 of 31
PDF
The Ring programming language version 1.3 book - Part 46 of 88
PDF
The Ring programming language version 1.6 book - Part 66 of 189
PDF
The Ring programming language version 1.3 book - Part 44 of 88
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.7 book - Part 70 of 196
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 64 of 185
PDF
The Ring programming language version 1.10 book - Part 73 of 212
PDF
The Ring programming language version 1.9 book - Part 75 of 210
PDF
The Ring programming language version 1.5.2 book - Part 63 of 181
PDF
The Ring programming language version 1.7 book - Part 66 of 196
The Ring programming language version 1.5.1 book - Part 59 of 180
The Ring programming language version 1.4.1 book - Part 17 of 31
The Ring programming language version 1.4 book - Part 16 of 30
The Ring programming language version 1.5 book - Part 11 of 31
The Ring programming language version 1.5.2 book - Part 61 of 181
The Ring programming language version 1.4 book - Part 17 of 30
The Ring programming language version 1.3 book - Part 48 of 88
The Ring programming language version 1.4.1 book - Part 16 of 31
The Ring programming language version 1.3 book - Part 46 of 88
The Ring programming language version 1.6 book - Part 66 of 189
The Ring programming language version 1.3 book - Part 44 of 88
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.7 book - Part 70 of 196
The Ring programming language version 1.5.1 book - Part 60 of 180
The Ring programming language version 1.5.4 book - Part 64 of 185
The Ring programming language version 1.10 book - Part 73 of 212
The Ring programming language version 1.9 book - Part 75 of 210
The Ring programming language version 1.5.2 book - Part 63 of 181
The Ring programming language version 1.7 book - Part 66 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)

PDF
KodekX | Application Modernization Development
 
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
DOCX
The AUB Centre for AI in Media Proposal.docx
 
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Empathic Computing: Creating Shared Understanding
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Cloud computing and distributed systems.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
cuic standard and advanced reporting.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KodekX | Application Modernization Development
 
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
The AUB Centre for AI in Media Proposal.docx
 
Encapsulation_ Review paper, used for researhc scholars
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Dropbox Q2 2025 Financial Results & Investor Presentation
Unlocking AI with Model Context Protocol (MCP)
Empathic Computing: Creating Shared Understanding
NewMind AI Weekly Chronicles - August'25 Week I
Cloud computing and distributed systems.
Reach Out and Touch Someone: Haptics and Empathic Computing
cuic standard and advanced reporting.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
sap open course for s4hana steps from ECC to s4
Review of recent advances in non-invasive hemoglobin estimation
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

The Ring programming language version 1.7 book - Part 67 of 196

  • 1. Ring Documentation, Release 1.7 exec() } The application during the runtime 59.15 Using QProgressBar In this example we will learn about using the QProgressBar class Load "guilib.ring" New qApp { win1 = new qMainWindow() { setGeometry(100,100,600,150) setwindowtitle("Using QProgressBar") for x = 10 to 100 step 10 new qprogressbar(win1) { setGeometry(100,x,350,30) setvalue(x) } next show() } exec() } The application during the runtime 59.15. Using QProgressBar 632
  • 2. Ring Documentation, Release 1.7 59.16 Using QSpinBox In this example we will learn about using the QSpinBox class Load "guilib.ring" New qApp { win1 = new qMainWindow() { setGeometry(100,100,450,260) setwindowtitle("Using QSpinBox") new qspinbox(win1) { setGeometry(50,100,350,30) setvalue(50) } show() } exec() } The application during the runtime 59.16. Using QSpinBox 633
  • 3. Ring Documentation, Release 1.7 59.17 Using QSlider In this example we will learn about using the QSlider class Load "guilib.ring" New qApp { win1 = new qMainWindow() { setGeometry(100,100,500,400) setwindowtitle("Using QSlider") new qslider(win1) { setGeometry(100,100,50,130) settickinterval(50) } new qslider(win1) { setGeometry(100,250,250,30) settickinterval(50) setorientation(Qt_Horizontal) } show() } exec() } The application during the runtime 59.17. Using QSlider 634
  • 4. Ring Documentation, Release 1.7 59.18 Using QDateEdit In this example we will learn about using the QDateEdit class Load "guilib.ring" New qApp { win1 = new qMainWindow() { setwindowtitle("Using QDateEdit") setGeometry(100,100,250,100) new qdateedit(win1) { setGeometry(20,40,220,30) } show() } exec() } The application during the runtime 59.18. Using QDateEdit 635
  • 5. Ring Documentation, Release 1.7 59.19 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 59.19. Using QDial 636
  • 6. Ring Documentation, Release 1.7 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) { 59.19. Using QDial 637
  • 7. Ring Documentation, Release 1.7 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()) 59.19. Using QDial 638
  • 8. Ring Documentation, Release 1.7 59.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 59.20. Using QWebView 639
  • 9. Ring Documentation, Release 1.7 59.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 59.21. Using QCheckBox 640
  • 10. Ring Documentation, Release 1.7 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 59.22 Using QRadioButton and QButtonGroup In this example we will learn about using the QRadioButton and QButtonGroup classes Load "guilib.ring" 59.22. Using QRadioButton and QButtonGroup 641