Sign in Join
Wiki copytemporary

FPC and Qt/ru

English · Русский

Введение

Существует несколько возможностей использования Qt:

Qt3

A QtC based binding by Theo

Another QtC based binding by Andreas

Первая направлена на Linux/Unix пользователей, вторая - для Win32.

Qt/Встраивание

Qt/E binding - порт FPC для ARM процессоров, который позволяет разрабатывать графические приложения для таких устройств, как Zaurus

Qt4

Qt4 Binding - Qt4 библиотека для FPC

Пример

Данный пример разработан для использования второго пакета доступа к Qt, описанного выше.

pascal
 var
   app: QApplicationH;
   btn: QPushButtonH;
 begin
   // create static ( interfaced handled ) QApplicationH
   app := NewQApplicationH(ArgCount, ArgValues).get;
   // due to a bug in fpc 1.9.5 the WideString helper methods with default parameter are disabled
   //btn := NewQPushButtonH('Quit', nil).get;
   btn := NewQPushButtonH(qs('Quit').get, nil, nil).get;
   btn.setGeometry(100, 100, 300, 300);
   btn.show;
   // override the virtual eventFilter method of btn
   btn.OverrideHook.eventFilter := @TTest.MyEventFilter;
   // and install the btn as it's own eventFilter
   btn.installEventFilter(btn);
   // connect Qt signal to Qt slot
   QObjectH.connect(btn, SIGNAL('clicked()'), app, SLOT('quit()'));
   ...

Если вы знаете, как QT используется в C++, вы можете увидеть, что существует не так уж много различий.


From the Free Pascal wiki, page "FPC and Qt/ru", as it stood on 2020-02-16 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 3, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.