6#include <QtQuick/private/qquicktext_p_p.h>
7#include <QtQuick/private/qquicktextinput_p_p.h>
8#include <QtQuick/private/qquicktextedit_p_p.h>
12QQuickPlaceholderText::QQuickPlaceholderText(QQuickItem *parent) : QQuickText(parent)
16void QQuickPlaceholderText::componentComplete()
18 QQuickText::componentComplete();
20 auto control = textControl();
22 connect(control, SIGNAL(effectiveHorizontalAlignmentChanged()),
this, SLOT(updateAlignment()));
27
28
29
30
31
32
33QQuickItem *QQuickPlaceholderText::textControl()
const
35 return qobject_cast<QQuickItem *>(parent());
38void QQuickPlaceholderText::updateAlignment()
40 if (QQuickTextInput *input = qobject_cast<QQuickTextInput *>(parentItem())) {
41 if (QQuickTextInputPrivate::get(input)->hAlignImplicit)
44 setHAlign(
static_cast<HAlignment>(input->hAlign()));
45 }
else if (QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(parentItem())) {
46 if (QQuickTextEditPrivate::get(edit)->hAlignImplicit)
49 setHAlign(
static_cast<HAlignment>(edit->hAlign()));
57#include "moc_qquickplaceholdertext_p.cpp"
Combined button and popup list for selecting options.