Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.5KB

  1. /*
  2. * Carla Style, based on Qt5 fusion style
  3. * Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies)
  4. * Copyright (C) 2013-2022 Filipe Coelho <falktx@falktx.com>
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU Lesser General Public License for more details.
  14. *
  15. * For a full copy of the license see the doc/LGPL.txt file
  16. */
  17. #include "CarlaStylePlugin.hpp"
  18. #include "CarlaStyle.hpp"
  19. #ifdef CARLA_OS_WIN
  20. # if defined(__GNUC__) && __GNUC__ >= 8
  21. # pragma GCC diagnostic push
  22. # pragma GCC diagnostic ignored "-Wdeprecated-copy"
  23. # endif
  24. # include <QtWidgets/QApplication>
  25. # if defined(__GNUC__) && __GNUC__ >= 8
  26. # pragma GCC diagnostic pop
  27. # endif
  28. #endif
  29. CarlaStylePlugin::CarlaStylePlugin(QObject* parentObj)
  30. : QStylePlugin(parentObj) {}
  31. QStyle* CarlaStylePlugin::create(const QString& key)
  32. {
  33. return (key.toLower() == "carla") ? new CarlaStyle() : nullptr;
  34. }
  35. #if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
  36. QStringList CarlaStylePlugin::keys() const
  37. {
  38. return QStringList() << "Carla";
  39. }
  40. Q_EXPORT_PLUGIN2(Carla, CarlaStylePlugin)
  41. #endif
  42. #ifdef CARLA_OS_WIN
  43. CARLA_PLUGIN_EXPORT void set_qt_app_style()
  44. {
  45. qApp->setStyle(new CarlaStyle());
  46. }
  47. #endif