Compare commits
No commits in common. "master" and "v0.9.1" have entirely different histories.
3 changed files with 1 additions and 24 deletions
|
@ -8,9 +8,6 @@ App::App(int argc, char *argv[]) :
|
||||||
QApplication(argc, argv), window(new Window())
|
QApplication(argc, argv), window(new Window())
|
||||||
{
|
{
|
||||||
window->show();
|
window->show();
|
||||||
if (argc > 1)
|
|
||||||
window->load_stl(argv[1]);
|
|
||||||
else
|
|
||||||
window->load_stl(":gl/sphere.stl");
|
window->load_stl(":gl/sphere.stl");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ Window::Window(QWidget *parent) :
|
||||||
|
|
||||||
{
|
{
|
||||||
setWindowTitle("fstl");
|
setWindowTitle("fstl");
|
||||||
setAcceptDrops(true);
|
|
||||||
|
|
||||||
QFile styleFile(":/qt/style.qss");
|
QFile styleFile(":/qt/style.qss");
|
||||||
styleFile.open( QFile::ReadOnly );
|
styleFile.open( QFile::ReadOnly );
|
||||||
|
@ -129,18 +128,3 @@ bool Window::load_stl(const QString& filename)
|
||||||
loader->start();
|
loader->start();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::dragEnterEvent(QDragEnterEvent *event)
|
|
||||||
{
|
|
||||||
if (event->mimeData()->hasUrls())
|
|
||||||
{
|
|
||||||
auto urls = event->mimeData()->urls();
|
|
||||||
if (urls.size() == 1 && urls.front().path().endsWith(".stl"))
|
|
||||||
event->acceptProposedAction();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Window::dropEvent(QDropEvent *event)
|
|
||||||
{
|
|
||||||
load_stl(event->mimeData()->urls().front().toLocalFile());
|
|
||||||
}
|
|
||||||
|
|
|
@ -12,10 +12,6 @@ public:
|
||||||
explicit Window(QWidget* parent=0);
|
explicit Window(QWidget* parent=0);
|
||||||
bool load_stl(const QString& filename);
|
bool load_stl(const QString& filename);
|
||||||
|
|
||||||
protected:
|
|
||||||
void dragEnterEvent(QDragEnterEvent* event);
|
|
||||||
void dropEvent(QDropEvent* event);
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void on_open();
|
void on_open();
|
||||||
void on_about();
|
void on_about();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue