qtruby

Ruby: creating a simple application in Qt

一笑奈何 提交于 2020-01-04 03:51:21
问题 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:02 2009 ** by: Qt User Interface Compiler version 4.3.1 ** ** WARNING! All changes made in this file will be lost when recompiling ui file! =end class Ui

How to access Postgresql using Qt in Windows

徘徊边缘 提交于 2019-12-10 11:57:30
问题 I am developing an application using QtRuby and PostgreSQL. I successfully developed and running successfully 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 drivers: QSQLITE QODBC3 QODBC 回答1: As the error message says, the QPSQL driver is not available for Qt to talk to Postgres with. Probably the plugin has not been compiled yet.

Display an icon before text in a QTreeView

▼魔方 西西 提交于 2019-12-10 09:42:49
问题 I'm using QtRuby with Qt 4.8.6 and trying to create a tree view where each item has a custom icon between the tree controls and the name. The end result should be like this: I am getting space allocated for where the icon should go, but I'm not seeing any icons. What do I have to do to get them to show up? Here's my code (simplified slightly to remove the no-data edge cases): class MyModel < Qt::AbstractItemModel # ... def data(index, role) case role when Qt::DisplayRole case index.column

Does QtRuby work with Qt 5?

点点圈 提交于 2019-12-08 15:48:05
问题 Everything I can find online about QtRuby uses Qt 4, but the current version of Qt is 5. Is this simply a matter of documentation not catching up with reality, where Qt 5 would work just fine with QtRuby? If you assert that this is the case (that Qt5 is unsupported) then please backup your assertion with evidence. 回答1: QtRuby Qtruby and korundum are not maintained for years now. To get a maintained version of qtruby, install qtbindings as ruby gem. Qtbindings home page: https://github.com

How to paginate a QPlainTextEdit?

此生再无相见时 提交于 2019-12-01 13:16:58
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 does. It sounds like internally we want to be doing the pagination, but what I can't figure out is how to modify QPlainTextEdit to show the text in pages instead of a gigantic field. Side note: I know it doesn't matter but I am using qtruby, not plain Qt. Have a

How to paginate a QPlainTextEdit?

南楼画角 提交于 2019-12-01 12:32:44
问题 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 does. It sounds like internally we want to be doing the pagination, but what I can't figure out is how to modify QPlainTextEdit to show the text in pages instead