-
Notifications
You must be signed in to change notification settings - Fork 39
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
base: master
Are you sure you want to change the base?
Conversation
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#402
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有看到哪里有使用 horizontalAlignment
呀
Doc Check bot |
主要是 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();
}
} |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kegechen 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 |
1 similar comment
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: kegechen 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 |
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#402
remove loader
deepin pr auto review关键摘要:
是否建议立即修改:
|
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#402
@@ -30,22 +30,20 @@ T.TextField { | |||
verticalAlignment: TextInput.AlignVCenter | |||
onEffectiveHorizontalAlignmentChanged: placeholder.effectiveHorizontalAlignmentChanged() | |||
|
|||
Loader { | |||
// use loader will cause placeholdertext horizontalAlignment not work | |||
// see QQuickPlaceholderText::updateAlignment() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里可以写清楚,QQuickPlaceholderText 会假定他的 parent item 是 QQuickText,用了 Loader 会影响它的 parentItem
remove loader