Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: placeholder text horizontalAlignment not work #402

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

kegechen
Copy link
Contributor

@kegechen kegechen commented Oct 8, 2024

remove loader

deepin-ci-robot added a commit to linuxdeepin/dtk6declarative that referenced this pull request Oct 8, 2024
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#402
Copy link
Member

@zccrs zccrs left a comment

Choose a reason for hiding this comment

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

没有看到哪里有使用 horizontalAlignment

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Oct 8, 2024

Doc Check bot
🟢 Document Coverage Check Passed!

@kegechen
Copy link
Contributor Author

kegechen commented Oct 9, 2024

没有看到哪里有使用 horizontalAlignment

主要是 placeholdertext updateAlignment时 parentitem转换失败。不需要单独设置这个 textfield 里面设置就可以。

TextField {
            placeholderText: qsTr("test here")
            horizontalAlignment: Text.AlignHCenter 
        }
void QQuickPlaceholderText::updateAlignment()
{
    if (QQuickTextInput *input = qobject_cast<QQuickTextInput *>(parentItem())) {  // QQuickLoader
        if (QQuickTextInputPrivate::get(input)->hAlignImplicit)
            resetHAlign();
        else
            setHAlign(static_cast<HAlignment>(input->hAlign()));
    } else if (QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(parentItem())) { // QQuickLoader
        if (QQuickTextEditPrivate::get(edit)->hAlignImplicit)
            resetHAlign();
        else
            setHAlign(static_cast<HAlignment>(edit->hAlign()));
    } else {
        resetHAlign();
    }
}

18202781743
18202781743 previously approved these changes Oct 9, 2024
deepin-ci-robot added a commit to linuxdeepin/dtk6declarative that referenced this pull request Oct 9, 2024
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#402
deepin-ci-robot added a commit to linuxdeepin/dtk6declarative that referenced this pull request Oct 9, 2024
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#402
qt6/src/qml/TextField.qml Show resolved Hide resolved
@kegechen kegechen requested a review from zccrs October 14, 2024 08:38
deepin-ci-robot added a commit to linuxdeepin/dtk6declarative that referenced this pull request Oct 14, 2024
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#402
deepin-ci-robot added a commit to linuxdeepin/dtk6declarative that referenced this pull request Oct 14, 2024
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#402
@deepin-ci-robot
Copy link
Contributor

deepin pr auto review

关键摘要:

  • 移除了Loader组件,直接使用了PlaceholderText组件,这可能会影响占位符文本的对齐方式。
  • 在PlaceholderText组件中直接添加了visible属性,而不是在Loader组件中控制其可见性。

是否建议立即修改:

建议的修改:

  • 确认移除Loader组件后,占位符文本的对齐方式是否仍然正确。如果对齐方式有问题,可能需要重新调整PlaceholderText组件的属性。
  • 如果Loader组件的目的是为了控制占位符文本的可见性,那么应该保留Loader组件,并在Loader组件中控制PlaceholderText的可见性。

@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kegechen, zccrs

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kegechen kegechen merged commit 68199d7 into linuxdeepin:master Oct 16, 2024
7 of 10 checks passed
deepin-ci-robot added a commit to linuxdeepin/dtk6declarative that referenced this pull request Oct 16, 2024
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#402
FeiWang1119 pushed a commit to linuxdeepin/dtk6declarative that referenced this pull request Oct 16, 2024
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#402
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants