简体   繁体   English

Delphi 2010的QT绑定

[英]QT bindings for Delphi 2010

Why isn't anyone developing QT bindings for Delphi. 为什么没有人为Delphi开发QT绑定。

In the past we had QT 2.x integrated as CLX in Delphi. 在过去,我们将QT 2.x集成为Delphi中的CLX。

I really hate the CLX wrappers since they were buggy and hard to extend. 我真的很讨厌CLX包装器,因为它们有缺陷且难以扩展。

But why isn't anyone making an API list of external DLL calls to use (the same way JCL wraps the Windows API). 但是为什么没有人使用外部DLL调用的API列表(与JCL包装Windows API的方式相同)。

Is it so hard to code such API function mapping? 编写这样的API函数映射是否如此困难? Or maybe the QT classes cannot be exposed to non-C callers? 或者也许QT类不能暴露给非C呼叫者?

Any hint in this direction is welcome. 这方面的任何暗示都是受欢迎的。

qtintf.dll似乎是你正在寻找的平面API DLL和Qt.pas相应的导入单元。

I recommend you wait for VCL+, that is the Qt binding coming with the next version of Delphi. 我建议你等待VCL +,这就是下一版Delphi的Qt绑定。

The problem is that Qt is heavily macro-based and C++ based. 问题是Qt基于宏,基于C ++。 So the Qt "flat API" is quite verbose and big. 所以Qt“flat API”非常冗长和大。 I wonder how EMB will create its own VCL+ binding, but I'll definitively wait for their implementation for using Qt on any Delphi project. 我想知道EMB将如何创建自己的VCL +绑定,但我肯定会等待他们在任何Delphi项目中使用Qt的实现。

If you can't wait, and really want cross-platform User Interface (with Mac O$ support), I recommend using http://www.twinforms.com/products/wxformsdelphi and not Qt. 如果您不能等待,并且真的想要跨平台用户界面(支持Mac O $),我建议使用http://www.twinforms.com/products/wxformsdelphi而不是Qt。 It relies on a separate DLL, but it's easier to develop, and well maintained/documented. 它依赖于一个单独的DLL,但它更容易开发,并且维护良好/记录良好。

I managed to port the qt4.pas from http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html . 我设法从http://users.telenet.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html移植qt4.pas。

It is originally written for Lazarus but I managed to port it to Delphi. 它最初是为Lazarus编写的,但我设法将它移植到Delphi。

One must do the following 必须做以下事情

  1. declare 宣布

    type PUInt = ^Integer; type PUInt = ^ Integer; PTRUINT = PUInt; PTRUINT = PUInt; PtrInt = ^Integer; PtrInt = ^整数; PPtrInt = ^PtrInt; PPtrInt = ^ PtrInt;

  2. comment out all calls with "qword" paramters since quad-words are not supported in Delphi 用“qword”参数注释掉所有调用,因为Delphi不支持四字

  3. comment out "{$mode objfpc}{$H+}" since this is Lazarus stuff 注释掉“{$ mode objfpc} {$ H +}”,因为这是Lazarus的东西
  4. replace all "cdecl; external" with "cdecl; overload; external" 用“cdecl; overload; external”替换所有“cdecl; external”

Than the demos can be compiled and run just fine with Delphi. 使用Delphi可以编译和运行演示。

从我所听到的,显然Delphi XE2的跨平台组件库(明年即将推出的版本)将基于QT,有点像CLX,它应该实际上正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM