Files
Renderive/YSGraphic_Core/main.cpp
T
2026-07-24 10:54:44 +08:00

66 lines
1.7 KiB
C++

#include <QApplication>
#include <QWidget>
#ifdef _WINDOWS
#include <QTextCodec>
#include <WinSock2.h>
#include <Windows.h>
#endif
#include <QStyle>
#include <QWidget>
#include <QtWidgets>
#include "Demo_Gallery/export.h"
#include "Generate_Mock_Data.h"
#include "base/Graphic.h"
#include "base/Select_Color_Dialog/Select_Color_Dialog.h"
#include "component/Button.h"
#include "component/simple_widget.h"
#include "plottable/Afterglow.h"
#include "plottable/Planisphere.h"
#include "plottable/Planisphere_p.h"
#include "plottable/Spectrum.h"
#include "plottable/Spectrum_p.h"
#include "plottable/Waterfall.h"
#include "plottable/Waterfall_p.h"
class Temp : public QWidget {
public:
Temp() {
setFixedSize(400, 400);
image.load("D:/wyc/projects/CLionProjects/plantSunCat/mainProjects/YSGraphic/src/img.png");
}
QImage image;
protected:
void paintEvent(QPaintEvent* event) override {
QPainter painter(this);
double w = width();
double h = height();
// painter.scale(-1.5, 1);
// painter.drawImage(QRectF(-100, 100, 100, 100), image);
painter.scale(1.5, 1);
painter.drawImage(QRectF(100, 100, 100, 100), image);
painter.end();
}
};
#ifdef _build_exe
int main(int argc, char* argv[]) {
QApplication app(argc, argv);
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
#ifdef _WINDOWS
SetConsoleOutputCP(CP_UTF8);
system("chcp 65001");
// setbuf(stdout, 0);
#endif
Button btn;
btn.show();
// WaveWidget w;
// w.resize(400, 400);
// w.show();
return QApplication::exec();
}
int main2(int argc, char* argv[]) {
QApplication a(argc, argv);
WaveWidget w;
w.show();
return a.exec();
}
#endif