1
0
Files
sarasacw-picture/app/graphicsscene.h
yyc12345 46f46480cb feat: change application style
- change default dark theme to light
- disable dark mode on windows 10 because Qt's windows 11 theme has bad support on windows 10 (icon display error)
- level required minimum qt version up to 6.5 for color schema.
2026-07-08 20:15:22 +08:00

37 lines
828 B
C++

// SPDX-FileCopyrightText: 2022 Gary Wang <wzc782970009@gmail.com>
//
// SPDX-License-Identifier: MIT
#ifndef GRAPHICSSCENE_H
#define GRAPHICSSCENE_H
#include <QGraphicsScene>
class GraphicsScene : public QGraphicsScene
{
Q_OBJECT
public:
GraphicsScene(QObject *parent = nullptr);
~GraphicsScene();
void showImage(const QPixmap &pixmap);
void showText(const QString &text);
void showSvg(const QString &filepath);
void showAnimated(const QString &filepath);
bool trySetTransformationMode(Qt::TransformationMode mode, float scaleHint);
bool togglePauseAnimation();
bool skipAnimationFrame(int delta = 1);
QPixmap renderToPixmap();
public slots:
void updateStyle(Qt::ColorScheme colorScheme);
private:
QGraphicsItem * m_theThing = nullptr;
};
#endif // GRAPHICSSCENE_H