Skip to content
QtWS25 Call for Papers
  • 0 Votes
    5 Posts
    894 Views
    JonBJ

    @BigBen
    The ui_....h files should never have got into the source directory in the first place. You will encounter the problem you did if they do.

  • 0 Votes
    25 Posts
    3k Views
    KH-219DesignK

    @SpaceToon said in Unknown Exception is not beeing caught in trycatch-Block (Bluetooth Low Energy, ServiceDetailsDiscovery):

    @KH-219Design : Thank you very much for your suggestion, for using the lowenergy example from Qt. I did this and the same error occurs there! For this reason, I copied the following code from there and paste it in my .cpp file

    @SpaceToon I'm truly happy to hear you are able to make forward progress on this!

    This year marks the first year that I have ventured into BLE using Qt, and I have hit some minor hiccups myself. That is why your post caught my attention in the first place. However, I am working on Android and you are on Windows, which have very different backend/underlying BLE system stacks. So based on the difference in operating systems, I was doubtful if anything I learned would really translate directly here.

    Your watershed moment about QLowEnergyController::Error prompted me to go look at my code again to see what I am doing in case of QLowEnergyController::Error. I noticed that in my slot I have this comment:

    // The Qt API for QLowEnergyController has some confusing // overlap/ambiguity. When we get "ConnectionError" I would EXPECT that // the signal QLowEnergyController::disconnected would also be // forthcoming. But it seems (by observation) that this is not how it // works. So we have to treat BOTH the disconnected signal and the // error signal as signs of a disconnection.

    ... so maybe you and I did actually run into a very similar pitfall after all!

    It would be great to know if there is some null-reference bug in Qt BLE itself, but neither you nor I may have time to investigate that further. Since we both seem to have worked around our respective pain points, may we carry on and each deliver a successful project!

    You also asked:

    Did you compile Qt for debug, and can the debugger see/know the location of the corresponding Qt source files?

    Which is a very useful tactic, which I have done many times on Linux Qt.

    I just read some of this: https://stackoverflow.com/questions/5571098/how-can-i-make-msvc-debugger-step-into-qt-library-source-code-again/5576414

    Which refers to compiling the QtCored5.dll DLL(s) for oneself. (This is essentially analogous to how I do it on Linux, but building Qt from source is usually several hours of effort on the first time... and I'm not talking about the additional potential hours of just letting the compiler run!)

    Maybe someone else in this thread has had personal experience with debugging into Qt source files on Microsoft Windows. Or maybe that could be a new thread!

  • 0 Votes
    13 Posts
    1k Views
    E

    @mrjj Thanks for posting that exact screenshot; it made me try switching to the 5.12.0 install I still had (since I saw your file path wasn't 5.12.1), and that in turn led to me noticing 5.13.0 is out now too.

    This turned out to be specific to 5.12.1 (and maybe further specific to msvc2017_64, not sure).

    No more crashing in any of my different test cases or my original app now, without changing anything in my code. I feel pretty silly for spending so much time coming up with a lot of different attempts to fix my code over the past few days, but I did learn a few new things about Qt at least.

  • 0 Votes
    9 Posts
    3k Views
    S

    @JonB I think i won't be able to understand something more detailled and that answer the whole questions =)

    Thanks a lot, you ma real expert ! ;D

  • 0 Votes
    14 Posts
    4k Views
    K

    @VRonin I don't doubt that Visual Studio can do this, my poins are

    qmake doesn't have native way to set source-specific flags, you need to create your own custom target with all gory details of building C++ file, so it's much easier to move it into library I don't know if mixing EH flags in the same binary is reliable with MSVC