Difference between revisions of "Qt Interface/ja"

From Free Pascal wiki
Jump to navigationJump to search
m
 
(4 intermediate revisions by the same user not shown)
Line 18: Line 18:
 
=== Mac OS Xにおけるクイックスタートガイド ===
 
=== Mac OS Xにおけるクイックスタートガイド ===
  
[[Qt Interface Mac/ja|Qt Interface Mac]]をご覧下さい。
+
[[Qt Interface Mac/ja|MacにおけるQtインターフェイス]]をご覧下さい。
  
  
Line 34: Line 34:
  
 
=== バインディングのコンパイル ===
 
=== バインディングのコンパイル ===
 +
あなたがGPLでライセンスされたソフトウェアをリリースしようと考えているのなら、自分でバインディングをコンパイルする必要はありません。GPLによってライセンスされたバイナリはDen Jeanのウェブサイトで入手する事ができます。あなたがもし、GPL以外のライセンスでライセンスされたコードをリリースしようと考えているのならば、あなたは商用版のQtを使って自分でバインディングをコンパイルしなければなりません。
  
It is not necessary to compile the bindings yourself if you plan to release a GPL software. GPL Binaries are available on Den Jean website. If you want to release non-GPL code, then you must compile the bindings yourself using the Commercial Edition of Qt.
+
'''ステップ1''' - バインディングのコンパイルを始めるにあたって、必要なすべてのファイルをダウンロードします
  
'''Step 1''' - To start with download all the files needed to compile the bindings.
+
* バインディングのソースコードをダウンロードします。バインディングのオフィシャルウェブサイトに行ってください。リンクは上にあります。
  
* Download the source code of the bindings. Go to the offical website of the bindings. Link above.
+
* 必要とするプラットホーム向けのQt4.1.1のソースコードも入手します。ダウンロードページは[http://www.trolltech.com/download/opensource.html こちら]
  
* Also Download Qt 4.1.1 source code for the desired platform. This is the download page: [http://www.trolltech.com/download/opensource.html]
+
'''ステップ2''' - ダウンロードしたすべてのファイルを解凍します。Qt4.1.1ソースコードのあるディレクトリにはいって次のコマンドを入力します。
 
 
'''Step 2''' - Unpack all the files you downloaded. Enter the directory where you downloaded Qt 4.1.1 source code and use this command:
 
  
 
<pre>
 
<pre>
Line 49: Line 48:
 
</pre>
 
</pre>
  
'''Step 3''' - Go to the directory where you downloaded and extracted qt4pas sources and edit the file compile_lib.bash. Change the path for the Qt 4.1.1 source code.
+
'''ステップ3''' - ダウンロードして展開したqt4pasのソースコードがあるディレクトリにはいって、compile_lib.bashを編集します。パスをQt4.1.1のソースコードがある場所に変更してください。
  
'''Step 4''' - Run the script called compile_lib.bash. Now you should have a file called libqt4intf.so
+
'''ステップ4''' - compile_lib.bashを実行してください。それであなたはlibqt4intf.soと呼ばれるファイルを手に入れる事ができます。
  
== Road map for the Qt 4 interface ==
+
== Qt 4 interfaceのロードマップ ==
  
=== currently implemented components with their status ===
+
=== 現在実装中のコンポーネント ===
  
Moved here: [[Road_To_1.0#Widgetset_dependent_components]]
+
こちらに移動しました:[[Road_To_1.0#Widgetset_dependent_components/ja|1.0に向けて]]
  
=== components scheduled to be implemented ===
+
=== 実装する予定だったコンポーネント ===
  
 
* TPopUpMenu
 
* TPopUpMenu
Line 65: Line 64:
 
* TPixmap
 
* TPixmap
 
* TIcon
 
* TIcon
 
 
=== currently implemented Windows API functions by group and with status ===
 
=== currently implemented Windows API functions by group and with status ===
  
Line 95: Line 93:
 
:  No idea. If only I work on this, maybe 6 months. If others help, sooner.
 
:  No idea. If only I work on this, maybe 6 months. If others help, sooner.
  
== Contributing ==
+
== 寄贈 ==
  
=== How to add a new control ===
+
=== 新しいコントロールを追加する方法 ===
  
For example TButton.
+
TButtonを例にとります。
  
TButton is defined in lcl/buttons.pp. This is the platform independent part of the LCL, which is used by the normal LCL programmer.
+
TButtonはlcl/buttons.ppで定義されています。これはLCLのプラットホームから独立した部分にあり、ここから通常のLCLプログラマーは使います。
  
Its widgetset class is in lcl/widgetset/wsbuttons.pp. This is the platform independent base for all widgetsets (qt, carbon, gtk, win32, ...).
+
このウィジェットセットのクラスはlcl/widgetset/wsbuttons.ppにあります。これはプラットホームから独立していて、すべてのウィジェットセット(qt, carbon, gtk, win32,...)のためにあります。
  
Its qt interface class is in lcl/interfaces/qt/qtwsbuttons.pp:
+
qtのインターフェイスクラスはlcl/interfaces/qt/qtwsbuttons.ppにあります。
  
 
   TQtWSButton = class(TWSButton)
 
   TQtWSButton = class(TWSButton)
Line 114: Line 112:
 
   end;
 
   end;
  
Every WS class, that actually implements something must be registered. See the initialization section at the end of the qtwsXXX.pp unit:
+
WSクラスは、かならず登録(register)してやらなければなりません。qrwsXXX.ppというの名前のユニットの最後の方にあるinitializationセクションをご覧下さい。
 +
 
 
   RegisterWSComponent(TQtButton, TQtWSButton);
 
   RegisterWSComponent(TQtButton, TQtWSButton);
  
TQtWSButton overrides CreateHandle to create a qt QPushButton.
+
TQtWSButtonはQtのQPushButtonを作成するためにCreateHandleをオーバーライドします。
The code is short and should be easily adaptable for other controls like TCheckBox.
+
コードは短くてTCheckBoxのように融通が利かなければなりません。
Remember that all controls on the Qt widgetset have a helper class on qtprivate.pp, and it is also necessary to add a class for the new control. This isn´t difficult.
+
また、すべてのコントロールはqtprivate.ppにあるQtウィジェットセットのヘルパークラスによって成り立っているということを忘れないでください。また、このクラスを新しいコントロールに追加してください。それは難しい事ではありません。
  
Also notice that DestroyHandle should be implemented to clean up memory utilized by the control.
+
またDestroyHandleをコントロールによって使用されたメモリをクリーンアップするために実行する必要があるという事も覚えておいてください。

Latest revision as of 14:48, 6 August 2006

English (en) español (es) 日本語 (ja)

日本語版メニュー
メインページ - Lazarus Documentation日本語版 - 翻訳ノート - 日本語障害情報

概要

Qt4ウィジェットセットは現在開発段階です。このインターフェイスはQt4.1.1をベースに開発されています。関連するドキュメントはこちら

Linuxにおけるクイックスタートガイド

まず始めにオフィシャルサイトのbindingsを訪れ、バイナリ版のQt bindingsをダウンロードしてください。そしてlibqt4intf.soを/usr/lib/にコピーしてください。

QtでLCLをコンパイルします。最初にノーマルなgtkによってコンパイルされたLazarusを起動して、メニューから"ツール"→"Lazarusのビルドの設定"を選びます。そしてLCLを"clean+build"に、他のものを"none"に設定します。続いて"Qt"を選択し"Ok"ボタンをクリックします。今度は"ツール"→"Lazarusのビルド"を選択します。すると、QtでLCLをコンパイルできます。

プロジェクトをQtでコンパイルするにはターゲットウィジェットセットをコンパイラオプションダイアログで選択してください。

At this moment the Lazarus IDE cannot be compiled for Qt because it uses features missing on this widgetset.

Mac OS Xにおけるクイックスタートガイド

MacにおけるQtインターフェイスをご覧下さい。


PDAやスマートフォンにおけるクイックスタートガイド

誰か書いてください。

Qt 4 バインディング

このインターフェイスはDen Jeanによって作られたQt4バインディングを使用します。このバインディングはQtオブジェクトと手続きのメソッドを出力するC++ライブラリです。このライブラリはLinux上で800kbの大きさがあり、あなたのLCLプログラムが必要とするただ一つの.soファイルで構成されます。

あなたはより詳しい情報をこのバインディングのオフィシャルサイトfpc:Qt4 bindingで探す事ができます。

Is is being reported that it may be possible to link to Qt 4 directly, using some tricks. Many think it is not. This is yet to be tested. It is expected that any such binding will be compatible with the currently utilized one, so the interface code won´t have to be changed.

バインディングのコンパイル

あなたがGPLでライセンスされたソフトウェアをリリースしようと考えているのなら、自分でバインディングをコンパイルする必要はありません。GPLによってライセンスされたバイナリはDen Jeanのウェブサイトで入手する事ができます。あなたがもし、GPL以外のライセンスでライセンスされたコードをリリースしようと考えているのならば、あなたは商用版のQtを使って自分でバインディングをコンパイルしなければなりません。

ステップ1 - バインディングのコンパイルを始めるにあたって、必要なすべてのファイルをダウンロードします

  • バインディングのソースコードをダウンロードします。バインディングのオフィシャルウェブサイトに行ってください。リンクは上にあります。
  • 必要とするプラットホーム向けのQt4.1.1のソースコードも入手します。ダウンロードページはこちら

ステップ2 - ダウンロードしたすべてのファイルを解凍します。Qt4.1.1ソースコードのあるディレクトリにはいって次のコマンドを入力します。

./configure

ステップ3 - ダウンロードして展開したqt4pasのソースコードがあるディレクトリにはいって、compile_lib.bashを編集します。パスをQt4.1.1のソースコードがある場所に変更してください。

ステップ4 - compile_lib.bashを実行してください。それであなたはlibqt4intf.soと呼ばれるファイルを手に入れる事ができます。

Qt 4 interfaceのロードマップ

現在実装中のコンポーネント

こちらに移動しました:1.0に向けて

実装する予定だったコンポーネント

  • TPopUpMenu
  • TBitmap - Needs a description of the internal format used by Qt
  • TPixmap
  • TIcon

currently implemented Windows API functions by group and with status

Mouse functions

SetCursorPos, GetCursorPos for TMouse - Fully working

GDI functions

BeginPaint, GetDC, EndPaint, ReleaseDC, Rectangle, MoveToEx, LineTo, Ellipse for TCanvas and OnPaint event- Fully working

Screen functions

GetSystemMetrics for Screen.Width and Screen.Height - Fully working

Coments

It's really interesting.

Buy if will works also on Win32 OS?

It will work for win32. It's just a question of recompiling the bindings. The code on the widgetset is completely platform independent, so the limiting factors are the bindings and Qt. However, there is little use for this on win32. There already exists a win32 native widgetset, you should use that one on Windows. The same code can be recompiled with any of the existing widgetsets on Lazarus. A more interresting place where this will work is: Linux powered PDAs.

When do you think to can see the Lazarus IDE run full on QT4 Lib?

No idea. If only I work on this, maybe 6 months. If others help, sooner.

When do you think will be possible create full GUI applications using QT4?

No idea. If only I work on this, maybe 6 months. If others help, sooner.

寄贈

新しいコントロールを追加する方法

TButtonを例にとります。

TButtonはlcl/buttons.ppで定義されています。これはLCLのプラットホームから独立した部分にあり、ここから通常のLCLプログラマーは使います。

このウィジェットセットのクラスはlcl/widgetset/wsbuttons.ppにあります。これはプラットホームから独立していて、すべてのウィジェットセット(qt, carbon, gtk, win32,...)のためにあります。

qtのインターフェイスクラスはlcl/interfaces/qt/qtwsbuttons.ppにあります。

 TQtWSButton = class(TWSButton)
 private
 protected
 public
   class function  CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
 end;

WSクラスは、かならず登録(register)してやらなければなりません。qrwsXXX.ppというの名前のユニットの最後の方にあるinitializationセクションをご覧下さい。

 RegisterWSComponent(TQtButton, TQtWSButton);

TQtWSButtonはQtのQPushButtonを作成するためにCreateHandleをオーバーライドします。 コードは短くてTCheckBoxのように融通が利かなければなりません。 また、すべてのコントロールはqtprivate.ppにあるQtウィジェットセットのヘルパークラスによって成り立っているということを忘れないでください。また、このクラスを新しいコントロールに追加してください。それは難しい事ではありません。

またDestroyHandleをコントロールによって使用されたメモリをクリーンアップするために実行する必要があるという事も覚えておいてください。