themeutils.h 940 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (C) by Felix Weilbach <felix.weilbach@nextcloud.com>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but
  10. * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  12. * for more details.
  13. */
  14. #pragma once
  15. #include <QPaintDevice>
  16. #include <QTest>
  17. class FakePaintDevice : public QPaintDevice
  18. {
  19. public:
  20. FakePaintDevice();
  21. [[nodiscard]] QPaintEngine *paintEngine() const override;
  22. void setHidpi(bool value);
  23. protected:
  24. [[nodiscard]] int metric(QPaintDevice::PaintDeviceMetric metric) const override;
  25. private:
  26. bool _hidpi = false;
  27. };