Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db15997b79 | ||
|
|
fc685d47ce | ||
|
|
267157e9f7 | ||
|
|
6fc1220bff | ||
| a4f9faac10 | |||
|
|
07b9905254 | ||
| a4e9ba9274 | |||
| 92e491d0d1 | |||
|
|
62fc71cf6a |
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@
|
|||||||
/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, 115);
|
static QPoint LABEL_POS_START = QPoint(163, 70);
|
||||||
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) ? 290.0 : 170.0;
|
qreal x_offset = (i == 0) ? 280.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);
|
QGraphicsTextItem* eng_word_item = new QGraphicsTextItem(name_info.name_eng,label_item);
|
||||||
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(label_item->x() + x_offset - rect.height()/2.0, label_item->y() + y_offset + sp_y_offset + (rect.width()/2*dir));
|
eng_word_item->setPos(x_offset - rect.height()/2.0, 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,3 +177,5 @@ int INameCreater::getFontSizebyStr(const QFont& font, int max_font_size,int max_
|
|||||||
|
|
||||||
return font_size;
|
return font_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -33,10 +33,12 @@
|
|||||||
|
|
||||||
//#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://bazaar1688.ddns.net/font/fonts.json"
|
#define FONT_JSON_URL "https://namecreater.bazaar1688.duckdns.org/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)
|
||||||
{
|
{
|
||||||
@ -249,12 +251,14 @@ void NameCreater::execCreater(QObject* sender, const QString& fileName, const QB
|
|||||||
|
|
||||||
|
|
||||||
void NameCreater::OnClickedCustomLogoBtn() {
|
void NameCreater::OnClickedCustomLogoBtn() {
|
||||||
QEventLoop loop;
|
//QEventLoop loop;
|
||||||
CustomLogo widget(&this->font);
|
if (s_custom_logo_widget == nullptr) {
|
||||||
widget.show();
|
s_custom_logo_widget = new CustomLogo(&this->font);
|
||||||
connect(&widget, &CustomLogo::finished, &loop, &QEventLoop::quit);
|
}
|
||||||
loop.exec();
|
s_custom_logo_widget->show();
|
||||||
qDebug() << "exit event loop";
|
|
||||||
|
//connect(&widget, &CustomLogo::finished, &loop, &QEventLoop::quit);
|
||||||
|
//loop.exec();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,7 @@ 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;core5compat</QtModules>
|
<QtModules>core;gui;widgets;network</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,8 +12,5 @@ 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,7 +329,9 @@ QList<NameInfo_t> CustomLogo::getNameByFileContent(Name_Type_e type, const QByte
|
|||||||
{
|
{
|
||||||
QList<NameInfo_t> nameList;
|
QList<NameInfo_t> nameList;
|
||||||
|
|
||||||
QTextCodec* tc = QTextCodec::codecForName("Big5");
|
QString codec_text = ui->codec_comboBox->currentText();
|
||||||
|
|
||||||
|
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>-100</number>
|
<number>-120</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>100</number>
|
<number>120</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
@ -191,6 +191,48 @@
|
|||||||
</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.0"
|
#define VERSION "v2.10.3"
|
||||||
|
|
||||||
|
|
||||||
#endif // DEF_H
|
#endif // DEF_H
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user