Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef MYAPPLICATION_H
- #define MYAPPLICATION_H
- #include <QApplication>
- #include <QFileOpenEvent>
- #include <QEvent>
- #include <QDebug>
- class MyApplication : public QApplication
- {
- Q_OBJECT
- public:
- MyApplication(int& argc, char **argv) : QApplication(argc, argv)
- {}
- protected:
- bool event(QEvent* event)
- {
- if (event->type() == QEvent::FileOpen)
- {
- QString url = static_cast<QFileOpenEvent*>(event)->url().toString();
- url.replace("tiplanet://", "");
- QStringList pieces = url.split("/");
- qDebug() << "split: " << pieces << endl;
- return true;
- }
- return QApplication::event(event);
- }
- };
- #endif // MYAPPLICATION_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement