Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/widgets/dprintpreviewdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,7 @@ void DPrintPreviewDialogPrivate::initWaterMarkui()
waterTextEdit->setObjectName(_d_printSettingNameMap[DPrintPreviewSettingInterface::SC_Watermark_CustomText]);
settingHelper->setSubControlEnabled(DPrintPreviewSettingInterface::SC_Watermark_CustomText, false);
waterTextEdit->lineEdit()->setPlaceholderText(qApp->translate("DPrintPreviewDialogPrivate", "Input your text"));
waterTextEdit->lineEdit()->setMaxLength(16);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): Setting the QLineEdit maximum before watermark settings are restored causes any existing customText longer than 16 characters to be silently truncated by subsequent setText() calls, so the preview and returned print settings no longer preserve the caller's watermark text.

Triggers: When an application restores or supplies a watermark whose custom text exceeds 16 characters.

Suggested fix: Apply the 16-character restriction only to user-edited input, while preserving and rendering programmatically supplied existing text, or explicitly handle long restored values without silently truncating them.

hlayout2->addStretch(5);
hlayout2->addWidget(waterTextEdit, 10);

Expand Down
Loading