SlideShare a Scribd company logo
Ring Documentation, Release 1.2
win1.setwindowtitle("After Delete - NbrOfItems: " + nbrOfItems +
" CurItemNbr: " + curItemNbr +" CurValue: " + curValue )
}
47.5 Using QTreeView and QFileSystemModel
In this example we will learn how to use the QTreeView widget to represent the File System
Load "guilib.ring"
New qApp {
win1 = New qWidget() {
setwindowtitle("Using QTreeView and QFileSystemModel")
setGeometry(100,100,500,400)
New qtreeview(win1) {
setGeometry(00,00,500,400)
oDir = new QDir()
ofile = new QFileSystemModel()
ofile.setrootpath(oDir.currentpath())
setmodel(ofile)
}
show()
}
exec()
}
The application during the runtime
47.5. Using QTreeView and QFileSystemModel 390
Ring Documentation, Release 1.2
47.6 Using QTreeWidget and QTreeWidgetItem
In this example we will learn about using the QTreeWidget and QTreeWidgetItem classes
Load "guilib.ring"
New qApp {
win1 = new qWidget() {
setwindowtitle("TreeWidget")
setGeometry(100,100,400,400)
layout1 = new qvboxlayout()
tree1 = new qtreewidget(win1) {
setGeometry(00,00,400,400)
setcolumncount(1)
myitem = new qtreewidgetitem()
myitem.settext(0,"The First Step")
addtoplevelitem(myitem)
for x = 1 to 10
myitem2 = new qtreewidgetitem()
myitem2.settext(0,"hello"+x)
myitem.addchild(myitem2)
47.6. Using QTreeWidget and QTreeWidgetItem 391
Ring Documentation, Release 1.2
for y = 1 to 10
myitem3 = new qtreewidgetitem()
myitem3.settext(0,"hello"+x)
myitem2.addchild(myitem3)
next
next
setheaderlabel("Steps Tree")
}
layout1.addwidget(tree1)
setlayout(layout1)
show()
}
exec()
}
The application during the runtime
47.7 Using QComboBox Class
In this example we will learn about using the QComboBox class
47.7. Using QComboBox Class 392
Ring Documentation, Release 1.2
Load "guilib.ring"
New qApp {
win1 = new qWidget() {
setwindowtitle("Using QComboBox")
setGeometry(100,100,400,400)
New QComboBox(win1) {
setGeometry(150,100,200,30)
alist = ["one","two","three","four","five"]
for x in aList additem(x,0) next
}
show()
}
exec()
}
The application during the runtime
47.8 Creating Menubar
In this example we will learn about using the QMenuBar class
47.8. Creating Menubar 393
Ring Documentation, Release 1.2
Load "guilib.ring"
MyApp = New qApp {
win1 = new qWidget() {
setwindowtitle("Using QMenubar")
setGeometry(100,100,400,400)
menu1 = new qmenubar(win1) {
sub1 = addmenu("File")
sub2 = addmenu("Edit")
sub3 = addmenu("Help")
sub1 {
oAction = new qAction(win1) {
settext("New")
}
addaction(oAction)
oAction = new qAction(win1) {
settext("Open")
}
addaction(oAction)
oAction = new qAction(win1) {
settext("Save")
}
addaction(oAction)
oAction = new qAction(win1) {
settext("Save As")
}
addaction(oAction)
addseparator()
oAction = new qaction(win1) {
settext("Exit")
setclickevent("myapp.quit()")
}
addaction(oAction)
}
sub2 {
oAction = new qAction(win1) {
settext("Cut")
}
addaction(oAction)
oAction = new qAction(win1) {
settext("Copy")
}
addaction(oAction)
oAction = new qAction(win1) {
settext("Paste")
}
addaction(oAction)
addseparator()
oAction = new qAction(win1) {
settext("Select All")
}
addaction(oAction)
}
sub3 {
oAction = new qAction(win1) {
47.8. Creating Menubar 394
Ring Documentation, Release 1.2
settext("Reference")
}
addaction(oAction)
sub4 = addmenu("Sub Menu")
sub4 {
oAction = new qAction(win1) {
settext("Website")
}
addaction(oAction)
oAction = new qAction(win1) {
settext("Forum")
}
addaction(oAction)
oAction = new qAction(win1) {
settext("Blog")
}
addaction(oAction)
}
addseparator()
oAction = new qAction(win1) {
settext("About")
}
addaction(oAction)
}
}
show()
}
exec()
}
The application during the runtime
47.8. Creating Menubar 395
Ring Documentation, Release 1.2
47.9 Creating Toolbar
In this example we will learn about using the QToolBar class
Load "guilib.ring"
New qApp {
win1 = new qMainWindow() {
setwindowtitle("Using QToolbar")
setGeometry(100,100,600,400)
abtns = [
new qpushbutton(win1) { settext("Add") } ,
new qpushbutton(win1) { settext("Edit") } ,
new qpushbutton(win1) { settext("Find") } ,
new qpushbutton(win1) { settext("Delete") } ,
new qpushbutton(win1) { settext("Exit")
setclickevent("win1.close()") }
]
tool1 = new qtoolbar(win1) {
for x in abtns addwidget(x) addseparator() next
setmovable(true)
setGeometry(0,0,500,30)
47.9. Creating Toolbar 396
Ring Documentation, Release 1.2
setFloatable(true)
}
show()
}
exec()
}
The application during the runtime
47.10 Creating StatusBar
In this example we will learn about using the QStatusBar class
Load "guilib.ring"
New qApp {
win1 = new qMainWindow() {
setwindowtitle("Using QStatusbar")
setGeometry(100,100,400,400)
status1 = new qstatusbar(win1) {
showmessage("Ready!",0)
47.10. Creating StatusBar 397
Ring Documentation, Release 1.2
}
setstatusbar(status1)
show()
}
exec()
}
The application during the runtime
47.11 Using QDockWidget
In this example we will learn about using the QDockWidget class
Load "guilib.ring"
New qApp {
win1 = new qMainWindow() {
setwindowtitle("QDockWidget")
setGeometry(100,100,400,400)
label1 = new qlabel(win1) {
settext("Hello")
47.11. Using QDockWidget 398
Ring Documentation, Release 1.2
setGeometry(300,300,100,100)
}
label2 = new qlabel(win1) {
settext("How are you ?")
setGeometry(100,100,100,100)
}
dock1 = new qdockwidget(win1,0) {
setwidget(label1)
SetAllowedAreas(1)
}
dock2 = new qdockwidget(win1,0) {
setwidget(label2)
SetAllowedAreas(2)
}
adddockwidget(Qt_LeftDockWidgetArea,dock1,Qt_Horizontal)
adddockwidget(Qt_LeftDockWidgetArea,dock2,Qt_Vertical)
show()
}
exec()
}
The application during the runtime
47.11. Using QDockWidget 399

More Related Content

PDF
The Ring programming language version 1.5.3 book - Part 71 of 184
PDF
The Ring programming language version 1.6 book - Part 63 of 189
PDF
The Ring programming language version 1.5.2 book - Part 58 of 181
PDF
The Ring programming language version 1.2 book - Part 43 of 84
PDF
The Ring programming language version 1.5.3 book - Part 72 of 184
PDF
The Ring programming language version 1.7 book - Part 67 of 196
PDF
The Ring programming language version 1.10 book - Part 74 of 212
PDF
The Ring programming language version 1.4.1 book - Part 16 of 31
The Ring programming language version 1.5.3 book - Part 71 of 184
The Ring programming language version 1.6 book - Part 63 of 189
The Ring programming language version 1.5.2 book - Part 58 of 181
The Ring programming language version 1.2 book - Part 43 of 84
The Ring programming language version 1.5.3 book - Part 72 of 184
The Ring programming language version 1.7 book - Part 67 of 196
The Ring programming language version 1.10 book - Part 74 of 212
The Ring programming language version 1.4.1 book - Part 16 of 31

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.10 book - Part 73 of 212
PDF
The Ring programming language version 1.6 book - Part 64 of 189
PDF
The Ring programming language version 1.5.1 book - Part 58 of 180
PDF
The Ring programming language version 1.8 book - Part 69 of 202
PDF
The Ring programming language version 1.2 book - Part 44 of 84
PDF
The Ring programming language version 1.10 book - Part 75 of 212
PDF
The Ring programming language version 1.3 book - Part 45 of 88
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.4 book - Part 62 of 185
PDF
The Ring programming language version 1.9 book - Part 72 of 210
PDF
The Ring programming language version 1.4 book - Part 16 of 30
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.8 book - Part 67 of 202
PDF
The Ring programming language version 1.5.2 book - Part 64 of 181
PDF
The Ring programming language version 1.6 book - Part 70 of 189
PDF
The Ring programming language version 1.5.1 book - Part 64 of 180
PDF
The Ring programming language version 1.6 book - Part 69 of 189
The Ring programming language version 1.5.2 book - Part 59 of 181
The Ring programming language version 1.10 book - Part 73 of 212
The Ring programming language version 1.6 book - Part 64 of 189
The Ring programming language version 1.5.1 book - Part 58 of 180
The Ring programming language version 1.8 book - Part 69 of 202
The Ring programming language version 1.2 book - Part 44 of 84
The Ring programming language version 1.10 book - Part 75 of 212
The Ring programming language version 1.3 book - Part 45 of 88
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.4 book - Part 62 of 185
The Ring programming language version 1.9 book - Part 72 of 210
The Ring programming language version 1.4 book - Part 16 of 30
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.8 book - Part 67 of 202
The Ring programming language version 1.5.2 book - Part 64 of 181
The Ring programming language version 1.6 book - Part 70 of 189
The Ring programming language version 1.5.1 book - Part 64 of 180
The Ring programming language version 1.6 book - Part 69 of 189
Ad

Viewers also liked (17)

PDF
The Ring programming language version 1.2 book - Part 45 of 84
PDF
The Ring programming language version 1.2 book - Part 5 of 84
PDF
The Ring programming language version 1.2 book - Part 2 of 84
PDF
The Ring programming language version 1.2 book - Part 4 of 84
PDF
The Ring programming language version 1.2 book - Part 40 of 84
PDF
The Ring programming language version 1.2 book - Part 39 of 84
PPTX
Introducing Palm Leaf
PDF
CARPETA DE SEGUIMIENTO YO NO ABANDONO L.P. NYDIA PANIAGUA AUSTRIA
PPTX
Пошук інформації в інтернеті
PPTX
Sustainability marketing strategy 1
PPTX
Quemaduras pediátricas
PPTX
Appointment of Small Shareholders' Director
PDF
CICLO DE CHARLAS “LOS INCLASIFICABLES DEL ARTE DEL SIGLO XIX”. Jean Auguste D...
RTF
L'OEIL ET LA MAIN
PPTX
Presentación EVALUACION DEL DESEMPEÑO
PPTX
Windows 10 Technical Support
PPTX
Audience feedback For Final Production
The Ring programming language version 1.2 book - Part 45 of 84
The Ring programming language version 1.2 book - Part 5 of 84
The Ring programming language version 1.2 book - Part 2 of 84
The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 40 of 84
The Ring programming language version 1.2 book - Part 39 of 84
Introducing Palm Leaf
CARPETA DE SEGUIMIENTO YO NO ABANDONO L.P. NYDIA PANIAGUA AUSTRIA
Пошук інформації в інтернеті
Sustainability marketing strategy 1
Quemaduras pediátricas
Appointment of Small Shareholders' Director
CICLO DE CHARLAS “LOS INCLASIFICABLES DEL ARTE DEL SIGLO XIX”. Jean Auguste D...
L'OEIL ET LA MAIN
Presentación EVALUACION DEL DESEMPEÑO
Windows 10 Technical Support
Audience feedback For Final Production
Ad

Similar to The Ring programming language version 1.2 book - Part 42 of 84 (20)

PDF
The Ring programming language version 1.7 book - Part 66 of 196
PDF
The Ring programming language version 1.8 book - Part 68 of 202
PDF
The Ring programming language version 1.9 book - Part 78 of 210
PDF
The Ring programming language version 1.4.1 book - Part 17 of 31
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.7 book - Part 68 of 196
PDF
The Ring programming language version 1.2 book - Part 48 of 84
PDF
The Ring programming language version 1.8 book - Part 70 of 202
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 67 of 185
PDF
The Ring programming language version 1.9 book - Part 71 of 210
PDF
The Ring programming language version 1.5 book - Part 11 of 31
PDF
The Ring programming language version 1.4 book - Part 17 of 30
PDF
The Ring programming language version 1.10 book - Part 83 of 212
PDF
The Ring programming language version 1.7 book - Part 65 of 196
PDF
The Ring programming language version 1.2 book - Part 51 of 84
PDF
The Ring programming language version 1.9 book - Part 74 of 210
PDF
The Ring programming language version 1.5.2 book - Part 61 of 181
PDF
The Ring programming language version 1.3 book - Part 51 of 88
The Ring programming language version 1.7 book - Part 66 of 196
The Ring programming language version 1.8 book - Part 68 of 202
The Ring programming language version 1.9 book - Part 78 of 210
The Ring programming language version 1.4.1 book - Part 17 of 31
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.7 book - Part 68 of 196
The Ring programming language version 1.2 book - Part 48 of 84
The Ring programming language version 1.8 book - Part 70 of 202
The Ring programming language version 1.5.4 book - Part 64 of 185
The Ring programming language version 1.5.4 book - Part 67 of 185
The Ring programming language version 1.9 book - Part 71 of 210
The Ring programming language version 1.5 book - Part 11 of 31
The Ring programming language version 1.4 book - Part 17 of 30
The Ring programming language version 1.10 book - Part 83 of 212
The Ring programming language version 1.7 book - Part 65 of 196
The Ring programming language version 1.2 book - Part 51 of 84
The Ring programming language version 1.9 book - Part 74 of 210
The Ring programming language version 1.5.2 book - Part 61 of 181
The Ring programming language version 1.3 book - Part 51 of 88

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
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
System and Network Administration Chapter 2
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Transform Your Business with a Software ERP System
PPTX
history of c programming in notes for students .pptx
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Introduction to Artificial Intelligence
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
L1 - Introduction to python Backend.pptx
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
top salesforce developer skills in 2025.pdf
Upgrade and Innovation Strategies for SAP ERP Customers
System and Network Administration Chapter 2
Odoo Companies in India – Driving Business Transformation.pdf
Transform Your Business with a Software ERP System
history of c programming in notes for students .pptx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
Introduction to Artificial Intelligence
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
How to Migrate SBCGlobal Email to Yahoo Easily
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Wondershare Filmora 15 Crack With Activation Key [2025
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
L1 - Introduction to python Backend.pptx
Softaken Excel to vCard Converter Software.pdf
wealthsignaloriginal-com-DS-text-... (1).pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Reimagine Home Health with the Power of Agentic AI​
top salesforce developer skills in 2025.pdf

The Ring programming language version 1.2 book - Part 42 of 84

  • 1. Ring Documentation, Release 1.2 win1.setwindowtitle("After Delete - NbrOfItems: " + nbrOfItems + " CurItemNbr: " + curItemNbr +" CurValue: " + curValue ) } 47.5 Using QTreeView and QFileSystemModel In this example we will learn how to use the QTreeView widget to represent the File System Load "guilib.ring" New qApp { win1 = New qWidget() { setwindowtitle("Using QTreeView and QFileSystemModel") setGeometry(100,100,500,400) New qtreeview(win1) { setGeometry(00,00,500,400) oDir = new QDir() ofile = new QFileSystemModel() ofile.setrootpath(oDir.currentpath()) setmodel(ofile) } show() } exec() } The application during the runtime 47.5. Using QTreeView and QFileSystemModel 390
  • 2. Ring Documentation, Release 1.2 47.6 Using QTreeWidget and QTreeWidgetItem In this example we will learn about using the QTreeWidget and QTreeWidgetItem classes Load "guilib.ring" New qApp { win1 = new qWidget() { setwindowtitle("TreeWidget") setGeometry(100,100,400,400) layout1 = new qvboxlayout() tree1 = new qtreewidget(win1) { setGeometry(00,00,400,400) setcolumncount(1) myitem = new qtreewidgetitem() myitem.settext(0,"The First Step") addtoplevelitem(myitem) for x = 1 to 10 myitem2 = new qtreewidgetitem() myitem2.settext(0,"hello"+x) myitem.addchild(myitem2) 47.6. Using QTreeWidget and QTreeWidgetItem 391
  • 3. Ring Documentation, Release 1.2 for y = 1 to 10 myitem3 = new qtreewidgetitem() myitem3.settext(0,"hello"+x) myitem2.addchild(myitem3) next next setheaderlabel("Steps Tree") } layout1.addwidget(tree1) setlayout(layout1) show() } exec() } The application during the runtime 47.7 Using QComboBox Class In this example we will learn about using the QComboBox class 47.7. Using QComboBox Class 392
  • 4. Ring Documentation, Release 1.2 Load "guilib.ring" New qApp { win1 = new qWidget() { setwindowtitle("Using QComboBox") setGeometry(100,100,400,400) New QComboBox(win1) { setGeometry(150,100,200,30) alist = ["one","two","three","four","five"] for x in aList additem(x,0) next } show() } exec() } The application during the runtime 47.8 Creating Menubar In this example we will learn about using the QMenuBar class 47.8. Creating Menubar 393
  • 5. Ring Documentation, Release 1.2 Load "guilib.ring" MyApp = New qApp { win1 = new qWidget() { setwindowtitle("Using QMenubar") setGeometry(100,100,400,400) menu1 = new qmenubar(win1) { sub1 = addmenu("File") sub2 = addmenu("Edit") sub3 = addmenu("Help") sub1 { oAction = new qAction(win1) { settext("New") } addaction(oAction) oAction = new qAction(win1) { settext("Open") } addaction(oAction) oAction = new qAction(win1) { settext("Save") } addaction(oAction) oAction = new qAction(win1) { settext("Save As") } addaction(oAction) addseparator() oAction = new qaction(win1) { settext("Exit") setclickevent("myapp.quit()") } addaction(oAction) } sub2 { oAction = new qAction(win1) { settext("Cut") } addaction(oAction) oAction = new qAction(win1) { settext("Copy") } addaction(oAction) oAction = new qAction(win1) { settext("Paste") } addaction(oAction) addseparator() oAction = new qAction(win1) { settext("Select All") } addaction(oAction) } sub3 { oAction = new qAction(win1) { 47.8. Creating Menubar 394
  • 6. Ring Documentation, Release 1.2 settext("Reference") } addaction(oAction) sub4 = addmenu("Sub Menu") sub4 { oAction = new qAction(win1) { settext("Website") } addaction(oAction) oAction = new qAction(win1) { settext("Forum") } addaction(oAction) oAction = new qAction(win1) { settext("Blog") } addaction(oAction) } addseparator() oAction = new qAction(win1) { settext("About") } addaction(oAction) } } show() } exec() } The application during the runtime 47.8. Creating Menubar 395
  • 7. Ring Documentation, Release 1.2 47.9 Creating Toolbar In this example we will learn about using the QToolBar class Load "guilib.ring" New qApp { win1 = new qMainWindow() { setwindowtitle("Using QToolbar") setGeometry(100,100,600,400) abtns = [ new qpushbutton(win1) { settext("Add") } , new qpushbutton(win1) { settext("Edit") } , new qpushbutton(win1) { settext("Find") } , new qpushbutton(win1) { settext("Delete") } , new qpushbutton(win1) { settext("Exit") setclickevent("win1.close()") } ] tool1 = new qtoolbar(win1) { for x in abtns addwidget(x) addseparator() next setmovable(true) setGeometry(0,0,500,30) 47.9. Creating Toolbar 396
  • 8. Ring Documentation, Release 1.2 setFloatable(true) } show() } exec() } The application during the runtime 47.10 Creating StatusBar In this example we will learn about using the QStatusBar class Load "guilib.ring" New qApp { win1 = new qMainWindow() { setwindowtitle("Using QStatusbar") setGeometry(100,100,400,400) status1 = new qstatusbar(win1) { showmessage("Ready!",0) 47.10. Creating StatusBar 397
  • 9. Ring Documentation, Release 1.2 } setstatusbar(status1) show() } exec() } The application during the runtime 47.11 Using QDockWidget In this example we will learn about using the QDockWidget class Load "guilib.ring" New qApp { win1 = new qMainWindow() { setwindowtitle("QDockWidget") setGeometry(100,100,400,400) label1 = new qlabel(win1) { settext("Hello") 47.11. Using QDockWidget 398
  • 10. Ring Documentation, Release 1.2 setGeometry(300,300,100,100) } label2 = new qlabel(win1) { settext("How are you ?") setGeometry(100,100,100,100) } dock1 = new qdockwidget(win1,0) { setwidget(label1) SetAllowedAreas(1) } dock2 = new qdockwidget(win1,0) { setwidget(label2) SetAllowedAreas(2) } adddockwidget(Qt_LeftDockWidgetArea,dock1,Qt_Horizontal) adddockwidget(Qt_LeftDockWidgetArea,dock2,Qt_Vertical) show() } exec() } The application during the runtime 47.11. Using QDockWidget 399