Skip to content

Italian

A forum for those speaking Italian
459 Topics 1.9k Posts
QtWS25 Last Chance
  • Problema con QSqlQuery e size

    Solved
    6
    0 Votes
    6 Posts
    1k 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
    618 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
    639 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
    699 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
    1k 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
    702 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
    385 Views
    No one has replied
  • QML - Lanciare applicazioni esterne

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

    Unsolved
    2
    0 Votes
    2 Posts
    671 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
    875 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
    5k 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
    441 Views
    No one has replied
  • Come Cominciare un programma, con Qt Creator o con C++

    Unsolved
    4
    0 Votes
    4 Posts
    1k 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
  • QML - Pinch e Drag contemporaneo

    Unsolved
    1
    0 Votes
    1 Posts
    395 Views
    No one has replied
  • Grafica di base

    Solved graphics
    6
    0 Votes
    6 Posts
    3k Views
    B
    @VRonin said in Grafica di base: In realta' usando QML puoi andare oltre QGraphicView/Scene, viene spiegato in questo blog: http://blog.qt.io/blog/2017/01/19/should-you-be-using-qgraphicsview/ Grazie per la risposta. E' bastato approfondire il link per capire tutte le potenzialità, veramente notevoli. Saluti
  • QProcess cmd & tptf

    Unsolved
    4
    0 Votes
    4 Posts
    983 Views
    mrdebugM
    Ciao, non usare waitForFinished(). Ti consiglio di implementare gli sots void finished(int exitCode, QProcess::ExitStatus exitStatus); void readyReadStandardError(); void readyReadStandardOutput(); vedrai che poi ti funziona.
  • IDE di Qt creator

    Unsolved
    3
    0 Votes
    3 Posts
    996 Views
    P
    @VRonin Grazie
  • Nuovo del forum

    Unsolved
    1
    0 Votes
    1 Posts
    473 Views
    No one has replied