Results 1 to 2 of 2

Thread: QFileOpenEvent on Gnome

  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 QFileOpenEvent on Gnome

    I find a way to open file, by drag file to application icon (or taskbar) on Mac is QFileOpenEvent ,
    is a long way see http://wiki.qtcentre.org/index.php?t...Mac_OSX_Finder
    but its can run.. file extension must having on xml plist,
    on window arguments list from int main(int argc, char *argv[]) .... can run.
    An now how i can drag file to apps icon to open on Gnome Linux?
    Is here other file event? Arguments list not respond.

    On Gnome i find only ChSciTE that i can drag file to icon to open.! is here other QT apps wo run by drag file to icon on Gnome?


    Qt Code:
    1. class AwesomeApplication : public QApplication
    2. {
    3. Q_OBJECT
    4. public:
    5. ...
    6. protected:
    7. bool event(QEvent *);
    8. ...
    9. private:
    10. void loadFile(const QString &fileName);
    11. };
    12.  
    13. bool AwesomeApplication::event(QEvent *event)
    14. {
    15. switch (event->type()) {
    16. case QEvent::FileOpen:
    17. loadFile(static_cast<QFileOpenEvent *>(
    18. event)->file());
    19. return true;
    20. default:
    21. return QApplication::event(event);
    22. }
    23. }
    To copy to clipboard, switch view to plain text mode 

    The problem file:
    https://wysiwyg-edit.svn.sourceforge...s/src/main.cpp

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QFileOpenEvent on Gnome

    FileOpen event is only accessible on MacOS. If you drop something on an application icon, the application should be ran and passed the file path as the parameter, provided that your system is configured properly. I don't know if that is the case on your system

Similar Threads

  1. availableGeometry() & Gnome
    By December in forum Qt Programming
    Replies: 0
    Last Post: 6th April 2007, 16:18
  2. Qt with Gnome ?
    By probine in forum Newbie
    Replies: 2
    Last Post: 4th November 2006, 14:37
  3. Gnome makes application crash
    By regix in forum Qt Programming
    Replies: 35
    Last Post: 18th August 2006, 19:44
  4. Dialog positioning in GNOME
    By simk in forum Qt Programming
    Replies: 2
    Last Post: 16th March 2006, 09:41
  5. QT and Gnome
    By ikaru in forum Newbie
    Replies: 1
    Last Post: 5th February 2006, 18:58

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.