main.cpp 866 B

12345678910111213141516171819202122232425262728293031323334
  1. // Include dependencies
  2. #include <QApplication>
  3. #include <QSurfaceFormat>
  4. #include <QMessageBox>
  5. #ifdef INCLUDE_PLUGINS
  6. #include <QtPlugin>
  7. Q_IMPORT_PLUGIN (QXcbIntegrationPlugin);
  8. #endif
  9. // Include modules
  10. #include "MainWindow.hpp"
  11. #include "OpenScadRenderer.hpp"
  12. int main(int argc, char** argv) {
  13. QApplication application(argc, argv);
  14. if (!OpenScadRenderer::openScadAvailable()) {
  15. QMessageBox openScadErrorBox;
  16. openScadErrorBox.setText("Unable to find OpenSCAD! Either it is not installed or not in its default location. Exporting will be disabled.");
  17. openScadErrorBox.exec();
  18. }
  19. QSurfaceFormat format;
  20. format.setVersion(2, 1);
  21. format.setProfile(QSurfaceFormat::CompatibilityProfile);
  22. QSurfaceFormat::setDefaultFormat(format);
  23. MainWindow mainWindow;
  24. mainWindow.show();
  25. return(application.exec());
  26. }