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. How create a Mac document_based app use qt on Mac?
Forum Updated to NodeBB v4.3 + New Features

How create a Mac document_based app use qt on Mac?

Scheduled Pinned Locked Moved Unsolved General and Desktop
12 Posts 3 Posters 2.4k 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.
  • P Offline
    P Offline
    Princein
    wrote on last edited by
    #1

    I want develop a mac document-based App use Qt on mac which just like this : https://developer.apple.com/library/archive/documentation/DataManagement/Conceptual/DocBasedAppProgrammingGuideForOSX/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011179-CH1-SW1

    Is there any documentation in qt for reference?if it has,please give some links,thanks a lot!

    aha_1980A M 2 Replies Last reply
    0
    • P Princein

      I want develop a mac document-based App use Qt on mac which just like this : https://developer.apple.com/library/archive/documentation/DataManagement/Conceptual/DocBasedAppProgrammingGuideForOSX/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011179-CH1-SW1

      Is there any documentation in qt for reference?if it has,please give some links,thanks a lot!

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi @Princein,

      Instead Model-View-Controller, Qt uses a Model-View-Delegate approach: http://doc.qt.io/qt-5/model-view-programming.html

      But yes, you can develop this kind of apps with Qt, even if the concept is a bit different.

      Qt has to stay free or it will die.

      1 Reply Last reply
      2
      • P Princein

        I want develop a mac document-based App use Qt on mac which just like this : https://developer.apple.com/library/archive/documentation/DataManagement/Conceptual/DocBasedAppProgrammingGuideForOSX/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011179-CH1-SW1

        Is there any documentation in qt for reference?if it has,please give some links,thanks a lot!

        M Offline
        M Offline
        mpergand
        wrote on last edited by
        #3

        @Princein
        Hi,

        There was a topic on MVC paradigm some time ago on this forum.
        The result was that MVC is inapropriate in Qt since it was not design to use it.
        The first thing you do in Qt is to subclass top level widgets (window/dialog) hence this top level widgets become 'de facto' a Controller object.

        As a mac user, the first time i'm looking to Qt, I realized there's a lot of things missing. So I passed a few months trying to add this missing features, in particular a sort of Document Architecture like you have on Cocoa.

        Here a list of what I added:

        • a notification center (NSNotificationCenter)
        • a standard message error system (NSAlert, NSError)
        • a responder chain ( for menu management)
        • a document based like system (NSDocument)
        • many others facilities about Prefs Dialog, Standard Menu management (recent open docs, open window list) etc ...

        I can provide you a complete example if you like.

        P 2 Replies Last reply
        2
        • M mpergand

          @Princein
          Hi,

          There was a topic on MVC paradigm some time ago on this forum.
          The result was that MVC is inapropriate in Qt since it was not design to use it.
          The first thing you do in Qt is to subclass top level widgets (window/dialog) hence this top level widgets become 'de facto' a Controller object.

          As a mac user, the first time i'm looking to Qt, I realized there's a lot of things missing. So I passed a few months trying to add this missing features, in particular a sort of Document Architecture like you have on Cocoa.

          Here a list of what I added:

          • a notification center (NSNotificationCenter)
          • a standard message error system (NSAlert, NSError)
          • a responder chain ( for menu management)
          • a document based like system (NSDocument)
          • many others facilities about Prefs Dialog, Standard Menu management (recent open docs, open window list) etc ...

          I can provide you a complete example if you like.

          P Offline
          P Offline
          Princein
          wrote on last edited by
          #4

          @mpergand said in How create a Mac document_based app use qt on Mac?:

          ide you a complete example if yo

          yes,thanks for your reply,you're a nice man!

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mpergand
            wrote on last edited by
            #5

            Need a few days to provide a clean project and to add some english texts
            (for now the comments are in french :) )
            Stay tuned ...

            1 Reply Last reply
            0
            • M mpergand

              @Princein
              Hi,

              There was a topic on MVC paradigm some time ago on this forum.
              The result was that MVC is inapropriate in Qt since it was not design to use it.
              The first thing you do in Qt is to subclass top level widgets (window/dialog) hence this top level widgets become 'de facto' a Controller object.

              As a mac user, the first time i'm looking to Qt, I realized there's a lot of things missing. So I passed a few months trying to add this missing features, in particular a sort of Document Architecture like you have on Cocoa.

              Here a list of what I added:

              • a notification center (NSNotificationCenter)
              • a standard message error system (NSAlert, NSError)
              • a responder chain ( for menu management)
              • a document based like system (NSDocument)
              • many others facilities about Prefs Dialog, Standard Menu management (recent open docs, open window list) etc ...

              I can provide you a complete example if you like.

              P Offline
              P Offline
              Princein
              wrote on last edited by
              #6

              @mpergand
              Yes, I need your example, can you give me, thanks a lot!

              M 1 Reply Last reply
              0
              • P Princein

                @mpergand
                Yes, I need your example, can you give me, thanks a lot!

                M Offline
                M Offline
                mpergand
                wrote on last edited by mpergand
                #7

                @Princein
                @legitnameyo
                Here it is:
                MultiDocsDemo.zip
                Tested on :
                MacOS 10.9.5 Qt 5.6.1
                Linux Mate 18.04 Qt 5.11.2
                Windows: not tested, hope it works :)

                There is a 'Read me' file for a few explanations.
                The folder 'Test Files' contains some file types you can load with File->open menu item or on Mac by dragging it to the app icon in the dock or in the Finder.

                Note that i don't pretend my code is suitable to anybody or it's even good programming whatsoever.
                It's just my attempt to add some fonctionalities that I think any modern app should have. All this fonctionalities are grouped in the 'Qt Sources' folder, it's enough to add it to any new project to get these goodies at once, easy !

                P 1 Reply Last reply
                3
                • M mpergand

                  @Princein
                  @legitnameyo
                  Here it is:
                  MultiDocsDemo.zip
                  Tested on :
                  MacOS 10.9.5 Qt 5.6.1
                  Linux Mate 18.04 Qt 5.11.2
                  Windows: not tested, hope it works :)

                  There is a 'Read me' file for a few explanations.
                  The folder 'Test Files' contains some file types you can load with File->open menu item or on Mac by dragging it to the app icon in the dock or in the Finder.

                  Note that i don't pretend my code is suitable to anybody or it's even good programming whatsoever.
                  It's just my attempt to add some fonctionalities that I think any modern app should have. All this fonctionalities are grouped in the 'Qt Sources' folder, it's enough to add it to any new project to get these goodies at once, easy !

                  P Offline
                  P Offline
                  Princein
                  wrote on last edited by
                  #8

                  @mpergand
                  Yes, you are so nice a man! can I make friend with you?
                  here is my Facebook account:
                  'Lee Yubin' ,please add me!
                  Thanks a lot!

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    mpergand
                    wrote on last edited by
                    #9

                    The program won't compile on Windows because of that:
                    #include <utime.h>
                    You can get ride of this line as well as the method :
                    bool FilePath::touch(QString &path)

                    On Linux there are a bunch of misleading indentation warnings from GCC6.
                    Someone knows how to disable this in the compiler ?

                    @Princein
                    I don't have any Facebook account, sorry

                    P aha_1980A 2 Replies Last reply
                    0
                    • M mpergand

                      The program won't compile on Windows because of that:
                      #include <utime.h>
                      You can get ride of this line as well as the method :
                      bool FilePath::touch(QString &path)

                      On Linux there are a bunch of misleading indentation warnings from GCC6.
                      Someone knows how to disable this in the compiler ?

                      @Princein
                      I don't have any Facebook account, sorry

                      P Offline
                      P Offline
                      Princein
                      wrote on last edited by
                      #10

                      @mpergand
                      Do you have other social accounts?
                      thanks, we can exchange development technology.

                      M 1 Reply Last reply
                      0
                      • P Princein

                        @mpergand
                        Do you have other social accounts?
                        thanks, we can exchange development technology.

                        M Offline
                        M Offline
                        mpergand
                        wrote on last edited by
                        #11

                        @Princein said in How create a Mac document_based app use qt on Mac?:

                        Do you have other social accounts?

                        mpergand on gmail

                        Or by chat on this same forum.

                        1 Reply Last reply
                        0
                        • M mpergand

                          The program won't compile on Windows because of that:
                          #include <utime.h>
                          You can get ride of this line as well as the method :
                          bool FilePath::touch(QString &path)

                          On Linux there are a bunch of misleading indentation warnings from GCC6.
                          Someone knows how to disable this in the compiler ?

                          @Princein
                          I don't have any Facebook account, sorry

                          aha_1980A Offline
                          aha_1980A Offline
                          aha_1980
                          Lifetime Qt Champion
                          wrote on last edited by aha_1980
                          #12

                          @mpergand

                          On Linux there are a bunch of misleading indentation warnings from GCC6.
                          Someone knows how to disable this in the compiler ?

                          Usually, its -Wno-<name-of-warning>.

                          BUT you should really take them honestly and fix them.

                          It can help you to detect wrong code, like the famous Apple SSL bug for free!

                          Edit: Your source code is a mix of TAB and SPACE based indentation, that's why the compiler complains. You should reformat the source to use one style and stick to it.

                          Qt has to stay free or it will die.

                          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