Skip to content

Italian

A forum for those speaking Italian
465 Topics 1.9k Posts
  • aggiunggere QPushButton da c++

    Solved
    2
    0 Votes
    2 Posts
    709 Views
    darkstaringD
    RISOLTO: https://forum.qt.io/topic/94720/add-element-from-c-qt-widget
  • Wearables

    Unsolved
    1
    0 Votes
    1 Posts
    396 Views
    No one has replied
  • Dashboard da database xml

    Unsolved
    2
    0 Votes
    2 Posts
    671 Views
    VRoninV
    Un buon inizio e' questo esempio: https://doc.qt.io/qt-5/qtcharts-modeldata-example.html una database xml XML e' un file di testo, non un database. Puoi specificare meglio da dove arrivano i dati?
  • licenza e compilazione statica o dinamica linux

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    gfxxG
    @mrdebug mi piacerebbe, mai stato ad un evento. Purtroppo presenzio già ad una fiera questo mese ... e non so se avrò il tempo per spostarmi ancora. Avevo guardato più il sito denisgottardello che altro ... pensando che quello fosse il tuo mondo di provenienza. I prodotti su labcsp sono fuori dal nostro orizzonte ... ti mando una mail ad "info" così possiamo stare in contatto. Se poi cambio idea ben venga ci vedremo il 25. ciao
  • QToolbar in 2 righe

    Unsolved
    1
    0 Votes
    1 Posts
    621 Views
    No one has replied
  • Problema con QSqlQuery e size

    Solved
    6
    0 Votes
    6 Posts
    2k Views
    F
    @VRonin said in Problema con QSqlQuery e size: bool haAlmenoUnaRiga = false; for(;query.next();haAlmenoUnaRiga=true) { ui->baseTable->insertRow(ui->baseTable->rowCount()); for (int i = 0; i < header.size(); ++i) { QTableWidgetItem* tempItem = new QTableWidgetItem; tempItem->setData(Qt::EditRole,query.value(header.at(i))); ui->baseTable->setItem(rows, i, tempItem); } rows++; } if(!haAlmenoUnaRiga) qDebug() << "KO"; sembra funzionare alla perfezione. grazie mille!!
  • Accessibilità risorse QML in Android

    Unsolved
    2
    0 Votes
    2 Posts
    718 Views
    VRoninV
    Purtroppo non e' per niente banale. L'immenso @ekkescorner ha scritto un blog che illustra il processo: https://blog.qt.io/blog/2017/12/01/sharing-files-android-ios-qt-app/
  • Problema con segnale che viene emesso più volte

    Unsolved
    2
    0 Votes
    2 Posts
    760 Views
    VRoninV
    connect crea una nuova connessione tutte le volte che lo chiami. Hai due possibilita': Sposta i connect nel costruttore di MainScreen ivece che negli slot dei pulsanti (fortemente consigliato) Aggiungi Qt::UniqueConnection come quinto argomento al tuo connect
  • Copia da Qbytearray a elemento di una struct & union

    Solved
    3
    0 Votes
    3 Posts
    809 Views
    lagodolioL
    Grazie, VRonin . Problema risolto! ll controllo dei dati della seriale è nella parte di codice che non ho postato, mentre l'inizializzazione della union mi sembra proprio un'ottima idea. Per sicurezza , era start_char [2] : in fondo occupa come un segnale di inizio + fine, e mi sembrava più robusto. Devo ancora valutare la cosa, magari vedendo alla fine se ho margine o meno... Grazie ancora e buona giornata
  • Streaming seriale ... disordinato : comunicazioni tra QT e microcontrollori

    Solved
    5
    0 Votes
    5 Posts
    2k Views
    lagodolioL
    Ho capito che il problema stava nella comunicazione tra pc e micro, infatti facendo alcune prove con Linux e concatenando da terminale l'output su un file non ho riscontrato problemi. Grazie ancora a tutti!
  • Problema di installazione

    Unsolved
    3
    0 Votes
    3 Posts
    819 Views
    B
    Tirupathi, may be, but in another computer the problem is not present. The following picture is the same example in another my computer, and is ok [image: 6672bce8-8250-493b-9912-f3e1ea618e58.JPG]
  • Qt 5.11 su KDE Neon 5.13.2

    Unsolved kde neon qt 5.1
    1
    0 Votes
    1 Posts
    428 Views
    No one has replied
  • QML - Lanciare applicazioni esterne

    Unsolved
    3
    0 Votes
    3 Posts
    784 Views
    B
    Grazie VRonin, farò qualche prova e aggiornerò il forum
  • Definizione funzione

    Unsolved
    2
    0 Votes
    2 Posts
    767 Views
    VRoninV
    Creare una funzione e' banale ma non credo sia quello che vuoi. puoi essere piu' specifico?
  • Project ERROR: Unknown module(s) in QT: Solid

    Unsolved
    3
    0 Votes
    3 Posts
    981 Views
    VRoninV
    Solid e' un modulo delle librerie KDE, non di Qt. installa git installa cmake clona la repository git://anongit.kde.org/solid.git apri una console sviluppatore (se usi il compilatore MSVC esegui qtenv2.bat and vcvarsall.bat) esegui set KDELIBPATH = C:\KDE mkdir build cd build cmake -G "NMake Makefiles" -DCMAKE_DEBUG_POSTFIX=d -DCMAKE_INSTALL_PREFIX=%KDELIBPATH% -DCMAKE_BUILD_TYPE=DEBUG ../ cmake --build . cmake --build . --target install cmake -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=%KDELIBPATH% -DCMAKE_BUILD_TYPE=RELEASE ../ cmake --build . cmake --build . --target install Questo installera' il modulo Solid in C:\KDE Per usarlo aggiungi al tuo .pro file: LIBS += -LC:/KDE/lib INCLUDEPATH += C:/KDE/include/KF5/Solid CONFIG(release, debug|release) { LIBS += -lKF5Solid } CONFIG(debug, debug|release) { LIBS += -lKF5Solidd } Per installare su altri sistemi operativi e/o compilatori la differenza principale e' il generatore gi cmake (la parte dopo -G) una lista di possibili generatori e' disponibile su https://cmake.org/cmake/help/v3.0/manual/cmake-generators.7.html
  • Problema con esecuzione query di update

    Unsolved
    10
    0 Votes
    10 Posts
    2k Views
    VRoninV
    @fermatqt said in Problema con esecuzione query di update: andrebbe in errore, in quanto non gli passo nessun parametro vero ma e' facilmente solvibile: UPDATE CCOMCL_ATTRIB_ESTESI SET VALORE = ? WHERE DITCONTI = 'XXL' AND CODICE_ATTR = 'CI-PRIORITA' AND CHIAVE = 'CL' || ? || '01.01.1000'; DROP TABLE CCOMCL_ATTRIB_ESTESI;
  • come scaricare Qt5 completo di dipendenze

    Unsolved
    15
    0 Votes
    15 Posts
    6k Views
    P
    Ho cercato nel web problemi simili al mio ed ho trovato questa discussione Ho seguito le indicazioni "" In any case, you can fix the configuration relatively easily. Go to Tools -> Options Select Build & Run On the Compilers tab you should see your installed compiler in the auto-detected section. If you have a compiler installed but it isn't recognized, add it here manually. On the Qt Versions tab, the version I installed from the Fedora repo (currently 5.7.0) appears in the Manual section (even though I didn't add it manually). You can add it by browsing to /usr/bin/qmake-qt5. "" ed ho trovato: [image: 9562cbcc-80b4-40dd-bb70-5050e20aea2c.png] [image: 2b072775-60e7-4d1c-a757-c4bf44e631fb.png] [image: f592a885-3c70-4a9e-817e-4a6bdf638f4a.png] A me sembra tutto a posto. Ma intanto La creazione di un nuovo progetto non funziona.
  • Errore su Android NDK

    Unsolved
    1
    0 Votes
    1 Posts
    473 Views
    No one has replied
  • Come Cominciare un programma, con Qt Creator o con C++

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    VRoninV
    Oh, sicuramente non c'e' niente di male, soprattutto all'inizio a partire dalla gui e costruirci sopra le funzionalita'
  • QML e UDP Socket

    Unsolved
    5
    0 Votes
    5 Posts
    2k Views
    B
    Grazie mrdebug, sono arrivato ad un risultato. Posto il codice a beneficio di tutti gli utenti, anche se c'è un'ultima cosa che non torna. MAIN.CPP #include <QGuiApplication> #include <QQmlApplicationEngine> #include "myudp.h" int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); qmlRegisterType<MyUDP>("MyUDP", 1, 0, "MyUDP"); QQmlApplicationEngine engine; engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); if (engine.rootObjects().isEmpty()) return -1; return app.exec(); } MYUDP.H #ifndef MYUDP_H #define MYUDP_H #include <QObject> #include <QUdpSocket> class MyUDP : public QObject { Q_OBJECT Q_PROPERTY(QByteArray type READ type WRITE setType NOTIFY typeChanged) public: explicit MyUDP(QObject *parent = 0); void SayHello(); QByteArray type(); void setType(const QByteArray &t); signals: void typeChanged(); public slots: void readyRead(); private: QUdpSocket *socket; QByteArray _type; }; #endif // MYUDP_H MYUDP.C #include "myudp.h" MyUDP::MyUDP(QObject *parent) : QObject(parent) { socket = new QUdpSocket(this); socket->bind(1129, QUdpSocket::ShareAddress); connect(socket,SIGNAL(readyRead()),this, SLOT(readyRead())); } // send message in client mode void MyUDP::SayHello() { QByteArray Data; Data.append("test message"); socket->writeDatagram(Data,QHostAddress::LocalHost,5824); } void MyUDP::readyRead() { QByteArray Buffer; Buffer.resize(socket->pendingDatagramSize());; QHostAddress sender; quint16 senderPort; socket->readDatagram(Buffer.data(),Buffer.size(), &sender, &senderPort); qDebug()<< "Message size:" << Buffer.size(); setType(Buffer); } QByteArray MyUDP::type() { return _type; } void MyUDP::setType(const QByteArray &t) { _type = t; emit typeChanged(); } MAIN.QML import QtQuick 2.0 import QtQuick.Controls 2.2 import "main.js" as SpkScript import MyUDP 1.0 ApplicationWindow { id: window visible: true title: qsTr("AESA.Monitor") MyUDP { id:myUdp onTypeChanged: { console.log("[QML]Msg:" + type) } } } L'esempio funziona in ricezione. Il pacchetto ricevuto è contenuto in "type" (lato QML). Se si fa una console.log(typeof type) il risultato è "object". Se si ricevono caratteri stampabili va tutto bene. Ho provato il codice seguente che trasforma type in stringa permettendo l'uso di tutte le funzioni relative: var m=type.toString(); if(m.slice(0,4)==="col=") { ecc.ecc... il problema (nel mio caso) è che ricevo dati binari, per cui la conversione a stringa non funziona più bene (al primo carattere non stampabile la stringa si interrompe). Ho provato a ricavare i singoli byte dalla variabile type ma senza successo: type[0] ritorna "not defined" type.charCodeAt(0) non funziona (non è una stringa) ci vorrebbe una conversione ad array ma non so come fare. grazie per tutti i suggerimenti ciao