2

Although it is comparatively hard to write in C++ than in Pascal I'm really attracted by multi-platform support of Qt. I can connect to an MSSQL server running on Win2003 server from Linux or I can connect to a PostGreSQL server running on Linux. That made a plus when comparing with Delphi.

I'm trying to write sample programs to get used to the Qt and C++. So far I'm comfortable with the layouts and signals-and-slots mechanism (still double clicking the buttons to write event code though :) ). I wish I was using the SQL data in my programs as easily as in Delphi.

Is there any way that I can put some connection object, a DataSource, a DBGrid and a DBNavigator on to a form and go on without writing code? (For some forms it is really a time saver, a project with 300+ forms can be made faster)

I would like to hear from people using Qt with data from SQL servers.

Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467
Celal Ergün
  • 955
  • 2
  • 14
  • 30
  • 4
    Within 12 months we should be seeing a Delphi version that can produce executables that will run on Mac and Linux. An educated guess is that this cross platform support will be built on top of Qt. – LachlanG Nov 17 '10 at 00:23

1 Answers1

2

You would have to write your own designer plugins to achieve that and make your widgets invisible, as there is no direct support for non gui components in Qt Designer.

However, writing explicit code in Qt (which is really a lot less work than in most other programming environments) helps the program to stay readable. Delphi projects with a lot of forms and components tend to become readable to the author alone, because dependencies jump across files a lot. If you store your forms in binary format, you are lost anyway, because you then cannot search your project textually to find dependencies.

Good design, which causes your code to become small and easily readable is necessary in any programming environment and makes aspects like invisible components in forms less important (though you will miss them for a while to come like I do).

So, unfortunately, you are on your own for the moment.

  • Thank you for the answer. Just today I experienced such a search problem within a project. I renamed a table on the server and had to search in DFMs. One of the lines of SQL script was cut (there are plus signs to concatenate later, the way Delphi manages DFM files) into two to make me crazy to find it. – Celal Ergün Nov 19 '10 at 20:57