1 # Copyright (C) 2009, Parrot Foundation.
6 examples/nci/QtHelloWorld.pir - Qt Example
10 % ./parrot examples/nci/QtHelloWorld.pir
14 Sample "Hello World" with Qt, via Parrot Native Call Interface (NCI). See
15 F<docs/pdds/pdd03_calling_conventions.pod>.
17 Qt - A cross-platform application and UI framework
18 (L<http://www.qtsoftware.com/about/news/lgpl-license-option-added-to-qt>). You'll need to build
19 F<libPQt.so> or F<PQt.dll> and install it in F<runtime/parrot/dynext> for this to
20 work, see F<examples/nci/PQt.C> for more information.
22 Note that this will either need JIT for building the NCI-functions on
23 the fly. If this is not available try adding missing signatures to
24 F<src/nci/extra_thunks.nci>, running F<tools/dev/mk_nci_thunks.pl>, and
31 loadlib libpqt, "libPQt"
36 message = 'Install PQt.dll or libPQt.so into runtime/parrot/dynext'
42 .local pmc QApplication_new, pApp
43 dlfunc QApplication_new, libpqt, "QApplication_new", "pv"
44 pApp = QApplication_new()
46 .local pmc QLabel_new, pLabel
48 caption = "Hello, world!"
49 dlfunc QLabel_new, libpqt, "QLabel_new", "pt"
50 pLabel = QLabel_new(caption)
52 .local pmc QLabel_resize
53 dlfunc QLabel_resize, libpqt, "QLabel_resize", "vpii"
54 QLabel_resize(pLabel, 120, 30)
56 .local pmc QLabel_show
57 dlfunc QLabel_show, libpqt, "QLabel_show", "vp"
60 .local pmc QApplication_exec
61 dlfunc QApplication_exec, libpqt,"QApplication_exec", "vp"
62 QApplication_exec(pApp)
68 F<examples/nci/PQt.C>, F<docs/pdds/pdd03_calling_conventions.pod>.
76 # vim: expandtab shiftwidth=4 ft=pir: