Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • 0 Votes
    12 Posts
    2k Views
    J
    @JonB That especific array allows me to read info coming from an arduino connected to my raspberry in where I'm doing all of this so the arduino sents me the dintance from a second sensor it is Just a number for example 11 or 113 or 5 is similar to What I'm trying to do with the ESP8266 but via wifi. The arduino part is always woking no matter how much time I have the gui running so I kinda figured out my mistake must be in the way I get the value from the hmtl page wich brings me to the QNetworkAccessManager.
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    28 Views
  • How to use asan with qt creator 5.0.3 ?

    Solved
    10
    0 Votes
    10 Posts
    3k Views
    SGaistS
    You are using a Kit to build your application. The kit is associated with a Qt version.
  • creating a qHash function for QPointF

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    Christian EhrlicherC
    I see that qHash(QPointF) was explictily deleted in with this commit: https://codereview.qt-project.org/c/qt/qtbase/+/336743 and I agree with this decision. The compiler also tells you about this. But std::hash overload still works (but has the same flaw as qHash): #include <QHash> #include <QPointF> namespace std { template <> struct hash<QPointF> { // seed is optional size_t operator()(const QPointF &key, size_t seed) const {return qHashMulti(seed, key.x(), key.y());} }; } int main(int argc, char *argv[]) { QHash<QPointF,int> pointControlsHashTable; pointControlsHashTable[QPointF(0,0)] = 25; return 0; }
  • Using ffmpeg and Qt

    Unsolved
    7
    0 Votes
    7 Posts
    3k Views
    JoeCFDJ
    @Saviz gstreamer is another option for multimedia if you use qml to make GUI. You do not need qprocess to run it.
  • Why there isn't QHttpServerRequest copy constructor?

    Unsolved
    5
    0 Votes
    5 Posts
    422 Views
    I
    Hi Like this you can skip the helper/workaround function: server.route("/r2", [] (const QHttpServerRequest & request) { QFuture<QHttpServerResponse> future = QtConcurrent::run([&request] () { QString response = QString("Hello to ip address: %1\n").arg(request.remoteAddress().toString()); return QHttpServerResponse(response, QHttpServerResponder::StatusCode::Ok); }); return future; });
  • #include <QtGui>

    Unsolved
    5
    0 Votes
    5 Posts
    326 Views
    mrjjM
    @Perdrix But you will need the includes anyway? You could just make your own master includes, having what you commonly uses but make sure you are not then in some places including more than you need as then it begins to become counter productive.
  • How to connect to a QWebSocketServer from the same device running it?

    Unsolved
    2
    0 Votes
    2 Posts
    369 Views
    J
    @BensonBear said in How to connect to a QWebSocketServer from the same device running it?: People may say this is wrong, but I want to make a program for personal use on pcs and android devices that renders its user interface in a browser, and gets the data to and from the interface via websockets from a server running on the same system (nothing is going over the internet). To test how this could work, I started out using the "simplechat" example that comes with qt 5.15.x. It works fine when the server and the browser are both on a pc (linux or windows), and also when either the server or the browser is on a pc, and the other is on an android device.. The only time it does not work is when the server and the browser are both on an android device (whether or not they are both on one and the same android device). Surely this can be made to work? Perhaps some extra (lax) permissions have to be granted in the android manifest? Or perhaps the page that sets up the websocket connection has to be from the same ip as the websocket server (which it is not at current since I don't have the minimal webserver required on the android and am loading that page from my desktop computer)? But that does not seem to be necessary in any of the other cases; for example, when my linux desktop successfully connects to the android web server, the page that sets it up is on one local network address and the server itself is on another. ETA: It is not a matter of cross origin issues I think. Since I don't have a web server on the android yet, I tried for long time to just load the html file as a local file, but could not figure that out in a few hours just as apparently others have not been able to. Then I found a little web server on google play and installed it, and could serve up the html file. However, even with this file on the same domain as the QWebSocketServer, the android could not connect to it. This is looking really bad, I hope someone has an easy solution. have you fix this? i have the same issue in QWebsocketserver
  • 0 Votes
    25 Posts
    18k Views
    R
    @Pl45m4 i installed it from the official website , idk if the openssl is installed or not tbh . can you teach me how to install it ?
  • Styling of QComboBox Arrow

    Solved
    4
    0 Votes
    4 Posts
    7k Views
    Pl45m4P
    @sp3x said in Styling of QComboBox Arrow: where can I get further infos about QComboBox::drop-down:button? Here https://doc.qt.io/qt-6/stylesheet-examples.html#customizing-qcombobox In general, the standard CSS syntax is used (for colors, keywords like background and so on).
  • Appropriate places to connect button to slots

    Unsolved
    4
    0 Votes
    4 Posts
    263 Views
    Christian EhrlicherC
    @slava_xd said in Appropriate places to connect button to slots: how do i use the new syntax if I created all the buttons with the designer ? Click on my link. I don't see any relation on where you created the widgets though.
  • Knowing when QFile::write() finished?

    Solved
    3
    0 Votes
    3 Posts
    188 Views
    C
    @Christian-Ehrlicher So should I manually close the file?
  • What objects to use to make a timeline editor

    Unsolved
    4
    1 Votes
    4 Posts
    677 Views
    SGaistS
    Depending on what you want to paint, you can use overlays. As for going with QLabels for everything, you would quickly get a number of widgets to would be impractical and in the end, rewrite some sort of graphics view. You could also just paint everything by hand but that would likely be overkill. I would recommend checking the various examples in Qt's documentation as well.
  • How to calculate positions in a QGridLayout?

    Unsolved
    8
    0 Votes
    8 Posts
    675 Views
    SGaistS
    Hi, Did you already took a look at the Flow Layout Example ? It might also be of interest for what you want to do.
  • Can anybody explain below statment ?

    Unsolved
    14
    0 Votes
    14 Posts
    810 Views
    Q
    @JonB Sorry i forgot to mention that i am showing 96 sensor data, means that data is 72000 * 96. i am showing multi graph. so at a time need is 4 sensor data. so it is 72000 * 4. And our crash line is switch(*errorcode)
  • Writing to json file, output wrong!

    Solved
    5
    0 Votes
    5 Posts
    364 Views
    K
    i fixed it by myself QJsonParseError error; QJsonDocument inputJsonDoc = QJsonDocument::fromJson(file.readAll(), &error); QJsonObject top = inputJsonDoc.object(); QJsonArray patt = top.value( "Pattern" ).toArray(); for (const auto& pattern : patterns) { QJsonObject patternObject; patternObject.insert("id", pattern.id); patternObject.insert("type", pattern.type); patternObject.insert("name", pattern.name); patternObject.insert("image", pattern.image); patternObject.insert("tooltip", pattern.tooltip); patt.append(patternObject); } top.insert("Pattern", patt); QJsonDocument outputJsonDoc( top ); file.write(outputJsonDoc.toJson()); file.close(); }
  • Get live output (and state) out of QProcess

    Solved
    10
    0 Votes
    10 Posts
    603 Views
    S
    I managed to get it working. This is how I did it: download.h #ifndef DOWNLOAD_H #define DOWNLOAD_H #include <QObject> #include <QProcess> #include <QDebug> class download : public QObject { Q_OBJECT public: download(); void Main(); public slots: void start(); void stop(int, QProcess::ExitStatus); void getOutput(); private: QProcess process; }; #endif // DOWNLOAD_H download.cpp #include "download.h" download::download() { QObject::connect(&process, SIGNAL(started()), this, SLOT(start())); QObject::connect(&process, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(stop(int, QProcess::ExitStatus))); QObject::connect(&process, SIGNAL(readyReadStandardOutput()), this, SLOT(getOutput())); } void download::start() { qDebug() << "started"; } void download::stop(int, QProcess::ExitStatus) { qDebug() << "stopped"; } void download::getOutput() { qDebug() << process.readAll(); } void download::Main() { process.start("curl", QStringList() << "url"); process.waitForStarted(); }
  • How did this widget is made?

    Solved
    2
    0 Votes
    2 Posts
    178 Views
    mrjjM
    @adonezid Hi and welcome to the forums It looks like a TableWidget/View with one or more delegates. https://doc.qt.io/qt-6/qtableview.html https://doc.qt.io/qt-6/qitemdelegate.html example https://doc.qt.io/qt-6/qtwidgets-itemviews-stardelegate-example.html
  • This topic is deleted!

    Unsolved
    13
    0 Votes
    13 Posts
    39 Views
  • Need partner in cpp and qt project

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