summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/include/tqtglobaldefines.h~
blob: 04b86e3a5108b0439cc9540eaa55cb2ead28387a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
#ifndef TQTGLOBALDEFINES_H
#define TQTGLOBALDEFINES_H

#include "tqtglobalsettings.h"

// #ifdef USE_QT4
// #define QT3_SUPPORT
// #endif
//
#ifdef USE_QT4

#include <Qt/qglobal.h>
#include <Qt/qnamespace.h>
#include <Qt/qobjectdefs.h>

#ifdef QT_NO_TRANSLATION
#define TQT_NO_TRANSLATION
#endif // QT_NO_TRANSLATION

#ifdef QT_THREAD_SUPPORT
#define TQT_THREAD_SUPPORT
#endif // QT_THREAD_SUPPORT

// #define tqqt_cast qobject_cast

// Mark certain Qt3 static variables squarely OFF LIMITS
#define qt_x_time	"Usage of the qt_x_time static variable is strongly deprecated in TQt, and is unavailable in TQt for Qt4.  Use GET_QT_X_TIME/SET_QT_X_TIME instead"
#define qt_x_user_time	"Usage of the qt_x_time static variable is strongly deprecated in TQt, and is unavailable in TQt for Qt4.  Use GET_QT_X_USER_TIME/SET_QT_X_USER_TIME instead"

// #define TQT_TQOBJECT(x) (static_cast<TQObject*>(static_cast<TQT_BASE_OBJECT_NAME*>(x)))
#define TQT_TQOBJECT(x) (convertFromTQT_BASE_OBJECT_NAMEPointer(x))
#define TQT_TQWIDGET(x) TQWidget::tqt_ensure_valid_widget_painting(static_cast<TQWidget*>(static_cast<QWidget*>(static_cast<TQT_BASE_OBJECT_NAME*>(x))))
#define TQT_TQSIZEPOLICY(x) (static_cast<TQSizePolicy*>(static_cast<QSizePolicy*>(x)))
#define TQT_TQLAYOUT(x) (static_cast<TQLayout*>(static_cast<QLayout*>(x)))
#define TQT_TQGRIDLAYOUT(x) (static_cast<TQGridLayout*>(static_cast<QGridLayout*>(x)))
#define TQT_TQPAINTER(x) (static_cast<TQPainter*>(static_cast<QPainter*>(x)))
#define TQT_TQPAINTDEVICE(x) (static_cast<TQPaintDevice*>(static_cast<QPaintDevice*>(x)))
#define TQT_TQLAYOUTITEM(x) (static_cast<TQLayoutItem*>(static_cast<QLayoutItem*>(x)))
#define TQT_TQIODEVICE(x) (static_cast<TQIODevice*>(static_cast<QIODevice*>(x)))
#define TQT_TQCOLOR(x) (static_cast<TQColor*>(static_cast<QColor*>(x)))
#define TQT_TQCHAR(x) TQChar(x)
#define TQT_TQSTRING(x) TQString(x)
#define TQT_TQPOINT(x) (static_cast<TQPoint*>(static_cast<QPoint*>(x)))
#define TQT_TQBUFFER(x) (static_cast<TQBuffer*>(static_cast<QBuffer*>(x)))
#define TQT_TQWMATRIX(x) (static_cast<TQWMatrix*>(static_cast<QMatrix*>(x)))
#define TQT_TQFILE(x) (static_cast<TQFile*>(static_cast<QFile*>(x)))
#define TQT_TQBYTEARRAY(x) (static_cast<TQByteArray*>(static_cast<QByteArray*>(x)))
#define TQT_TQMIMESOURCE(x) (static_cast<TQMimeSource*>(static_cast<QMimeSource*>(x)))
#define TQT_TQWEXTRA(x) (static_cast<TQWExtra*>(static_cast<QWExtra*>(x)))
#define TQT_TQPIXMAP(x) (static_cast<TQPixmap*>(static_cast<QPixmap*>(x)))
#define TQT_TQCLIPBOARD(x) (static_cast<TQClipboard*>(static_cast<QClipboard*>(x)))
#define TQT_TQPRINTER(x) (static_cast<TQPrinter*>(static_cast<QPrinter*>(x)))
#define TQT_TQVARIANT(x) (static_cast<TQVariant*>(static_cast<QVariant*>(x)))
#define TQT_TQMETAOBJECT(x) (static_cast<TQMetaObject*>(static_cast<QMetaObject*>(x)))
#define TQT_TQSTYLEOPTION(x) (static_cast<TQStyleOption*>(static_cast<TQStyleOption*>(x)))
#define TQT_TQEVENT(x) (static_cast<TQEvent*>(static_cast<QEvent*>(x)))
#define TQT_TQKEYEVENT(x) (static_cast<TQKeyEvent*>(static_cast<QKeyEvent*>(static_cast<QEvent*>(x))))
#define TQT_TQSHOWEVENT(x) (static_cast<TQShowEvent*>(static_cast<QShowEvent*>(static_cast<QEvent*>(x))))
#define TQT_TQMOUSEEVENT(x) (static_cast<TQMouseEvent*>(static_cast<QMouseEvent*>(static_cast<QEvent*>(x))))
#define TQT_TQWHEELEVENT(x) (static_cast<TQWheelEvent*>(static_cast<QWheelEvent*>(static_cast<QEvent*>(x))))
#define TQT_TQFOCUSEVENT(x) (static_cast<TQFocusEvent*>(static_cast<QFocusEvent*>(static_cast<QEvent*>(x))))
#define TQT_TQPAINTEVENT(x) (static_cast<TQPaintEvent*>(static_cast<QPaintEvent*>(static_cast<QEvent*>(x))))
#define TQT_TQCHILDEVENT(x) (static_cast<TQChildEvent*>(static_cast<QChildEvent*>(static_cast<QEvent*>(x))))
#define TQT_TQCLOSEEVENT(x) (static_cast<TQCloseEvent*>(static_cast<QCloseEvent*>(static_cast<QEvent*>(x))))
#define TQT_TQTIMEREVENT(x) (static_cast<TQTimerEvent*>(static_cast<QTimerEvent*>(static_cast<QEvent*>(x))))
#define TQT_TQRESIZEEVENT(x) (static_cast<TQResizeEvent*>(static_cast<QResizeEvent*>(static_cast<QEvent*>(x))))
#define TQT_TQCONTEXTMENUEVENT(x) (static_cast<TQContextMenuEvent*>(static_cast<QContextMenuEvent*>(static_cast<QEvent*>(x))))

#define TQT_TQOBJECT_OBJECT(x) (convertFromTQT_BASE_OBJECT_NAME(x))
#define TQT_TQSIZEPOLICY_OBJECT(x) (convertFromQSizePolicy(x))
#define TQT_TQLAYOUT_OBJECT(x) (convertFromQLayout(x))
#define TQT_TQCOLOR_OBJECT(x) (convertFromQColor(x))
#define TQT_TQSTRING_OBJECT(x) (convertFromQString(x))
#define TQT_TQSTRLIST_OBJECT(x) (convertFromQStrList(x))
#define TQT_TQSTRINGLIST_OBJECT(x) (TQStringList::convertFromQStringList(x))
#define TQT_TQWMATRIX_OBJECT(x) (convertFromQMatrix(x))
#define TQT_TQRECT_OBJECT(x) TQRect(x)
#define TQT_TQBYTEARRAY_OBJECT(x) (convertFromQByteArray(x))
#define TQT_TQPIXMAP_OBJECT(x) (convertFromQPixmap(x))
#define TQT_TQTIME_OBJECT(x) (TQTime::convertFromQTime(x))
#define TQT_TQDATE_OBJECT(x) (TQDate::convertFromQDate(x))
#define TQT_TQDATETIME_OBJECT(x) (TQDateTime::convertFromQDateTime(x))
#define TQT_TQBRUSH_OBJECT(x) (convertFromQBrush(x))
#define TQT_TQPALETTE_OBJECT(x) (convertFromQPalette(x))
#define TQT_TQPOINT_OBJECT(x) (convertFromQPoint(x))
#define TQT_TQREGION_OBJECT(x) (convertFromQRegion(x))
#define TQT_TQIMAGE_OBJECT(x) (convertFromQImage(x))
#define TQT_TQPAINTDEVICE_OBJECT(x) (convertFromQPaintDevice(x))
#define TQT_TQVARIANT_OBJECT(x) (convertFromQVariant(x))
#define TQT_TQIODEVICE_OBJECT(x) (convertFromQIODevice(x))
#define TQT_TQSESSIONMANAGER_OBJECT(x) (convertFromQSessionManager(x))
#define TQT_TQSTYLEOPTION_OBJECT(x) (TQStyleOption(x))

// #define TQT_TQOBJECT_CONST(x) (static_cast<const TQObject*>(static_cast<const TQT_BASE_OBJECT_NAME*>(x)))
#define TQT_TQOBJECT_CONST(x) (convertFromTQT_BASE_OBJECT_NAMEPointerConst(x))
#define TQT_TQWIDGET_CONST(x) (static_cast<const TQWidget*>(static_cast<const QWidget*>(static_cast<const TQT_BASE_OBJECT_NAME*>(x))))
#define TQT_TQMIMESOURCE_CONST(x) (static_cast<const TQMimeSource*>(static_cast<const QMimeSource*>(x)))
#define TQT_TQPOINT_CONST(x) (static_cast<const TQPoint*>(static_cast<const QPoint*>(x)))
#define TQT_TQBRUSH_CONST(x) (static_cast<const TQBrush*>(static_cast<const QBrush*>(x)))
#define TQT_TQPIXMAP_CONST(x) (static_cast<const TQPixmap*>(static_cast<const QPixmap*>(x)))
#define TQT_TQPAINTDEVICE_CONST(x) (static_cast<const TQPaintDevice*>(static_cast<const QPaintDevice*>(x)))
#define TQT_TQCOLOR_CONST(x) (static_cast<const TQColor*>(static_cast<const QColor*>(x)))
#define TQT_TQPRINTER_CONST(x) (static_cast<const TQPrinter*>(static_cast<const QPrinter*>(x)))
#define TQT_TQIODEVICE_CONST(x) (static_cast<const TQIODevice*>(static_cast<const QIODevice*>(x)))
#define TQT_TQVARIANT_CONST(x) (static_cast<const TQVariant*>(static_cast<const QVariant*>(x)))
#define TQT_TQMETAOBJECT_CONST(x) (static_cast<const TQMetaObject*>(static_cast<const QMetaObject*>(x)))
#define TQT_TQSTYLEOPTION_CONST(x) (static_cast<const TQStyleOption*>(static_cast<const TQStyleOption*>(x)))

#define TQPOINT_OBJECT_NAME_STRING		"TQPoint"
#define TQBYTEARRAY_OBJECT_NAME_STRING		"TQByteArray"
#define TQPIXMAP_OBJECT_NAME_STRING		"TQPixmap"
#define TQSTRING_OBJECT_NAME_STRING		"TQString"
#define TQSTRINGLIST_OBJECT_NAME_STRING		"TQStringList"
#define TQLAYOUT_OBJECT_NAME_STRING		"TQLayout"
#define TQBOXLAYOUT_OBJECT_NAME_STRING		"TQBoxLayout"
#define TQHBOXLAYOUT_OBJECT_NAME_STRING		"TQHBoxLayout"
#define TQVBOXLAYOUT_OBJECT_NAME_STRING		"TQVBoxLayout"
#define TQGRIDLAYOUT_OBJECT_NAME_STRING		"TQGridLayout"
#define TQHBOX_OBJECT_NAME_STRING		"TQHBox"
#define TQVBOX_OBJECT_NAME_STRING		"TQVBox"
#define TQGRID_OBJECT_NAME_STRING		"TQGrid"
#define TQTABWIDGET_OBJECT_NAME_STRING		"TQTabWidget"
#define TQCHECKBOX_OBJECT_NAME_STRING		"TQCheckBox"
#define TQLINEEDIT_OBJECT_NAME_STRING		"TQLineEdit"
#define TQTEXTEDIT_OBJECT_NAME_STRING		"TQTextEdit"
#define TQOBJECT_OBJECT_NAME_STRING		"TQObject"
#define TQWIDGET_OBJECT_NAME_STRING		"TQWidget"
#define TQGLWIDGET_OBJECT_NAME_STRING		"TQGLWidget"
#define TQLABEL_OBJECT_NAME_STRING		"TQLabel"
#define TQTIMER_OBJECT_NAME_STRING		"TQTimer"
#define TQFRAME_OBJECT_NAME_STRING		"TQFrame"
#define TQACCEL_OBJECT_NAME_STRING		"TQAccel"
#define TQDIALOG_OBJECT_NAME_STRING		"TQDialog"
#define TQDIAL_OBJECT_NAME_STRING		"TQDial"
#define TQACTION_OBJECT_NAME_STRING		"TQAction"
#define TQACTIONGROUP_OBJECT_NAME_STRING	"TQActionGroup"
#define TQLCDNUMBER_OBJECT_NAME_STRING		"TQLCDNumber"
#define TQPROGRESSBAR_OBJECT_NAME_STRING	"TQProgressBar"
#define TQTABDIALOG_OBJECT_NAME_STRING		"TQTabDialog"
#define TQTABWIDGET_OBJECT_NAME_STRING		"TQTabWidget"
#define TQDOCKWINDOW_OBJECT_NAME_STRING		"TQDockWindow"
#define TQGROUPBOX_OBJECT_NAME_STRING		"TQGroupBox"
#define TQCOMBOBOX_OBJECT_NAME_STRING		"TQComboBox"
#define TQSPINBOX_OBJECT_NAME_STRING		"TQSpinBox"
#define TQSPINWIDGET_OBJECT_NAME_STRING		"TQSpinWidget"
#define TQLISTBOX_OBJECT_NAME_STRING		"TQListBox"
#define TQTOOLBOX_OBJECT_NAME_STRING		"TQToolBox"
#define TQTOOLBOXBUTTON_OBJECT_NAME_STRING	"TQToolBoxButton"
#define TQVGROUPBOX_OBJECT_NAME_STRING		"TQVGroupBox"
#define TQSPLITTER_OBJECT_NAME_STRING		"TQSplitter"
#define TQSPLITTERHANDLE_OBJECT_NAME_STRING	"TQSplitterHandle"
#define TQBUTTON_OBJECT_NAME_STRING		"TQButton"
#define TQGRIDVIEW_OBJECT_NAME_STRING		"TQGridView"
#define TQSLIDER_OBJECT_NAME_STRING		"TQSlider"
#define TQPUSHBUTTON_OBJECT_NAME_STRING		"TQPushButton"
#define TQTOOLBUTTON_OBJECT_NAME_STRING		"TQToolButton"
#define TQRADIOBUTTON_OBJECT_NAME_STRING	"TQRadioButton"
#define TQPOPUPMENU_OBJECT_NAME_STRING		"TQPopupMenu"
#define TQTOOLBAR_OBJECT_NAME_STRING		"TQToolBar"
#define TQMENUBAR_OBJECT_NAME_STRING		"TQMenuBar"
#define TQTABBAR_OBJECT_NAME_STRING		"TQTabBar"
#define TQLISTVIEW_OBJECT_NAME_STRING		"TQListView"
#define TQSCROLLBAR_OBJECT_NAME_STRING		"TQScrollBar"
#define TQSCROLLVIEW_OBJECT_NAME_STRING		"TQScrollView"
#define TQRANGECONTROL_OBJECT_NAME_STRING	"TQRangeControl"
#define TQCANVASITEM_OBJECT_NAME_STRING		"TQCanvasItem"
#define TQICONVIEW_OBJECT_NAME_STRING		"TQIconView"
#define TQMULTILINEEDIT_OBJECT_NAME_STRING	"TQMultiLineEdit"
#define TQINTVALIDATOR_OBJECT_NAME_STRING	"TQIntValidator"
#define TQDATEEDIT_OBJECT_NAME_STRING		"TQDateEdit"
#define TQTIMEEDIT_OBJECT_NAME_STRING		"TQTimeEdit"
#define TQDATETIMEEDIT_OBJECT_NAME_STRING	"TQDateTimeEdit"
#define TQHEADER_OBJECT_NAME_STRING		"TQHeader"
#define TQSIZEGRIP_OBJECT_NAME_STRING		"TQSizeGrip"
#define TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING	"TQDockWindowHandle"
#define TQHIDEDOCK_OBJECT_NAME_STRING		"TQHideDock"
#define TQTABLE_OBJECT_NAME_STRING		"TQTable"
#define TQWIZARD_OBJECT_NAME_STRING		"TQWizard"
#define TQDATATABLE_OBJECT_NAME_STRING		"TQDataTable"
#define TQDATABROWSER_OBJECT_NAME_STRING	"TQDataBrowser"
#define TQDATAVIEW_OBJECT_NAME_STRING		"TQDataView"
#define TQMAINWINDOW_OBJECT_NAME_STRING		"TQMainWindow"
#define TQWIDGETSTACK_OBJECT_NAME_STRING	"TQWidgetStack"
#define TQBUTTONGROUP_OBJECT_NAME_STRING	"TQButtonGroup"
#define TQTEXTVIEW_OBJECT_NAME_STRING		"TQTextView"
#define TQTEXTBROWSER_OBJECT_NAME_STRING	"TQTextBrowser"
#define TQLAYOUTWIDGET_OBJECT_NAME_STRING	"TQLayoutWidget"

#define TQMOTIFPLUSSTYLE_OBJECT_NAME_STRING	"TQMotifPlusStyle"

// #define tqarrowCursor		Qt::ArrowCursor
// #define tqupArrowCursor		Qt::UpArrowCursor
// #define tqcrossCursor		Qt::CrossCursor
// #define tqwaitCursor		Qt::WaitCursor
// #define tqibeamCursor		Qt::IBeamCursor
// #define sizeVerCursor		Qt::SizeVerCursor
// #define sizeHorCursor		Qt::SizeHorCursor
// #define sizeBDiagCursor	Qt::SizeBDiagCursor
// #define sizeFDiagCursor	Qt::SizeFDiagCursor
// #define sizeAllCursor		Qt::SizeAllCursor
// #define tqblankCursor		Qt::BlankCursor
// #define tqsplitVCursor		Qt::SplitVCursor
// #define tqsplitHCursor		Qt::SplitHCursor
// #define tqpointingHandCursor	Qt::PointingHandCursor
// #define tqforbiddenCursor	Qt::ForbiddenCursor
// #define tqwhatsThisCursor	Qt::WhatsThisCursor
// #define tqbusyCursor		Qt::BusyCursor

#define tqarrowCursor		TQt::arrowCursor
#define tqupArrowCursor		TQt::upArrowCursor
#define tqcrossCursor		TQt::crossCursor
#define tqwaitCursor		TQt::waitCursor
#define tqibeamCursor		TQt::ibeamCursor
#define sizeVerCursor		TQt::sizeVerCursor
#define sizeHorCursor		TQt::sizeHorCursor
#define sizeBDiagCursor	TQt::sizeBDiagCursor
#define sizeFDiagCursor	TQt::sizeFDiagCursor
#define sizeAllCursor		TQt::sizeAllCursor
#define tqblankCursor		TQt::blankCursor
#define tqsplitVCursor		TQt::splitVCursor
#define tqsplitHCursor		TQt::splitHCursor
#define tqpointingHandCursor	TQt::pointingHandCursor
#define tqforbiddenCursor	TQt::forbiddenCursor
#define tqwhatsThisCursor	TQt::whatsThisCursor
#define tqbusyCursor		TQt::busyCursor

#define tqreadBlock		readData
#define tqwriteBlock		writeData
#define TQT_TQIO_LONG		qint64
#define TQT_TQIO_ULONG		qint64
#define TQ_WFlags		WFlags

#define SET_QT_X_TIME(x)	QX11Info::setAppTime(x)
#define GET_QT_X_TIME(x)	QX11Info::appTime()
#define SET_QT_X_USER_TIME(x)	QX11Info::setAppUserTime(x)
#define GET_QT_X_USER_TIME(x)	QX11Info::appUserTime()

// // [FIXME]
// // This should try a dynamic cast first before resorting to conversion (which entails a create/copy/delete operation)
// // Also, is simply overwriting the origin pointer enough to make this work in all cases???
// template <class T, class U>
// U* tqt_convert_object(T* orig)
// {
//     T* orig_ptr = orig;
//     U* temp = new U();
//     *temp = *orig;
//     orig_ptr = temp;
//     delete orig;
//     return temp;
// }
// 
// #define TQT_TQPIXMAP(x) (tqt_convert_object<QPixmap, TQPixmap>(x))
// #define TQT_TQPIXMAP_CONST(x) (tqt_convert_object<const QPixmap, const TQPixmap>(x))

// [NOTE]
// It is IMPOSSIBLE to downcast an abstract base class [ABC] to a derived type.  Period.  End of story.
// Think of it this way...is it ever possible to instantiate an ABC on its own (e.g. with new)?  No!
// Therefore, it is also impossible to copy an ABC.
// static_cast won't work because an ABC has a completely different structure than a non abstract class.
// Specifically, you will get segmentation faults in typeinfo for the ABC at runtime.
// This is probably due to the complete absence of the abstract method implementations in the static_casted object.
// The only exception that I can think of MIGHT be if NO CHANGES are made to the abstracted methods,
// including addition, modification, or removal of said methods.  Don't bet the farm on this however!

// #define TQT_TQLAYOUTITEM_CONST(x) (static_cast<const TQLayoutItem*>(static_cast<const QLayoutItem*>(x)))

// // [FIXME]
// // This should try a dynamic cast first before resorting to conversion (which entails a create/copy/delete operation)
// // There is half a chance that this sort of nasty hackery is only required for abstract base classes, such as QStyle and QLayoutItem
// // For other class types a simple static_cast *might* suffice. [???]
// template <class T, class U>
// U* tqt_convert_object(T* orig)
// {
//     T* orig_ptr = orig;
//     U* temp = new U();
//     *temp = *orig;
//     orig_ptr = temp;
//     delete orig;
//     return temp;
// }
// 
// #define TQT_TQLAYOUTITEM_CONST(x) (tqt_convert_object<const QLayoutItem, const TQLayoutItem>(x))

// TQT_BASE_OBJECT is here for equality operators, as pointers will only be considered equal if the top (base) classes are compared
// This is because all widget/extension/etc. classes will have one and only one TQT_BASE_OBJECT class instance in memory
// Thus casting both pointers to TQT_BASE_OBJECT and comparing will reveal if the objects being compared are truly the same
// For TQT 3 TQObject is the real base class, while in TQt 4 QObject is the real base class
#define TQT_BASE_OBJECT_NAME QObject
#define TQT_BASE_OBJECT(x) (static_cast<TQT_BASE_OBJECT_NAME*>(x))
#define TQT_BASE_OBJECT_CONST(x) (static_cast<const TQT_BASE_OBJECT_NAME*>(x))

// This can be used to change any object name within TQt
// x is a QString or TQString
#define TQT_OBJECT_NAME_HANDLER(x) TQString(x)

// Safe casts
template <class T>
T tqt_dynamic_cast(TQT_BASE_OBJECT_NAME* a) { return dynamic_cast<T>(a); }

template <class T>
T tqt_dynamic_cast(const TQT_BASE_OBJECT_NAME* a) { return dynamic_cast<T>(a); }

// Interface defines
#define QABS(n) qAbs(n)
#define QMIN(x, y) qMin(x, y)
#define QMAX(x, y) qMax(x, y)

#define tqt_mo_access access()

// [FIXME] The underlying problem in uic creating the need for these defines should probably be fixed sometime in the future...
// See object.cpp e.g. line 571
#define setTqmaximumSize	setMaximumSize
#define setTqminimumSize	setMinimumSize
#define setTqalignment		tqsetAlignment
#define setTqgeometry		setGeometry

#define Q_UINT16 quint16

#define ttqqt_cast( x ) tqqt_cast(TQT_TQOBJECT(x))

// TQT for Qt3 compatibility defines
#define tqred red
#define tqgreen green
#define tqblue blue
#define tqcyan cyan
#define tqmagenta magenta
#define tqyellow yellow
#define tqdarkRed darkRed
#define tqdarkGreen darkGreen
#define tqdarkBlue darkBlue
#define tqdarkCyan darkCyan
#define tqdarkMagenta darkMagenta
#define tqdarkYellow darkYellow
#define tqwhite white
#define tqwhiteptr &TQt::white
#define tqlightGray lightGray
#define tqgray gray
#define tqdarkGray darkGray
#define tqblack black
#define tqblackptr &TQt::black
#define tqcolor0 color0
#define tqcolor1 color1

// #define tqaccess                access
// #define tqcolorTable            colorTable
#define TQSO_Default            Default
// #define tqqt_cast               ::qt_cast
#define TQ_Alignment		Qt::Alignment
#define TQ_Horizontal           Horizontal
#define TQ_Vertical             Vertical
#define TQImage_ScaleFree       ScaleFree
#define TQ_Key_Shift            Key_Shift
#define TQ_Key_Control          Key_Control
#define TQ_Key_Alt              Key_Alt
#define TQ_Key_Meta             Key_Meta
#define TQ_Key_Super_L          Key_Super_L
#define TQ_Key_Super_R          Key_Super_R
#define TQ_Key_Hyper_L          Key_Hyper_L
#define TQ_Key_Hyper_R          Key_Hyper_R
#define TQ_ButtonState          TQt::ButtonState
#define TQ_LeftButton           Qt::LeftButton
#define TQ_MidButton            Qt::MidButton
#define TQ_RightButton          Qt::RightButton
#define TQ_ShiftButton          ShiftButton
#define TQ_ControlButton        ControlButton
#define TQ_AltButton            AltButton
#define TQ_MetaButton           MetaButton
#define TQ_ScaleFree		ScaleFree
#define TQ_ScaleMin		ScaleMin
#define TQ_ScaleMax		ScaleMax
#define TQ_ScaleMode		ScaleMode
#define TQ_StrongFocus		Qt::StrongFocus
#define TQ_NoFocus		Qt::NoFocus
#define TQ_WheelFocus		Qt::WheelFocus
#define TQ_ClickFocus		Qt::ClickFocus
#define TQ_TabFocus		Qt::TabFocus
#define TQ_FocusPolicy		Qt::FocusPolicy
#define TQ_SPExpandData		Qt::Orientations
#define TQIODevice_OpenModeFlag QIODevice::OpenModeFlag
#define TQ_OpenMode		OpenMode

// #define Orientation Qt::Orientation

// #define SubRect			SubElement
// #define SR_PushButtonContents	SE_PushButtonContents
// #define SR_PushButtonFocusRect	SE_PushButtonFocusRect
// #define SR_CheckBoxIndicator	SE_CheckBoxIndicator
// #define SR_CheckBoxContents	SE_CheckBoxContents
// #define SR_CheckBoxFocusRect	SE_CheckBoxFocusRect
// #define SR_RadioButtonIndicator	SE_RadioButtonIndicator
// #define SR_RadioButtonContents	SE_RadioButtonContents
// #define SR_RadioButtonFocusRect	SE_RadioButtonFocusRect
// #define SR_ComboBoxFocusRect	SE_ComboBoxFocusRect
// #define SR_SliderFocusRect	SE_SliderFocusRect
// #define SR_DockWindowHandleRect	SE_DockWindowHandleRect
// #define SR_ProgressBarGroove	SE_ProgressBarGroove
// #define SR_ProgressBarContents	SE_ProgressBarContents
// #define SR_ProgressBarLabel	SE_ProgressBarLabel
// #define SR_ToolButtonContents	SE_ToolButtonContents
// #define SR_DialogButtonAccept	SE_DialogButtonAccept
// #define SR_DialogButtonReject	SE_DialogButtonReject
// #define SR_DialogButtonApply	SE_DialogButtonApply
// #define SR_DialogButtonHelp	SE_DialogButtonHelp
// #define SR_DialogButtonAll	SE_DialogButtonAll
// #define SR_DialogButtonAbort	SE_DialogButtonAbort
// #define SR_DialogButtonIgnore	SE_DialogButtonIgnore
// #define SR_DialogButtonRetry	SE_DialogButtonRetry
// #define SR_DialogButtonCustom	SE_DialogButtonCustom
// #define SR_ToolBoxTabContents	SE_ToolBoxTabContents
// #define SR_CustomBase		SE_CustomBase
//
// #define StylePixmap			StandardPixmap
// // #define SP_TitleBarMinButton		SC_TitleBarMinButton
// // #define SP_TitleBarMaxButton		SC_TitleBarMaxButton
// // #define SP_TitleBarCloseButton		SC_TitleBarCloseButton
// // #define SP_TitleBarNormalButton		SC_TitleBarNormalButton
// // #define SP_TitleBarShadeButton		SC_TitleBarShadeButton
// // #define SP_TitleBarUnshadeButton	SC_TitleBarUnshadeButton
// #define SP_DockWindowCloseButton	SP_DockWidgetCloseButton
// // #define SP_MessageBoxInformation	SC_MessageBoxInformation
// // #define SP_MessageBoxWarning		SC_MessageBoxWarning
// // #define SP_MessageBoxCritical		SC_MessageBoxCritical
// // #define SP_MessageBoxQuestion		SC_MessageBoxQuestion
// // #define SP_CustomBase			SC_CustomBase
//
// #define StyleFlags		StateFlags
// #define Style_Default		QStyle::State_Default
// #define Style_Enabled		QStyle::State_Enabled
// #define Style_Raised		QStyle::State_Raised
// #define Style_Sunken		QStyle::State_Sunken
// #define Style_Off		QStyle::State_Off
// #define Style_NoChange		QStyle::State_NoChange
// #define Style_On		QStyle::State_On
// #define Style_Down		QStyle::State_DownArrow
// #define Style_Horizontal	QStyle::State_Horizontal
// #define Style_HasFocus		QStyle::State_HasFocus
// #define Style_To		QStyle::State_To
// #define Style_Bottom		QStyle::State_Bottom
// #define Style_FocusAtBorder	QStyle::State_FocusAtBorder
// #define Style_AutoRaise		QStyle::State_AutoRaise
// #define Style_MouseOver		QStyle::State_MouseOver
// #define Style_Up		QStyle::State_UpArrow
// #define Style_Selected		QStyle::State_Selected
// #define Style_Active		QStyle::State_Active
// #define Style_ButtonDefault	QStyle::State_ButtonDefault
//
// #define PE_ArrowDown		PE_IndicatorArrowDown
// #define PE_ArrowUp		PE_IndicatorArrowUp
// #define PE_ButtonTool		PE_PanelButtonTool
// #define	PE_DockWindowHandle	PE_IndicatorToolBarHandle
// #define PE_DockWindowSeparator	PE_Q3DockWindowSeparator
// // Verify this one -------------v
// #define PE_FocusRect		PE_FrameFocusRect
// #define PE_Panel		PE_Frame
// #define PE_RubberBand		CE_RubberBand
// #define PE_ScrollBarAddLine	CE_ScrollBarAddLine
// #define PE_ScrollBarAddPage	CE_ScrollBarAddPage
// #define PE_ScrollBarFirst	CE_ScrollBarFirst
// #define PE_ScrollBarLast	CE_ScrollBarLast
// #define PE_ScrollBarSlider	CE_ScrollBarSlider
// #define PE_ScrollBarSubLine	CE_ScrollBarSubLine
// #define PE_ScrollBarSubPage	CE_ScrollBarSubPage
//
// #define SC_ListView		SC_Q3ListView
// #define SC_ListViewBranch	SC_Q3ListViewBranch
// #define SC_ListViewExpand	SC_Q3ListViewExpand
//
// #define CC_ListView		CC_Q3ListView
//
// #define WState			Qt::WidgetAttribute
// #define	WState_Polished		Qt::WA_WState_Polished
// //#define WState_ForceHide	Qt::WA_WState_ForceHide
// #define WState_ForceHide	Qt::WA_WState_Hidden
//
// #define SH_PopupMenu_Scrollable			SH_Menu_Scrollable
// #define SH_PopupMenu_SloppySubMenus		SH_Menu_SloppySubMenus
// #define SH_PopupMenu_SubMenuPopupDelay		SH_Menu_SubMenuPopupDelay
// #define SH_PopupMenu_AllowActiveAndDisabled	SH_Menu_AllowActiveAndDisabled
// #define SH_PopupMenu_MouseTracking		SH_Menu_MouseTracking
//
// #define	CE_PopupMenuScroller			CE_MenuScroller
//
// #define PM_DockWindowHandleExtent		PM_DockWidgetHandleExtent
// #define PM_MenuBarFrameWidth			PM_ToolBarFrameWidth
// #define PM_DockWindowFrameWidth			PM_DockWidgetFrameWidth
// #define PM_PopupMenuScrollerHeight		PM_MenuScrollerHeight
//
// // #define WFlags			Qt::WindowFlags

#endif // USE_QT4

#endif // TQTGLOBALDEFINES_H