qtruby

Ruby's subclassing and Qt's signals/slots don't work together as expected

When trying to work with Qt's signal/slot mechanisms over more than one level of inheritance, I ran into a problem: When my class does not directly inherit from QObject, signals and slots don't seem to work any more. The output of the following program illustrates the case: require 'Qt' class A < Qt::Object signals 'mySignal()' sl...

Worker threads in Ruby

Hi, I am writing a simple memory game using ruby + qt (trying to get away from c++ for while...) In order to allow a X second timeout to view two open pieces, I need either timers or do the work in a background thread. What is the simplest way of implementing this without reinventing the wheel? Ruby threads? Qt threads? Qt timers? ...

QTextEditor returns quotes as question marks in QT Ruby

When I copy and paste from a Word document into a QT TextEditor, It seems to look fine. But when I try to access the text using toPlainText or toHTML, it returns the text with all of the quotes (double and single) as question marks. Is there a way around this? I am using the qt4-qtruby bindings. ...

How to access Postgresql using QT in Windows

Hi to all, I am developing an application using QtRuby and postgresql. I sucessfully developed and running sucessfully in Linux. Now i want to run the same application in windows. But i am failing to connect to database(Postgresql). I am getting the following errors: QSqlDatabase: QPSQL driver not loaded QSqlDatabase: available driv...

Ruby Qt documentation

Where can I find the documentation for ruby qt? (ex. rdoc) ...

Ruby: creating a simple application in Qt

I'm trying to create a simple application, written in Ruby via Qt. I designed a form (MainForm) in a Qt Designer and translated it via rbuic4 to the Ruby code representation. The pure untouched result has four methods, and looks like this: =begin ** Form generated from reading ui file 'stackover.ui' ** ** Created: Р’С‚ 24. РЅРѕСЏ 21:15:...

is it good programming practice to put code statements in braces?

I have never seen this being done anywhere in all the source code i've read in my life. If it is considered bad programming practice, there has to be a reason for it which i fail to understand. Also, I think it sometimes improves readability rather than worsening it. Here are a few places i've done it in my ruby code. @pushButton.conne...

RubyQt Crashing on QTableWidget

I'm getting some weirdness with QtRuby when using a TableWidget. The table widget loads, but when you click on the elements in the row, the app segfaults and crashes. require 'Qt4' class SimpleModel < Qt::AbstractTableModel def rowCount(parent) return 1 end def columnCount(parent) return 1 end ...

How to paginate a QPlainTextEdit?

I've been using QPlainTextEdit for editing text in our application. Recently it was decided that we need to display the text in a paginated format instead of a consistent block of text. After lots of research, I've come to the realization that while QPlainTextEdit does not have any knowledge of pages or pagination, QPlainTextDocument doe...

updating a QGraphicsTextItem on text change

I’ve been working with QGraphicsTextItems. I currently have the laid out in a scene, each depicting a physical page of text. Right now I’m overriding the keyReleaseEvent function to redistribute the text typed across all of the pages. The problem with this is that when I set the text with setPlainText, the cursor moves back to the beginn...

Packaging and distributing a QtRuby app as a gem? Or how?

I have finished developing a GUI desktop Ruby application that uses Qt through the qtbindings gem, and I need to release it with a few requirements: The user doesn't have to build or compile anything, especially Qt libraries, installing Ruby and Rubygems is OK, but not more It must run on Mac and Windows, Linux too preferably I've tr...

Ruby, Qt and third party widgets

I'm learning Ruby and, for this, I'm writing an application in it. My background is in C++/Qt. So I've started writing a Ruby/Qt app. But there's a few previously written widgets (C++) I would like to use, besides qwt. Is this possible? If it is, how should I do it? PS: It seems QtRuby from Korundum bindings do includes Qwt bindings. ...