Skip to content
QtWS25 Last Chance
  • 144k Topics
    718k Posts
    K

    If you want to keep your current logic, you’ll need to add a blocking call like responder.socket()->waitForBytesWritten(-1); right after writeChunk.
    However, I think that's not a very good idea.

    A better way would be to open the file and use the QTcpSocket::bytesWritten event to send data chunk by chunk to the client. It would look something like this:

    QTcpSocket *socket = responder.socket(); QObject::connect(socket, &QTcpSocket::bytesWritten, socket, [socket, file, responder = std::move(responder)]() mutable { if (file->atEnd()) { responder.done(); file->deleteLater(); return; } QByteArray chunk = file->read(1024); socket->write(chunk); }); // Send the first chunk right away QByteArray chunk = file->read(1024); socket->write(chunk);

    This way, you avoid blocking the event loop and can handle multiple clients much more efficiently.

  • Jobs, project showcases, announcements - anything that isn't directly development
    4k Topics
    23k Posts
    Pl45m4P

    @berry36

    Don't worry too much.
    Toxic and now banned ex-user (= threadstarter) getting her own medicine ;-)

    The original post was edited multiple times... so her initial message was something completely different that got replaced by her with some random question afterwards

  • Everything related to designing and design tools

    125 Topics
    376 Posts
    M

    The Blend effect in QtGraphicalEffects was removed in Qt6, so how can I choose a blend mode for texture images?

  • Everything related to the QA Tools

    72 Topics
    204 Posts
    U

    @jagadish Thank you

  • Everything related to learning Qt.

    376 Topics
    2k Posts
    Ash_QtA

    @NeilParker-Qt Hey Neil, Thank you for sharing your challenge from the Intro to QML course!

    I like the animation you added to bring up the additional details on the business card, and the icons add a lot to the design. The resizing whilst maintaining the aspect ratio was also a nice touch! Overall, with the headshot as the background, it looks like a very professional business card!

    I think some basic theming to the details button so the font and style match the rest of the design would finish off the application.

    Great job

  • 2k Topics
    13k Posts
    Christian EhrlicherC

    When you want to include some headers of a library you also must pass the include path to the compiler.
    If you use cmake, use target_include_directories() and add the desired include paths there. Later when you use this library (aka you link them with target_link_libraries()), cmake will automatically add the paths specified.

  • 4k Topics
    18k Posts
    M

    Yocto tabanlı bir proje var, raspberry'ye kolayca firmware derleyebilmek için:
    https://github.com/YoeDistro/yoe-distro.git

    Bu proje ile firmware derleyip, yocto ile oluşturduğum toolchain ile kullanabildim ben de Qt6'yı.

  • This is where all the posts related to the Qt web services go. Including severe sillyness.
    1k Topics
    10k Posts
    jsulmJ

    @exactchange
    First: stop insulting others! Read and follow https://forum.qt.io/topic/113070/qt-code-of-conduct Unless you want to be banned from here.
    Second: this is user forum, most people here are not from QtCompany and don't spam you - why are you insulting them?

    If you want to be constructive you should at least mention what kind of mails you get, so that somebody can figure out from where it is coming and how to stop it.