[TT# 1592][t] Improve test for open opcode delegation. All tests in the file pass...
[parrot.git] / examples / nci / PQt.cpp
blob5ae8845c7639b3b8233c994d7719e0d5158f453e
1 /*
3 # Copyright (C) 2001-2003, Parrot Foundation.
4 # $Id$
6 =head1 NAME
8 examples/nci/PQt.cpp - Qt/Parrot Library
10 =head1 SYNOPSIS
12 Compile with:
14 *NIX:
16 $ g++ -fPIC -I$QTDIR/include -I$QTDIR/include/QtGui -L$QTDIR -c PQt.cpp
18 $ gcc -shared -o libPQt.so PQt.o $QTDIR/lib/libQtCore4.so $QTDIR/lib/libQtGui4.so
20 Windows:
22 > "%VS90COMNTOOLS%\vsvars32.bat"
24 > set INCLUDE=%QTDIR%\include;%QTDIR%\include\QtGui;%INCLUDE%
26 > set LIB=%QTDIR%\lib;%LIB%
28 > cl /LD PQt.cpp QtGui4.lib QtCore4.lib
30 Or something like that...
32 =head1 DESCRIPTION
34 Qt Native interface for Parrot. See F<examples/nci/QtHelloWorld.pir>
35 for more information.
37 =cut
41 #ifdef _WIN32
42 #define PQT_API __declspec(dllexport)
43 #else
44 #define PQT_API
45 #endif
47 #include <QtGui>
48 extern "C" {
50 PQT_API QApplication * pApp;
54 =head2 QApplication bindings
56 =over 4
58 =item C<QApplication *QApplication_new(void)>
60 =cut
63 PQT_API QApplication *QApplication_new(void) {
64 int PQtargc = 0;
65 char *PQtargv[2];
66 PQtargv[0] = "";
67 PQtargv[1] = NULL;
68 pApp = new QApplication(PQtargc, PQtargv);
69 return pApp;
74 =item C<void QApplication_exec(QApplication *app)>
76 =cut
80 PQT_API void QApplication_exec(QApplication *app)
82 app->exec();
87 =back
89 =head2 QLabel bindings
91 =over 4
93 =item C<QLabel * QLabel_new(const char *txt)>
95 =cut
99 PQT_API QLabel * QLabel_new(const char *txt)
101 QLabel * pLabel = new QLabel(txt, 0);
102 return pLabel;
107 =item C<void QLabel_show(QLabel *label)>
109 =cut
113 PQT_API void QLabel_show(QLabel *label)
115 label->show();
120 =item C<void QLabel_resize(QLabel *label, int x, int y)>
122 =cut
126 PQT_API void QLabel_resize(QLabel *label, int x, int y)
128 label->resize(x, y);
135 =back
137 =head1 SEE ALSO
139 F<examples/nci/QtHelloWorld.pir>,
140 F<docs/pdds/pdd03_calling_conventions.pod>.
142 =cut
147 * Local variables:
148 * c-file-style: "parrot"
149 * End:
150 * vim: expandtab shiftwidth=4: