I'm working on a multi form Ruby-Qt program using, and I'm having a problem with controlling secondary windows from the primary one.
How can i disable the primary window when any secondary one is open, also how to take a secondary window output to use it on the primary one, and finally, sorry this is a silly one, what is the appropriate method for closing any window (like this.close in .net) ????
Ruby with Qt
qtruby
Related Question
- Ruby – How to write a switch statement in Ruby
- Ruby – How to convert a string to lower or upper case in Ruby
- Ruby – How to check if a value exists in an array in Ruby
- Ruby-on-rails – How to get the current absolute URL in Ruby on Rails
- Ruby – class << self idiom in Ruby
- Ruby – Multi-Line Comments in Ruby
- Ruby – attr_accessor in Ruby
- Ruby: How to install a specific version of a ruby gem
Best Solution
You can make a dialog modal, this disables user interaction with other windows of your application until the user closes the modal window. Use
Qt::Dialog.exec
instead ofQt::Dialog.show
to pop up the window as a modal dialog. This method returnsQt::Dialog::Accepted
orQt::Dialog::Rejected
depending on how the user closed the dialog.To use data from a dialog in the main application window, just save the data somewhere in the dialog class where the main program can access it. For example:
If you are using a dialog, you need to exit it with accept() or reject(), in most cases these are connected to the OK and Cancel button:
Other windows can be closed with the close() method.