Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. crash when attempting drag on macOS with Qt6
Qt 6.11 is out! See what's new in the release blog

crash when attempting drag on macOS with Qt6

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 2 Posters 691 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gvanvoor
    wrote on last edited by
    #1

    I'm not sure if this should go here or in the Qt6 category, but here goes...

    I have a rather strange problem where Qt6 crashes when (a.o.) a drag is initiated on macOS. Although this is systematically reproducible in debug in the full application I'm working on, the problem doesn't occur in a release version, nor in a minimal application built in the same source tree with the same Qt binaries. The minimal application obviously links with less other (static and shared) libraries than the full application).

    I was able to track the origin of the crash: when Qt initiates a drag, it creates an image for the OS to show. In Qt6 this is done by the extension of NSImage with a category QtExtras that contains a.o. method imageFromQImage. In my case, the method imageFromQImage is not present in NSImage at the critical moment as shown by

    [ NSImage respondsToSelector: @selector(imageFromQImage)]
    

    which returns NO, resulting in a nil return value.
    As I'm unfamiliar with the category loading mechanism, I was hoping someone would be able to shed some light as how I may find what's causing this strange behaviour.
    As the category is declared in a private header of Qt, I can't just include that to try and remedy it.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Beside build Qt yourself it's going to be hard to debug.

      Is your application something closed ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      G 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Beside build Qt yourself it's going to be hard to debug.

        Is your application something closed ?

        G Offline
        G Offline
        gvanvoor
        wrote on last edited by
        #3

        @SGaist If your question is "is this commercial software" then the answer is yes.
        I did some more experimenting and I think I may have found a possible cause. One of the libraries we use is a binary from another company. They also use Qt, but for obvious reasons they link statically with it. I have the impression that the extension provided by the Qt they use is somehow interfering with the one "our" Qt creates.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Are they using Qt 5 ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          G 1 Reply Last reply
          0
          • SGaistS SGaist

            Are they using Qt 5 ?

            G Offline
            G Offline
            gvanvoor
            wrote on last edited by
            #5

            @SGaist said in crash when attempting drag on macOS with Qt6:

            Are they using Qt 5 ?

            They provided us with a new version that runs natively on Apple Silicon, so I'm assuming the Qt in there is either 5.15 or 6.0.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              That's something you should check. Mixing two different major versions of Qt is unlikely to work well and in your case they might be from different architectures.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              G 1 Reply Last reply
              0
              • SGaistS SGaist

                That's something you should check. Mixing two different major versions of Qt is unlikely to work well and in your case they might be from different architectures.

                G Offline
                G Offline
                gvanvoor
                wrote on last edited by gvanvoor
                #7

                @SGaist As the Qt in that library is linked statically and its symbols aren't exported that shouldn't be a problem. That library links Qt statically precisely to avoid having to keep Qt versions in sync between the two companies.

                This hasn't posed problems in the past BTW.

                Not sure what you mean with different architectures. That library is now a universal library.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  But weren't you using the same major version of Qt even if not in sync ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved