-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreviewdialog.h
69 lines (61 loc) · 1.81 KB
/
previewdialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef PREVIEWDIALOG_H
#define PREVIEWDIALOG_H
#include <QDialog>
#include "mainwindow.h"
namespace Ui {
class PreviewDialog;
}
class PreviewWidget;
class PreviewDialog : public QDialog
{
Q_OBJECT
public:
explicit PreviewDialog(QWidget *parent = 0);
~PreviewDialog();
void setRemap(bool b);
private:
Ui::PreviewDialog *ui;
void resizeEvent(QResizeEvent *event);
PreviewWidget* previewWidget;
friend class PreviewWidget;
};
class PreviewWidget : public QWidget
{
Q_OBJECT
MainWindow* mainWindow;
public:
PreviewWidget(PreviewDialog* previewDialog)
{
this->mainWindow = (MainWindow*)previewDialog->parent();
this->previewDialog = previewDialog;
QPixmap cursor_pixmap = QPixmap(":cursor1.cur");
QCursor cursor_default = QCursor(cursor_pixmap, 0, 0);
setCursor(cursor_default);
}
void setRemap(bool b);
private:
void paintEvent(QPaintEvent* evt);
void pv_put_font (
//HDC hdc, /* 描画先デバイスコンテキスト */
QRect rect, /* 描画先領域サイズ (Drawing area size)*/
long x, /* 水平位置(dot) (Horizontal position (dot))*/
long y, /* 垂直位置(dot) (Vertical position (dot))*/
long fw, /* 水平フォントサイズ(dot) (Horizontal font size (dot))*/
long fh, /* 垂直フォントサイズ(dot) (Vertical font size (dot))*/
WORD code, /* 文字コード (Character code)*/
WORD col /* 文字色(RGB16) (Text color (RGB16))*/
);
long x, y, fw, fh, cc;
QRect szw;
WORD code;
static WORD col;
//QByteArray str;
QString str;
PreviewDialog* previewDialog;
QImage* img = nullptr;
QCursor* cursor;
void mousePressEvent(QMouseEvent*);
bool bRemap = true;
friend class PreviewDialog;
};
#endif // PREVIEWDIALOG_H