Compare commits

..

3 Commits

Author SHA1 Message Date
shouchih_chen
db15997b79 1. Adjust Birthday creator detail: label position, eng word position, star style position. 2025-06-21 10:42:16 +08:00
shouchih_chen
fc685d47ce update to 2.10.2
detail for update:
change domain name to "bazaar1688.duckdns.org"
2025-06-01 19:49:51 +08:00
shouchih_chen
267157e9f7 1. not use eventloop in customlogo widget 2024-11-02 06:44:40 +08:00
8 changed files with 1250 additions and 49 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@
/buildwed /buildwed
/NameCreater/*.aps /NameCreater/*.aps
/buildweb/ /buildweb/
/NameCreater/build/*

View File

@ -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;
} }

View File

@ -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();
} }

View File

@ -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

View File

@ -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">

View File

@ -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);
}; };

View File

@ -1,7 +1,7 @@
#ifndef DEF_H #ifndef DEF_H
#define DEF_H #define DEF_H
#define VERSION "v2.10.1" #define VERSION "v2.10.3"
#endif // DEF_H #endif // DEF_H