Difference between revisions of "Porting to TDE"

From Trinity Desktop Project Wiki
Jump to navigation Jump to search
(→‎Software: added porting steps)
m (→‎Widget styles: moved warning box)
Line 43: Line 43:
   
 
== Widget styles ==
 
== Widget styles ==
 
{{WarningBox|text=The '''TQt API docs''' do not currently seem to reflect the API changes described here.}}
   
 
The TQt Style API has [https://mirror.git.trinitydesktop.org/gitea/TDE/tqt3/src/branch/master/changes-3.5 undergone] [https://mirror.git.trinitydesktop.org/cgit/qt3/commit/?id=0008bc5bcd95694b38b0d0322aac2ea6fdb21298 some important changes], so porting a widget style to TDE will entail a little more than just running scripts.
 
The TQt Style API has [https://mirror.git.trinitydesktop.org/gitea/TDE/tqt3/src/branch/master/changes-3.5 undergone] [https://mirror.git.trinitydesktop.org/cgit/qt3/commit/?id=0008bc5bcd95694b38b0d0322aac2ea6fdb21298 some important changes], so porting a widget style to TDE will entail a little more than just running scripts.
Line 52: Line 53:
   
 
Porting an existing style to the new API is relatively straightforward; simply update the function definitions in the existing style with the new definition prototypes and cast the passed pointer to TQWidget or TQObject where appropriate.
 
Porting an existing style to the new API is relatively straightforward; simply update the function definitions in the existing style with the new definition prototypes and cast the passed pointer to TQWidget or TQObject where appropriate.
 
{{WarningBox|text=The '''TQt API docs''' do not currently seem to reflect these changes.}}
 
   
 
== Window decorations ==
 
== Window decorations ==

Revision as of 17:18, 16 February 2022

Konqi.png
To-do
This section has not been written/completed yet. You can contribute to Trinity by writing or finalizing this section.

This page is intended to provide generic instructions for porting old KDE3 software to the Trinity libraries.

Build system

Software

Porting Qt3 and KDE3 software to Trinity has mostly been automated with scripts. Before porting your first application/style/... do obtain these scripts from TGW:

$ git clone https://mirror.git.trinitydesktop.org/gitea/TDE/scripts/

Then, to port a KDE3 application you would follow the following steps:

1. Switch into the directory containing the source code.

2. Run the Qt3→TQt conversion script.

$ scripts/conversions/qt3-tqt3/convert_existing_qt3_app_to_tqt3

3. Replace all <ntq*.h> headers with <tq*.h> ones in order to use the TQt-TDE interface (simply remove the t letter). This can be done with a small script:

#!/bin/bash
for f in $(grep -Rl "<ntq[[:alnum:]]*.h>" * --include=\*.{h,c,cpp,ui});
do
    sed -Ei 's!<n(tq[[:alnum:]]*.h)>!<\1>!g' $f
done

4. Run the KDE3→TDE conversion script.

$ scripts/conversions/kde-tde/convert_existing_kde3_app_to_tde

5. Try to build. If this fails take note of the errors and fix them.

For Qt3-only apps follow steps 1 to 3.

Widget styles

Messagebox warning.png
Warning!
The TQt API docs do not currently seem to reflect the API changes described here.

The TQt Style API has undergone some important changes, so porting a widget style to TDE will entail a little more than just running scripts.

Keep the following changes in mind:

  • Most functions' definitions have changed;
  • The usage of the widget argument is deprecated in favor of specifying widget parameters via ceData and elementFlags;
  • SH_UnderlineAccelerator has been extended with a new style hint, SH_HideUnderlineAcceleratorWhenAltUp.

Porting an existing style to the new API is relatively straightforward; simply update the function definitions in the existing style with the new definition prototypes and cast the passed pointer to TQWidget or TQObject where appropriate.

Window decorations