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 double clicked file to open App in Mac OS
Forum Updated to NodeBB v4.3 + New Features

Crash when double clicked file to open App in Mac OS

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 2 Posters 2.8k Views 1 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.
  • J Offline
    J Offline
    joeQ
    wrote on 2 Jun 2017, 05:46 last edited by joeQ 6 Feb 2017, 06:11
    #1

    I am true, i get into trouble which is same with this topix 5 years before.

    I just want to finish the function that user can double clicked file to open application. I searched the solution from internet. like

    stackoverflow
    QFileOpenEvent

    Every thing looks good, when i clicked qt debug button to run my demo, app startup. it is running well. I also drag one file to dropped on the Dock icon of the application. My app get the file path. I also use the mouse on file, right button, chose open, ok, also can get the file path. this, i tried double clicked file, it can also get file path.

    But,

    when i close the app. I tried double clicked file to startup app. It Crash. just like 5 years before.

    1. what i wrong? How to resolve it ?
    2. where is i can find QtSDK in Demos/4.7/browser? I had find Qt4.7 at here

    Just do it!

    J 1 Reply Last reply 2 Jun 2017, 06:11
    0
    • J joeQ
      2 Jun 2017, 05:46

      I am true, i get into trouble which is same with this topix 5 years before.

      I just want to finish the function that user can double clicked file to open application. I searched the solution from internet. like

      stackoverflow
      QFileOpenEvent

      Every thing looks good, when i clicked qt debug button to run my demo, app startup. it is running well. I also drag one file to dropped on the Dock icon of the application. My app get the file path. I also use the mouse on file, right button, chose open, ok, also can get the file path. this, i tried double clicked file, it can also get file path.

      But,

      when i close the app. I tried double clicked file to startup app. It Crash. just like 5 years before.

      1. what i wrong? How to resolve it ?
      2. where is i can find QtSDK in Demos/4.7/browser? I had find Qt4.7 at here
      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 2 Jun 2017, 06:11 last edited by jsulm 6 Feb 2017, 06:43
      #2

      @joeQ It is not clear to me: do you double click your executable to start your app?
      If so, then you need to deploy your app first to make this work. See here: http://doc.qt.io/qt-5/osx-deployment.html
      Your app is not starting outside of QtCreator because the OS cannot find needed libraries (QtCreator prepares the environment before starting an app, so it is working there).

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      J 2 Replies Last reply 2 Jun 2017, 06:16
      1
      • J jsulm
        2 Jun 2017, 06:11

        @joeQ It is not clear to me: do you double click your executable to start your app?
        If so, then you need to deploy your app first to make this work. See here: http://doc.qt.io/qt-5/osx-deployment.html
        Your app is not starting outside of QtCreator because the OS cannot find needed libraries (QtCreator prepares the environment before starting an app, so it is working there).

        J Offline
        J Offline
        joeQ
        wrote on 2 Jun 2017, 06:16 last edited by
        #3

        @jsulm double clicked specific extension file eg: *.pro , if you double clicked *.pro file, you can startup qtcreate app.

        I double clicked eg. a.abc file, to startup my app.

        Just do it!

        1 Reply Last reply
        0
        • J jsulm
          2 Jun 2017, 06:11

          @joeQ It is not clear to me: do you double click your executable to start your app?
          If so, then you need to deploy your app first to make this work. See here: http://doc.qt.io/qt-5/osx-deployment.html
          Your app is not starting outside of QtCreator because the OS cannot find needed libraries (QtCreator prepares the environment before starting an app, so it is working there).

          J Offline
          J Offline
          joeQ
          wrote on 2 Jun 2017, 06:18 last edited by
          #4

          @jsulm now i use the QFileOpenEvent in Mac OS. I writen code following the QFileOpenEvent help manual.

          Just do it!

          J 1 Reply Last reply 2 Jun 2017, 06:20
          0
          • J joeQ
            2 Jun 2017, 06:18

            @jsulm now i use the QFileOpenEvent in Mac OS. I writen code following the QFileOpenEvent help manual.

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 2 Jun 2017, 06:20 last edited by
            #5

            @joeQ Well, then you need to debug.
            You can for example add qDebug() logs in the code where you think it crashes to localize the exact position in your code.

            Why Qt 4.7?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            J 1 Reply Last reply 2 Jun 2017, 06:22
            0
            • J jsulm
              2 Jun 2017, 06:20

              @joeQ Well, then you need to debug.
              You can for example add qDebug() logs in the code where you think it crashes to localize the exact position in your code.

              Why Qt 4.7?

              J Offline
              J Offline
              joeQ
              wrote on 2 Jun 2017, 06:22 last edited by
              #6

              @jsulm I find one topix, he got the same problem like me. he said,QtSDK 4.7/Demos/browser has the some function. so i want to see the demo code.

              Just do it!

              J 1 Reply Last reply 2 Jun 2017, 06:23
              0
              • J joeQ
                2 Jun 2017, 06:22

                @jsulm I find one topix, he got the same problem like me. he said,QtSDK 4.7/Demos/browser has the some function. so i want to see the demo code.

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 2 Jun 2017, 06:23 last edited by
                #7

                @joeQ Why not debug your app to find out where it crashes?

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                J 2 Replies Last reply 2 Jun 2017, 06:38
                0
                • J jsulm
                  2 Jun 2017, 06:23

                  @joeQ Why not debug your app to find out where it crashes?

                  J Offline
                  J Offline
                  joeQ
                  wrote on 2 Jun 2017, 06:38 last edited by
                  #8

                  @jsulm Debug is well, not crash.

                  1. when i startup my app. then to double clicked *.abc file, my app can get the file path from QFileOpenEvent;

                  2. when i close my app. then to double clicked *.abc file, want to startup my app, just like *.pro srartup qtcreate. the mac os show crash infomation.

                  like the person's description 5 years before

                  this case, how to debug ? only print some info to txt file.

                  Just do it!

                  J 1 Reply Last reply 2 Jun 2017, 06:40
                  0
                  • J jsulm
                    2 Jun 2017, 06:23

                    @joeQ Why not debug your app to find out where it crashes?

                    J Offline
                    J Offline
                    joeQ
                    wrote on 2 Jun 2017, 06:40 last edited by
                    #9

                    @jsulm This is my Info.plist file

                    <?xml version="1.0" encoding="UTF-8"?>
                    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
                    <plist version="1.0">
                    <dict>
                            <key>CFBundleDocumentTypes</key>
                            <array>
                                    <dict>
                                            <key>CFBundleTypeExtensions</key>
                                            <array>
                                                    <string>abc</string>
                                            </array>
                                            <key>CFBundleTypeRole</key>
                                            <string>Editor</string>
                                    </dict>
                            </array>
                    	<key>NSPrincipalClass</key>
                    	<string>NSApplication</string>
                    	<key>CFBundleIconFile</key>
                    	<string></string>
                    	<key>CFBundlePackageType</key>
                    	<string>APPL</string>
                    	<key>CFBundleGetInfoString</key>
                    	<string>Created by Qt/QMake</string>
                    	<key>CFBundleSignature</key>
                    	<string>????</string>
                    	<key>CFBundleExecutable</key>
                    	<string>fileType</string>
                    	<key>CFBundleIdentifier</key>
                    	<string>ibigstone.fileType</string>
                    	<key>NOTE</key>
                    	<string>This file was generated by Qt/QMake.</string>
                    </dict>
                    </plist>
                    

                    Just do it!

                    1 Reply Last reply
                    0
                    • J joeQ
                      2 Jun 2017, 06:38

                      @jsulm Debug is well, not crash.

                      1. when i startup my app. then to double clicked *.abc file, my app can get the file path from QFileOpenEvent;

                      2. when i close my app. then to double clicked *.abc file, want to startup my app, just like *.pro srartup qtcreate. the mac os show crash infomation.

                      like the person's description 5 years before

                      this case, how to debug ? only print some info to txt file.

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 2 Jun 2017, 06:40 last edited by
                      #10

                      @joeQ How to debug? I already suggested how: add qDebug() logs in your code.
                      One question: does your app crash if you double click on its executable (or more generic question: does your app work outside of QtCreator?)?

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      J 1 Reply Last reply 2 Jun 2017, 07:24
                      0
                      • J jsulm
                        2 Jun 2017, 06:40

                        @joeQ How to debug? I already suggested how: add qDebug() logs in your code.
                        One question: does your app crash if you double click on its executable (or more generic question: does your app work outside of QtCreator?)?

                        J Offline
                        J Offline
                        joeQ
                        wrote on 2 Jun 2017, 07:24 last edited by
                        #11

                        @jsulm I think, I used wrong my Info.plist content.I am new bird for Mac OS, I don't know well about the info.plist. Ok, I wiil spend some time to get it well. Thank u very much.

                        oh, my app worked outsied of QtCreator. so I this case, i think use the write log file is the only way to debug app not the qDebug("----").

                        Just do it!

                        1 Reply Last reply
                        0

                        1/11

                        2 Jun 2017, 05:46

                        • Login

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