Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db15997b79 | ||
|
|
fc685d47ce | ||
|
|
267157e9f7 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -8,3 +8,4 @@
|
||||
/buildwed
|
||||
/NameCreater/*.aps
|
||||
/buildweb/
|
||||
/NameCreater/build/*
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
#define MAX_LABEL_IN_PAPER 10
|
||||
#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_REVERSE_START = QPoint(214, 1745);
|
||||
|
||||
@ -135,7 +135,7 @@ void BirthdayCreater::generaImageFromCSV(Name_Type_e type, const QString& filena
|
||||
|
||||
int chrismas_y_offset = 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;
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ void BirthdayCreater::generaImageFromCSV(Name_Type_e type, const QString& filena
|
||||
|
||||
int chrismas_y_offset = 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;
|
||||
}
|
||||
|
||||
@ -203,20 +203,20 @@ void BirthdayCreater::generaImageFromCSV(Name_Type_e type, const QString& filena
|
||||
|
||||
for(int i = 0; i < 2; i++){
|
||||
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;
|
||||
int sp_y_offset = (i == 0)? 1.0*chrismas_y_offset:-1.0*chrismas_y_offset;
|
||||
//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);
|
||||
QRectF rect = eng_word_item->boundingRect();
|
||||
eng_word_item->setDefaultTextColor(font_color);
|
||||
|
||||
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;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@ -33,10 +33,12 @@
|
||||
|
||||
//#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"
|
||||
|
||||
static CustomLogo* s_custom_logo_widget = nullptr;
|
||||
|
||||
NameCreater::NameCreater(QWidget* parent)
|
||||
: QMainWindow(parent)
|
||||
{
|
||||
@ -249,12 +251,14 @@ void NameCreater::execCreater(QObject* sender, const QString& fileName, const QB
|
||||
|
||||
|
||||
void NameCreater::OnClickedCustomLogoBtn() {
|
||||
QEventLoop loop;
|
||||
CustomLogo widget(&this->font);
|
||||
widget.show();
|
||||
connect(&widget, &CustomLogo::finished, &loop, &QEventLoop::quit);
|
||||
loop.exec();
|
||||
qDebug() << "exit event loop";
|
||||
//QEventLoop loop;
|
||||
if (s_custom_logo_widget == nullptr) {
|
||||
s_custom_logo_widget = new CustomLogo(&this->font);
|
||||
}
|
||||
s_custom_logo_widget->show();
|
||||
|
||||
//connect(&widget, &CustomLogo::finished, &loop, &QEventLoop::quit);
|
||||
//loop.exec();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -25,6 +25,7 @@ private:
|
||||
|
||||
QFont font, font_towel, font_english;
|
||||
|
||||
|
||||
QColor font_color;
|
||||
|
||||
QNetworkAccessManager network_mgr;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -57,7 +57,7 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>$(DefaultQtVersion)</QtInstall>
|
||||
<QtModules>core;gui;widgets;network;core5compat</QtModules>
|
||||
<QtModules>core;gui;widgets;network</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|Win32'" Label="QtSettings">
|
||||
|
||||
@ -12,8 +12,5 @@ protected:
|
||||
public:
|
||||
virtual void generaImageFromCSV(Name_Type_e type, const QString& filename, const QByteArray& filecontent, const QFont& font, const QColor& font_color);
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#ifndef DEF_H
|
||||
#define DEF_H
|
||||
|
||||
#define VERSION "v2.10.1"
|
||||
#define VERSION "v2.10.3"
|
||||
|
||||
|
||||
#endif // DEF_H
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user