Closed Martinix75 closed 8 months ago
Hi Andrea, I will not have much time looking into this the coming weeks, but have you tried the latest commit?
I.e. installing with nimble install https://github.com/jerous86/nimqt@#head
?
(Just doing nimble install https://github.com/jerous86/nimqt
will not install the latest commit)
Does it still occur then?
no! I think I have not tried the latest Commit (Nimble Install https://github.com/jerous86/nimqt@#head) but only with the classic "Nimble Install https://github.com/jerous86/nimqt". On Monday I feel and see what happens (this slate too I can only have a thousand things to do). I'll let you know, for now thanks! Hello from Andrea
I tried to install nimqt with Nimble Install https://github.com/jerous86/nimqt@#head. (in .nimble/pkgs2/nimq-0.2.0 ...) but when I go to fill in it goes to take the library in ./nimble/pkg/nimq-0.1-0. (although using nim2) What do I have to do to tell him to use the correct package?
I solved by erasing the "pkgs" folder now it seems to copy correctly ... but .... Everyone seems to go and get now, the correct package (ver 020) except one, which I don't know why it still looks for the package in pksg/nimq-01)
import os
import nimqt
import nimqt/qdialog
import nimqt/[qtextbrowser, qlineedit]
nimqt.init #inizializza tutto il framekork
let app1 = newQApplication(commandLineParams()) #linea obbligatora (da mettere in inizio) per avviare l'app.
let txb = newQTextBrowser() #creiamo l'oggetto Qtextbroswer
inheritQObject(Pippo, Qlineedit): #qui Pippo ededita da Qlinedit (di fatto pippo è qilinedit) ma dichiariamo gli slot a cui fara capo.
slot_decl stampa() #dichiara lo slot che andremo a creare (dopo)
#qui non puoi usare slot, perche la var "cavolo" viene dichiarata dopo.
#let gui: ptr Pippo = newPippo()
let finestra: ptr QDialog = newQDialog() #creamo ( e puntimao) all'oggetto Qdialog cha ci dara dei metodi per la finestra
finestra.makeLayout: #crea il layout Verticale (qVboxLayout)
- use_object txb #inserisco nel layout vert il Textbrowse (segue loride)
- newPippo() as cavolo: #inserisco l'ogetto modificato Pippo = Qlinedit) e gli do un alias.
setFocus() #meto il focus su qlinedit
connect(SIGNAL "returnPressed()", cavolo, SLOT "stampa()") #quando premo invio chiama lo slot "stampa() priam dicharato
proc stampa(this: ptr Pippo) = #slot che va a chiamare e dichiarato prima in eredità
echo "ok" #stampa "ok" in consoll
txb.append(cavolo.text()) #aggiunge qualcosa a Qtextbrosver (in oista)
cavolo.clear() #cancella la Qlineedit
finestra.setWindowTitle(Q"Calcolatorice") #mette un titolo alla finestra
finestra.show() #mostra la finestra a video
discard app1.exec() #ciclo infinito
And I can't understand why, and what different in this program than others !! (or what I'm wrong).
This also does not work (it seems there is a problem on icons)
import os
import nimqt
import nimqt/[qlabel, qpushbutton, qspinbox, qicon]
import nimqt/[qwidget, qboxlayout, qgridlayout, qdialogbuttonbox]
nimqt.init
let pwmApp = newQApplication(commandLineParams())
let lab1 = newQLabel(Q"Set PWM")
let sbx1 = newQSpinBox()
sbx1.setRange(0,100)
sbx1.setsuffix(Q" %")
let lab2 = newQLabel(Q"Set Time")
let sbx2 = newQSpinBox()
sbx2.setSuffix(Q" Min")
sbx2.setMinimum(0)
let sbx3 = newQSpinBox()
sbx3.setSuffix(Q" Sec")
sbx3.setRange(0, 59)
inheritQObject(Pippo, QObject):
slot_decl io()
#let icona = newQIcon(Q"eco.png") #<=========== PROBLAM!!!!!!!!!!
echo "ciao"
let gui: ptr Pippo = newPippo()
let finestra: ptr QWidget = newQWidget()
finestra.makeLayout: #cosi sembra un layout verticale...
- newQWidget():
- newQHBoxLayout():
- use_object lab1
- use_object sbx1
- newQWidget():
- newQHBoxLayout():
- use_object lab2
- use_object sbx2
- use_object sbx3
- newQDialogButtonBox(newQFlags(QDialogButtonBox_StandardButton.Ok)|newQFlags(QDialogButtonBox_StandardButton.Close), finestra):
connect(SIGNAL "rejected()", finestra, SLOT "close()")
connect(SIGNAL "accepted()", gui, SLOT "io()")
proc io(this: ptr Pippo) =
echo "Valore Accettato...."
echo (sbx1.text)
echo (sbx2.text)
echo (sbx3.text)
finestra.setWindowTitle(Q"TestPWM")
finestra.setGeometry(160, 140, 300, 100)
#finestra.setWindowIcon(icona) #<========= PRPBLEM
finestra.show()
discard pwmApp.exec()
Sorry if I put some things together, but I didn't want to open 100 Uisses! Bye!
Hi Andrea, it's ok if you open a lot of issues. That makes it a bit easier for me to track things.
I'm not sure I understand all the problems you are listing. If it's still not working, could you give me maybe a minimal example that goes wrong, together with an explanation of what goes wrong?
I solved by erasing the "pkgs" folder now it seems to copy correctly ... but .... Everyone seems to go and get now, the correct package (ver 020) except one, which I don't know why it still looks for the package in pksg/nimq-01)
I tried to run the program you give there, and it runs without any compilation error on my laptop.
Regarding the problem with the icon
#let icona = newQIcon(Q"eco.png") #<=========== PROBLAM!!!!!!!!!!
For me it compiles when I do
let icona = newQIcon(path)```
So it might be something related to the nim compiler.
Sorry if I answer slow, but I'm working on things and time is always little. No now (with Nimqt 0.2.0) fill out everything perfectly. For the icon discourse, Aporo another post. So this can close it, and open a new one.
Good morning. I've been writing for a long time !!! But in the summer I have very little time to devote to the computer, but luckily the autumn is now about to arrive. I tried Ninqt with Nim 2.0.0, and obviously I don't fill out, I wanted to know if you understand why! I tried to replace for example:
with:
manually on all mistakes ... a nightmare !! But in the end I get a compilation error:
I don't know if it can be useful! For now hello from Andrea p.s. Other simplest windows, with this change, are also compiled with Nim2.0.0
this windows run whit Nim 2.0.0!!