-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add lots of stupid code and subclassing QApplication just to support …
…file opening in PropellerIDE, because Mac.
- Loading branch information
Showing
6 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,5 @@ Makefile* | |
src/propelleride/propelleride | ||
src/terminal/propterm | ||
build/ | ||
|
||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "application.h" | ||
|
||
#include <QFileOpenEvent> | ||
#include <QDebug> | ||
|
||
Application::Application(int &argc, char **argv) : QApplication(argc,argv) | ||
{ | ||
} | ||
|
||
Application::~Application() | ||
{ | ||
} | ||
|
||
bool Application::event(QEvent *event) | ||
{ | ||
switch(event->type()) | ||
{ | ||
case QEvent::FileOpen: | ||
loadFile( ((QFileOpenEvent *)event)->file() ); | ||
emit fileOpened( ((QFileOpenEvent *)event)->file() ); | ||
return true; | ||
default: | ||
return QApplication::event(event); | ||
} | ||
} | ||
|
||
void Application::loadFile(const QString & filename) | ||
{ | ||
qDebug() << "File Name:" << filename; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#pragma once | ||
|
||
#include <QApplication> | ||
|
||
class Application : public QApplication | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
Application(int &argc, char** argv); | ||
~Application(); | ||
|
||
protected: | ||
bool event(QEvent *); | ||
|
||
private: | ||
void loadFile(const QString & filename); | ||
|
||
signals: | ||
void fileOpened(const QString & filename); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters