Closed bigos closed 7 years ago
Is QTextEdit::setText not good enough or what exactly is the problem?
Short example:
(with-main-window (w (q+:make-qtextedit))
(let ((path (q+:qfiledialog-get-open-file-name)))
(when (string/= path "")
(setf (q+:text w) (alexandria:read-file-into-string (uiop:parse-native-namestring path))))))
Because my widget was wrapped inside a layout, not like in your example, I had problems accessing the instance of text-edit. While your simple example works, translating QT documentation to qtools is sometimes not obvious for a new user.
Well, define-subwidget
, which I assume you used to define the text edit, states:
a finalized slot of NAME is added to WIDGET-CLASS
Thus it should be obvious that you can retrieve the instance through slot-value
or with-slots-bound
. Qtools' documentation is not meant to be an introduction to Qt or Lisp in general.
I am not that good with CLOS and the quoted text doesn't make it obvious to me. Do you think I would be better off using only CommonQT for now and move to Qtools only when I get more familiar with QT?
I generally don't think that using CommonQt over Qtools would help in learning to use Qt or CL.
So, I will just keep trying with Qtools and occasionally will ask you a question. Problem solved!
Sure. As phoe mentioned in the other thread, the IRC channels will be available for questions as well.
I tried to understand your Readme and examples and made some progress creating a QT GUI. However, I got hopelessly stuck at implementing an operation that reads from the file (that is simple) and puts the read text in a text widget (this is hard).
I tried to follow: http://doc.qt.io/qt-4.8/gettingstartedqt.html