Hello there,
I have acquired common-qt and will try to work my way through
translating the Qt tutorials. [These can be accessed from
http://common-lisp.net/project/commonqt/
by running down to the Examples paragraph and right-clicking on the
Qt tutorial link.]
tutorial1 has me puzzled already.
Its objective is to create a push button holding dear old Hello World!
The C++ source code shows that its approach is to build the object out
of sight, and them display it; the translation of tutorial14 (also
reachable from common-qt's home page) kindly supplied by David
Lichteblau and Stas Boukarev use clos as the logical improvement on
c++ classes. I presume that a purpose of the set of tutorials is to
make one familiar with this way of structuring code.
I am running ccl Version 1.9-r15975M (LinuxX8664) under Linux Mint 14
(64bit) on an HP box.
Having loaded commonqt, and issued the requisite
(named-readtables:in-readtable :qt)
I thought I would see whether I could create the button in the repl
before dealing with the structuring. Some poking about in Qt's own
documents [for Qt4.8, since that is the version recommended] led to
(with-main-window (window (#_new QPushButton "Hello World!")))
This does produce the desired button, with the letter "a" where a title
would go. It's part of argv0dummy, it seems.
I notice, with some interest, that the Qt c++ code shows a
result with "t1" as the window's title without any mention of t1 in the
code itself.
More poking led me to the function setTitle associated with QWindow,
which appears to take a QString as argument, and thus to
(with-main-window (window (#_new QPushButton "Hello World!"))
(#_setTitle window (#_new QString "t1")))
from which I received
Error: Class not found: QString.
Back to the docs, and on the Qt side I would have needed
#include <QString>
before using one.
Then I realised that I don't know how to get access to such Qt-packages
on the fly inside commonqt. Evidently there are some/many which do not
come with (ql:quickload :qt).
Pointers to how to get access to QStrings, and how to learn about how to
do so without having to ask the list would be appreciated. The joys of
converting repl -> clos await me!
With thanks for your patience,
Cheers /Greg Bennett
Hello there .. I am running linux mint 14 (64 bit) and clozure (ccl
1.9-r15972M), and have just installed commonqt, as well as many
non-lisp necessities on the qt side.
I am a tad stuck in trying to use commonqt, and would appreciate a
pointer to assistance.
(1) In trying to run the example pointed to on the page
http://common-lisp.net/project/commonqt/#main-window
as the lisp version of the currency-conversion code, and thus in a
package which apparently references qt, in a fresh ccl
I am told that there is no with-main-window function. This string
is also referred to as a macro on the above page.
It would seem that I am missing it, so a pointer to its definition
would be helpful.
(2) Way down in a git clone, where commonqt lives, there is a test
subdirectory containing 3 files, one of which is package.lisp
which holds only this definition:
(defpackage :qt-tests
(:use :cl :rt :qt :iterate))
The package qt-tests is the one within which the tests.lisp code is to
run. Issuing the above defpackage ->
Error There is no package named "RT"
so, again, I seem stuck for lack of knowledge.
Thanks for any and all assistance.
Cheers /Greg Bennett