how to disable Maximize button

86 views
Skip to first unread message

Magdy Ragab

unread,
Mar 13, 2016, 7:13:13 AM3/13/16
to The Ring Programming Language

Hi Mahmoud

How can I disable maximize button and resize window

I've tried googleing about qt disabling them but I'm failed


By the way I've started to create my first app, witch is as simple calculator  


Mahmoud Fayed

unread,
Mar 13, 2016, 12:11:20 PM3/13/16
to The Ring Programming Language
Hello Magdy

Nice start :D and very good question :D

Use the method setWindowFlags

Example
Load "guilib.ring"
app1
= new qapp {
        win1
= new qwidget() {
                setwindowtitle
("First")
                setgeometry
(100,100,500,500)

               
new qpushbutton(win1) {
                        setgeometry
(100,100,100,30)
                        settext
("close")
                        setclickevent
("app1.quit()")
               
}

               
new qpushbutton(win1) {
                        setgeometry
(250,100,100,30)
                        settext
("Second")
                        setclickevent
("second()")
               
}

                showmaximized
()
       
}
       
exec()
}

func second
        win2
= new qwidget() {
                setwindowtitle
("Second")
                setgeometry
(100,100,500,500)
                setwindowflags
(Qt_dialog)
                show
()
       
}

Greetings,
Mahmoud

Magdy Ragab

unread,
Mar 13, 2016, 12:52:52 PM3/13/16
to The Ring Programming Language
Thank you :)

Mahmoud Fayed

unread,
Mar 14, 2016, 12:17:36 PM3/14/16
to The Ring Programming Language
You are welcome :D

Greetings,
Mahmoud
Reply all
Reply to author
Forward
0 new messages