Compare commits
76 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b85630a84 | ||
|
|
b6dad9cc18 | ||
|
|
734b3d1303 | ||
|
|
12c2c02756 | ||
|
|
74c515f78a | ||
|
|
60ecafb424 | ||
|
|
0e9e58a389 | ||
|
|
7aa79287c8 | ||
|
|
40d41b36e2 | ||
|
|
cbba28fcf5 | ||
|
|
e8b68cf0c4 | ||
|
|
1405d54f33 | ||
| 16431955de | |||
|
|
c13e225d29 | ||
|
|
4c92f00cb2 | ||
|
|
e8a4557906 | ||
|
|
bfab4f20da | ||
| 5bc600c0ec | |||
|
|
17e98668b2 | ||
| 8e9375c7ac | |||
|
|
de6c1a0a6b | ||
| faad6b25ef | |||
| 8277a65bdd | |||
| d3dd641a59 | |||
| 8bfd5da5f1 | |||
| 599480df0f | |||
| 91ca0f21a9 | |||
| 2b51d7ddee | |||
| d1e80ad04c | |||
| 5655d824d7 | |||
| 47b543aaa7 | |||
| 0d14515dc3 | |||
| d9ebf66831 | |||
| e64e06bf56 | |||
|
|
5bbafd6668 | ||
|
|
bbc348d859 | ||
|
|
7a8106b539 | ||
|
|
052d36b520 | ||
|
|
c5e8bba4ff | ||
| 62e75e4ca0 | |||
|
|
46c669d78e | ||
|
|
e14743ca15 | ||
|
|
6ea71180c8 | ||
|
|
10a119e7ea | ||
|
|
39402a800f | ||
|
|
3eb58b7830 | ||
|
|
c6fb017745 | ||
|
|
f9cddcb565 | ||
|
|
aaf3751879 | ||
| 0c5abc203c | |||
| 8166fc30ae | |||
| b2602b5ef7 | |||
| 231f63295f | |||
| 3b6987bb8b | |||
|
|
3da5037ca7 | ||
|
|
2f330ac463 | ||
| d425173179 | |||
| 3b7756393e | |||
| 425e9fead2 | |||
|
|
1a254c4898 | ||
|
|
f40a56c656 | ||
| 3942d7f147 | |||
|
|
fc8bb70f56 | ||
|
|
24639c50b0 | ||
| d9d110ce04 | |||
| 83fde65fae | |||
| 56ea07365d | |||
| 6009f56287 | |||
|
|
dd69403ee6 | ||
|
|
3ce254f16d | ||
|
|
1216358657 | ||
| 793446dcd2 | |||
| 4fa3d9dc1c | |||
|
|
27a4eb5c8b | ||
| 6025cc2913 | |||
| 615fa0e283 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,4 +8,3 @@
|
|||||||
/buildwed
|
/buildwed
|
||||||
/NameCreater/*.aps
|
/NameCreater/*.aps
|
||||||
/buildweb/
|
/buildweb/
|
||||||
/NameCreater/build/*
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
#define MAX_LABEL_IN_PAPER 10
|
#define MAX_LABEL_IN_PAPER 10
|
||||||
#define FONT_PIXEL_SIZE 120
|
#define FONT_PIXEL_SIZE 120
|
||||||
|
|
||||||
static QPoint LABEL_POS_START = QPoint(163, 70);
|
static QPoint LABEL_POS_START = QPoint(163, 115);
|
||||||
static QPoint NAME_OFFSET_START = QPoint(82, 712);
|
static QPoint NAME_OFFSET_START = QPoint(82, 712);
|
||||||
static QPoint NAME_OFFSET_REVERSE_START = QPoint(214, 1745);
|
static QPoint NAME_OFFSET_REVERSE_START = QPoint(214, 1745);
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ void BirthdayCreater::generaImageFromCSV(Name_Type_e type, const QString& filena
|
|||||||
|
|
||||||
int chrismas_y_offset = 0;
|
int chrismas_y_offset = 0;
|
||||||
if (name_info.name2.compare("co") == 0 || name_info.name2.compare("ol") == 0 ||
|
if (name_info.name2.compare("co") == 0 || name_info.name2.compare("ol") == 0 ||
|
||||||
/*name_info.name2.compare("st") == 0 ||*/ name_info.name2.compare("sn") == 0) {
|
name_info.name2.compare("st") == 0 || name_info.name2.compare("sn") == 0) {
|
||||||
chrismas_y_offset = 30;
|
chrismas_y_offset = 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ void BirthdayCreater::generaImageFromCSV(Name_Type_e type, const QString& filena
|
|||||||
|
|
||||||
int chrismas_y_offset = 0;
|
int chrismas_y_offset = 0;
|
||||||
if (name_info.name2.compare("co") == 0 || name_info.name2.compare("ol") == 0 ||
|
if (name_info.name2.compare("co") == 0 || name_info.name2.compare("ol") == 0 ||
|
||||||
/*name_info.name2.compare("st") == 0 ||*/ name_info.name2.compare("sn") == 0) {
|
name_info.name2.compare("st") == 0 || name_info.name2.compare("sn") == 0) {
|
||||||
chrismas_y_offset = 30;
|
chrismas_y_offset = 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,20 +203,20 @@ void BirthdayCreater::generaImageFromCSV(Name_Type_e type, const QString& filena
|
|||||||
|
|
||||||
for(int i = 0; i < 2; i++){
|
for(int i = 0; i < 2; i++){
|
||||||
qreal dir = (i == 0) ? -1.0:1.0;
|
qreal dir = (i == 0) ? -1.0:1.0;
|
||||||
qreal x_offset = (i == 0) ? 280.0 : 170.0;
|
qreal x_offset = (i == 0) ? 290.0 : 170.0;
|
||||||
qreal y_offset = (i == 0) ? 890.0 : 1550.0;
|
qreal y_offset = (i == 0) ? 890.0 : 1550.0;
|
||||||
int sp_y_offset = (i == 0)? 1.0*chrismas_y_offset:-1.0*chrismas_y_offset;
|
int sp_y_offset = (i == 0)? 1.0*chrismas_y_offset:-1.0*chrismas_y_offset;
|
||||||
//add English world
|
//add English world
|
||||||
QGraphicsTextItem* eng_word_item = new QGraphicsTextItem(name_info.name_eng,label_item);
|
QGraphicsTextItem* eng_word_item = new QGraphicsTextItem(name_info.name_eng);
|
||||||
eng_word_item->setFont(_new_font);
|
eng_word_item->setFont(_new_font);
|
||||||
QRectF rect = eng_word_item->boundingRect();
|
QRectF rect = eng_word_item->boundingRect();
|
||||||
eng_word_item->setDefaultTextColor(font_color);
|
eng_word_item->setDefaultTextColor(font_color);
|
||||||
|
|
||||||
eng_word_item->setRotation(i == 0 ? 90 : -90);
|
eng_word_item->setRotation(i == 0 ? 90 : -90);
|
||||||
eng_word_item->setPos(x_offset - rect.height()/2.0, y_offset + sp_y_offset + (rect.width()/2*dir));
|
eng_word_item->setPos(label_item->x() + x_offset - rect.height()/2.0, label_item->y() + y_offset + sp_y_offset + (rect.width()/2*dir));
|
||||||
|
|
||||||
|
|
||||||
//scene.addItem(eng_word_item);
|
scene.addItem(eng_word_item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ void BirthdayCreater::generaImageFromCSV(Name_Type_e type, const QString& filena
|
|||||||
|
|
||||||
int chrismas_y_offset = 0;
|
int chrismas_y_offset = 0;
|
||||||
if (name_info.name2.compare("co") == 0 || name_info.name2.compare("ol") == 0 ||
|
if (name_info.name2.compare("co") == 0 || name_info.name2.compare("ol") == 0 ||
|
||||||
/*name_info.name2.compare("st") == 0 ||*/ name_info.name2.compare("sn") == 0) {
|
name_info.name2.compare("st") == 0 || name_info.name2.compare("sn") == 0) {
|
||||||
chrismas_y_offset = 30;
|
chrismas_y_offset = 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -177,5 +177,3 @@ int INameCreater::getFontSizebyStr(const QFont& font, int max_font_size,int max_
|
|||||||
|
|
||||||
return font_size;
|
return font_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -33,12 +33,10 @@
|
|||||||
|
|
||||||
//#define FONT_CHT_URL "https://bazaar1688.ddns.net/font/TaiwanPearl-SemiBold.ttf"
|
//#define FONT_CHT_URL "https://bazaar1688.ddns.net/font/TaiwanPearl-SemiBold.ttf"
|
||||||
|
|
||||||
#define FONT_JSON_URL "https://namecreater.bazaar1688.duckdns.org/font/fonts.json"
|
#define FONT_JSON_URL "https://bazaar1688.ddns.net/font/fonts.json"
|
||||||
|
|
||||||
//#define FONT_CHT_URL "http://45.32.51.135/font/TaiwanPearl-SemiBold.ttf"
|
//#define FONT_CHT_URL "http://45.32.51.135/font/TaiwanPearl-SemiBold.ttf"
|
||||||
|
|
||||||
static CustomLogo* s_custom_logo_widget = nullptr;
|
|
||||||
|
|
||||||
NameCreater::NameCreater(QWidget* parent)
|
NameCreater::NameCreater(QWidget* parent)
|
||||||
: QMainWindow(parent)
|
: QMainWindow(parent)
|
||||||
{
|
{
|
||||||
@ -251,14 +249,12 @@ void NameCreater::execCreater(QObject* sender, const QString& fileName, const QB
|
|||||||
|
|
||||||
|
|
||||||
void NameCreater::OnClickedCustomLogoBtn() {
|
void NameCreater::OnClickedCustomLogoBtn() {
|
||||||
//QEventLoop loop;
|
QEventLoop loop;
|
||||||
if (s_custom_logo_widget == nullptr) {
|
CustomLogo widget(&this->font);
|
||||||
s_custom_logo_widget = new CustomLogo(&this->font);
|
widget.show();
|
||||||
}
|
connect(&widget, &CustomLogo::finished, &loop, &QEventLoop::quit);
|
||||||
s_custom_logo_widget->show();
|
loop.exec();
|
||||||
|
qDebug() << "exit event loop";
|
||||||
//connect(&widget, &CustomLogo::finished, &loop, &QEventLoop::quit);
|
|
||||||
//loop.exec();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,6 @@ private:
|
|||||||
|
|
||||||
QFont font, font_towel, font_english;
|
QFont font, font_towel, font_english;
|
||||||
|
|
||||||
|
|
||||||
QColor font_color;
|
QColor font_color;
|
||||||
|
|
||||||
QNetworkAccessManager network_mgr;
|
QNetworkAccessManager network_mgr;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -57,7 +57,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="QtSettings">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="QtSettings">
|
||||||
<QtInstall>$(DefaultQtVersion)</QtInstall>
|
<QtInstall>$(DefaultQtVersion)</QtInstall>
|
||||||
<QtModules>core;gui;widgets;network</QtModules>
|
<QtModules>core;gui;widgets;network;core5compat</QtModules>
|
||||||
<QtBuildConfig>debug</QtBuildConfig>
|
<QtBuildConfig>debug</QtBuildConfig>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|Win32'" Label="QtSettings">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|Win32'" Label="QtSettings">
|
||||||
|
|||||||
@ -12,5 +12,8 @@ protected:
|
|||||||
public:
|
public:
|
||||||
virtual void generaImageFromCSV(Name_Type_e type, const QString& filename, const QByteArray& filecontent, const QFont& font, const QColor& font_color);
|
virtual void generaImageFromCSV(Name_Type_e type, const QString& filename, const QByteArray& filecontent, const QFont& font, const QColor& font_color);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -329,9 +329,7 @@ QList<NameInfo_t> CustomLogo::getNameByFileContent(Name_Type_e type, const QByte
|
|||||||
{
|
{
|
||||||
QList<NameInfo_t> nameList;
|
QList<NameInfo_t> nameList;
|
||||||
|
|
||||||
QString codec_text = ui->codec_comboBox->currentText();
|
QTextCodec* tc = QTextCodec::codecForName("Big5");
|
||||||
|
|
||||||
QTextCodec* tc = QTextCodec::codecForName(codec_text.toStdString().c_str()); // can also using "Utf8" or "Big5" codec
|
|
||||||
QString codec = tc->toUnicode(conetent.data());
|
QString codec = tc->toUnicode(conetent.data());
|
||||||
QTextStream stream(&codec);
|
QTextStream stream(&codec);
|
||||||
|
|
||||||
|
|||||||
@ -145,10 +145,10 @@
|
|||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QSlider" name="y_adjust_slider">
|
<widget class="QSlider" name="y_adjust_slider">
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>-120</number>
|
<number>-100</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>120</number>
|
<number>100</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
@ -191,48 +191,6 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="horizontalLayoutWidget_2">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>10</x>
|
|
||||||
<y>10</y>
|
|
||||||
<width>311</width>
|
|
||||||
<height>41</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>80</width>
|
|
||||||
<height>16777215</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Codec:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="codec_comboBox">
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Big5</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>Utf8</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="NameCreater.qrc"/>
|
<include location="NameCreater.qrc"/>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef DEF_H
|
#ifndef DEF_H
|
||||||
#define DEF_H
|
#define DEF_H
|
||||||
|
|
||||||
#define VERSION "v2.10.3"
|
#define VERSION "v2.10.0"
|
||||||
|
|
||||||
|
|
||||||
#endif // DEF_H
|
#endif // DEF_H
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user