Results 1 to 10 of 10

Thread: QMAKE_INFO_PLIST undocumented function

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QMAKE_INFO_PLIST undocumented function

    To open documents on window i can catch on main arguments to open file.. this is ok...
    And to set other extension to the new application i use the installer and if i click the document is open ok. super!

    Now on mac after qt4 to drag document to the dock or open by normal click on finder the operation is more complicated....
    On qt3 i found a sample hot to drag file on dock.. this link
    http://doc.trolltech.com/qq/qq12-mac-events.html this method not run on qt4

    on mac to associate my new doc type *.sdat i found on google this way:

    on pro file i insert an other info.plist xml file to bring icon to new file type and to open application on finder by click the file.... this run ... the app start but a empty file is here.. and main arguments not work!

    to find this Hack .. i open http://www.google.com/codesearch and i search QMAKE_INFO_PLIST && macEventFilter ... assistant not say nothing about this ...

    QMAKE_INFO_PLIST = resource/mac_qedit.plist

    <plist version="1.0">
    <dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>English</string>
    <key>CFBundleDocumentTypes</key>
    <array>
    <dict>
    <key>CFBundleTypeExtensions</key>
    <array>
    <string>sdat</string>
    </array>
    <key>CFBundleTypeIconFile</key>
    <string>mac_QeditIcon.icns</string>
    <key>CFBundleTypeMIMETypes</key>
    <array>
    <string>text/plain</string>
    <string>text/plain utf-8</string>
    </array>
    <key>CFBundleTypeName</key>
    <string>Text File</string>
    <key>CFBundleTypeRole</key>
    <string>Editor</string>
    <key>LSIsAppleDefaultForType</key>
    <true/>
    </dict>
    </array>

    After i search / grep the qt4 source QMAKE_INFO_PLIST and i find the designer... and his associate ui file ok... now how designer open this ui file by click on finder or drag to dock from finder?

    I found a designer server... , client ecc.. so much args...

    Qt Code:
    1. /*
    2. header...
    3. QDesigner::QDesigner(int &argc, char **argv)
    4.   : QApplication(argc, argv),
    5.   m_server(0),
    6.   m_client(0),
    7.   m_workbench(0), suppressNewFormShow(false)
    8. */
    9.  
    10.  
    11. QDesigner::QDesigner(int &argc, char **argv)
    12. : QApplication(argc, argv),
    13. m_server(0),
    14. m_client(0),
    15. m_workbench(0), suppressNewFormShow(false)
    16. {
    17. setOrganizationName(QLatin1String("Trolltech"));
    18. setApplicationName(QLatin1String("Designer"));
    19. QDesignerComponents::initializeResources();
    20.  
    21. #ifndef Q_WS_MAC
    22. setWindowIcon(QIcon(QLatin1String(":/trolltech/designer/images/designer.png")));
    23. #endif
    24.  
    25. initialize();
    26. }
    To copy to clipboard, switch view to plain text mode 


    But how designer open this ui file on MAC ? undocumented function?

    Must i write a server and a client to open a new document type?


    Or is here the event to open the file! and not QCoreApplication::.arguments();

    Qt Code:
    1. bool QDesigner::event(QEvent *ev)
    2. {
    3. bool eaten;
    4. switch (ev->type()) {
    5. case QEvent::FileOpen:
    6. // set it true first since, if it's a Qt 3 form, the messagebox from convert will fire the timer.
    7. suppressNewFormShow = true;
    8. if (!m_workbench->readInForm(static_cast<QFileOpenEvent *>(ev)->file()))
    9. suppressNewFormShow = false;
    10. eaten = true;
    11. break;
    12. case QEvent::Close: {
    13. QCloseEvent *closeEvent = static_cast<QCloseEvent *>(ev);
    14. closeEvent->setAccepted(m_workbench->handleClose());
    15. if (closeEvent->isAccepted()) {
    16. // We're going down, make sure that we don't get our settings saved twice.
    17. if (m_mainWindow)
    18. m_mainWindow->setSaveSettingsOnClose(false);
    19. eaten = QApplication::event(ev);
    20. }
    21. eaten = true;
    22. break;
    23. }
    24. default:
    25. eaten = QApplication::event(ev);
    26. break;
    27. }
    28. return eaten;
    29. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by patrik08; 3rd June 2007 at 11:09.

Similar Threads

  1. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  2. Link Errors
    By magikalpnoi in forum Qt Programming
    Replies: 5
    Last Post: 25th September 2006, 22:04
  3. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52
  4. Qt 4.1.4 plugin QPSQL
    By jcr in forum Installation and Deployment
    Replies: 4
    Last Post: 22nd June 2006, 22:55
  5. I got two problems when I used static compiled library of QT4
    By qintm in forum Installation and Deployment
    Replies: 8
    Last Post: 20th April 2006, 08:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.