Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • 0 Votes
    4 Posts
    419 Views
    DonCoderD
    @DonCoder Its resolved, When it is editing mode, children() count is 1 and the Child is qwidgettextcontrol
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    29
    0 Votes
    29 Posts
    131 Views
  • This topic is deleted!

    Unsolved
    3
    0 Votes
    3 Posts
    13 Views
  • QMediaPlayer setPosition results in a position of 0

    Unsolved qmediaplayer stalledmedia macos multimedia
    5
    0 Votes
    5 Posts
    1k Views
    S
    @mzimmers Yes, I am sure that the url is pointing to the correct source. In fact what seems strange is that the first time I call setPosition it works, but any other time, regardless of the url being identical or changed to point to a different file, it ends up being in the StalledMedia state.
  • How to get depth of a glyph?

    Unsolved
    1
    0 Votes
    1 Posts
    194 Views
    No one has replied
  • multiple target patterns. Stop.

    Unsolved makefile makefile.debug mingw resource
    2
    0 Votes
    2 Posts
    600 Views
    jsulmJ
    @Leoo Please post your pro file (as text not pictures).
  • can not download Qt online installer

    Unsolved
    11
    0 Votes
    11 Posts
    2k Views
    JKSHJ
    @PolywickStudio said in can not download Qt online installer: Is there an updated mirror list, which have the full set of QT 6.4.2 or QT 5.15.2 files? The master.qt.io mirror should always be up-to-date. The other mirrors are based on that one. Suggestion. There should be verified mirror, which have the full set of files for installing. Can you please let us know which mirror(s) you've found to have incomplete files?
  • This topic is deleted!

    Unsolved
    11
    0 Votes
    11 Posts
    44 Views
  • Dates from MySql database dont show correctly on QTableView widget

    Solved
    13
    0 Votes
    13 Posts
    1k Views
    S
    @JonB Problem solved! You are very correct on my debugging today, my brain is slow today :( First I printed it before the 'if' condition. And it printed, that means it was entering displayText(). Then your second point was what the problem was, it was never receiving QVariant::DateTime but QVariant::Date. I changed that on my if condition and it solved it. I learned that just copy pasting from someone else's problem without tailoring it is not a good thing :) Thank you for your answer and patience @JonB .
  • loadFromModule: What exactly is the typename?

    Solved
    2
    0 Votes
    2 Posts
    698 Views
    A
    @Asperamanca Looks like typically, the Typename should be the QML filename without extension, regardless of folder structure.
  • Enums in Qt 6.2.* How?

    Solved
    2
    0 Votes
    2 Posts
    780 Views
    B
    Issue solved. Solution found in my own examples. Got everything forgotten about enums in Qt. There were everything wrong with naming of QML types and registering ... This example showing working example for Qt 6.2.8
  • How to Scan Ports with TCP Client ?

    Unsolved tcp scanner port
    2
    0 Votes
    2 Posts
    790 Views
    JonBJ
    @TokaraForest I don't see that it will make any difference whether you stick with asynchronous approach (which does not block) in UI thread or use synchronous approach with waitFor...() in a thread (which will block that thread but not the Ui thread). Either way scanning 100 ports will take some time because each port has to have time to timeout. It will be "slow". You might as well use asynchronous and not get involved with threads if this is what you have to do. But why do you want to scan ports, and at which side? Client should be able to be set to use any available port to connect to server (this is fast). And server needs to specify which port it will be listening on, there is no point it finding a free one as client will not know which one it picked to connect on.
  • Use QCamera and QCameraInfo to work with a frame grabber card and a camera link cam.

    Solved
    13
    0 Votes
    13 Posts
    1k Views
    S
    @aconsig A lot of time has passed since the thread has been posted, but regardless, here is my final solution. I ended up with using a QLabel that was refreshed with a specified frequency by a QTimer. The timeout signal triggered getting available frames stored in a buffer that I have created, then set a correct pixmap to that QLabel object. This solution was fast and flexible enough for me.
  • Why my program doesn't follow QNetworkRequest::NoLessSafeRedirectPolicy ?

    Solved
    3
    0 Votes
    3 Posts
    348 Views
    J
    @Paul-Colby : Thanks Modified to code (with the help of chatgpt) to handle redirection, here is the updated version: void HTTP::UploadFile(QString URL, QString PathToFile) { QFileInfo FilePath{PathToFile}; // Check to see if the file exists before uploading if (!FilePath.isFile()) { qDebug() << FilePath.fileName() << " doesn't exist"; return; } // Create the QHttpMultiPart for file upload QHttpMultiPart *multiPart = new QHttpMultiPart(QHttpMultiPart::FormDataType); // Create the QHttpPart for file data QHttpPart dataPart; dataPart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application")); dataPart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=file; filename=\"" + FilePath.fileName() + "\"")); QFile *file = new QFile(FilePath.absoluteFilePath()); file->open(QIODevice::ReadOnly); dataPart.setBodyDevice(file); file->setParent(multiPart); multiPart->append(dataPart); // Create the QNetworkRequest for uploading QNetworkRequest uploadRequest; uploadRequest.setUrl(QUrl(URL)); // Perform a HEAD request to check for redirection uploadRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, false); QNetworkReply *headReply = UploadManager.head(uploadRequest); connect(headReply, &QNetworkReply::finished, [this, headReply, URL, multiPart, uploadRequest]() { QVariant redirectUrl = headReply->attribute(QNetworkRequest::RedirectionTargetAttribute); if (redirectUrl.isValid()) { // Redirection is implemented qDebug() << "Server has implemented redirection. Redirect URL: " << redirectUrl.toUrl(); // Clean up the reply headReply->deleteLater(); // Post the request to the redirected URL QNetworkRequest redirectRequest(redirectUrl.toUrl()); QNetworkReply *redirectReply = UploadManager.post(redirectRequest, multiPart); multiPart->setParent(redirectReply); } else { // No redirection, proceed with the POST request QNetworkReply *reply = UploadManager.post(uploadRequest, multiPart); multiPart->setParent(reply); } }); } Works as expected.
  • Grouping drawtext() or changing them to path to group them

    Solved
    5
    0 Votes
    5 Posts
    431 Views
    GilboonetG
    With mapping from a QTransform object I managed to group those text paths. if (doSVG) { QPainterPath pp; pp.addText(- ti->boundingRect().width()/2, -2, fNum, QString::number(n)); QTransform tr; QPointF pt = c.toPointF()+ b.toPointF() +tit->pos(); tr.translate(pt.x(), pt.y()); tr.rotate(radToDeg(ra)); tPath.addPath(tr.map(pp)); }
  • The application is running in the background but the screen does not appear

    Solved
    27
    0 Votes
    27 Posts
    7k Views
    serkan_trS
    @SimonSchroeder yes, all versions are the same on both computers. i guess i solved the problem
  • QOpcUa crashes when remote device goes offline during read

    Unsolved
    1
    0 Votes
    1 Posts
    150 Views
    No one has replied
  • Uuencoding in Qt. How?

    Unsolved
    6
    0 Votes
    6 Posts
    600 Views
    JonBJ
    @bogong I think https://github.com/Ladvien/Instructables_UUE_function/blob/master/Instructables_UUEncoding_function_0.c is supposed to be UUEncode in C, ~100 lines.
  • Adding QButtons to a QTableWidget Header

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