most relevant QskTextEdit/QskTextInput properties forwarded
This commit is contained in:
parent
237cb4ab7e
commit
a6f637ac5e
|
@ -75,6 +75,10 @@ namespace
|
||||||
auto field = new QskTextField( this );
|
auto field = new QskTextField( this );
|
||||||
field->setText( "John Doe" );
|
field->setText( "John Doe" );
|
||||||
field->setPlaceholderText( "<Name>" );
|
field->setPlaceholderText( "<Name>" );
|
||||||
|
|
||||||
|
connect( field, &QskTextField::textChanged,
|
||||||
|
[]( const QString& text ) { qDebug() << "Text:" << text; } );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -106,6 +110,11 @@ namespace
|
||||||
auto textArea = new QskTextArea( "here enter longer text", this );
|
auto textArea = new QskTextArea( "here enter longer text", this );
|
||||||
textArea->setWrapMode( QskTextOptions::Wrap );
|
textArea->setWrapMode( QskTextOptions::Wrap );
|
||||||
textArea->setPlaceholderText( "placeholder text" );
|
textArea->setPlaceholderText( "placeholder text" );
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
connect( textArea, &QskTextArea::textChanged,
|
||||||
|
[]( const QString& text ) { qDebug() << "Text:" << text; } );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -191,6 +200,12 @@ void InputPage::syncValues( qreal value )
|
||||||
auto sliders = findChildren< QskSlider* >();
|
auto sliders = findChildren< QskSlider* >();
|
||||||
for ( auto slider : sliders )
|
for ( auto slider : sliders )
|
||||||
slider->setValue( value );
|
slider->setValue( value );
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
auto textEdits = findChildren< QskTextEdit* >();
|
||||||
|
for ( auto edit : textEdits )
|
||||||
|
edit->setText( QString::number( value ) );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
blockUpdates = false;
|
blockUpdates = false;
|
||||||
|
|
|
@ -119,6 +119,92 @@ static inline void qskForwardEvent( QQuickItem* item, QEvent* event )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline bool qskIsIrrelevantProperty( const char* name )
|
||||||
|
{
|
||||||
|
static const char* properties[] =
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
these are properties that are set from skin hints.
|
||||||
|
do we want to have convenience setters/getters for these hints ?
|
||||||
|
*/
|
||||||
|
"color",
|
||||||
|
"selectionColor",
|
||||||
|
"selectedTextColor",
|
||||||
|
|
||||||
|
/*
|
||||||
|
covered by the alignment property
|
||||||
|
*/
|
||||||
|
"horizontalAlignment",
|
||||||
|
"effectiveHorizontalAlignment",
|
||||||
|
"verticalAlignment",
|
||||||
|
|
||||||
|
/*
|
||||||
|
we don't want to offer cursorDelegates as this would be done
|
||||||
|
using subcontrols.
|
||||||
|
*/
|
||||||
|
"cursorRectangle",
|
||||||
|
"cursorDelegate",
|
||||||
|
|
||||||
|
/*
|
||||||
|
hasSelectedText ?
|
||||||
|
*/
|
||||||
|
"selectionStart",
|
||||||
|
"selectionEnd",
|
||||||
|
"selectedText",
|
||||||
|
|
||||||
|
/*
|
||||||
|
covered by QskAbstractTextInput::ActivationMode
|
||||||
|
*/
|
||||||
|
|
||||||
|
"activeFocusOnPress",
|
||||||
|
|
||||||
|
/*
|
||||||
|
These poperties correspond to Qt::TextInteractionFlags
|
||||||
|
we can't simply forward them as mouseSelectionMode returns
|
||||||
|
local enums of QQuickTextEdit and QQuickTextInput
|
||||||
|
*/
|
||||||
|
"selectByMouse",
|
||||||
|
"selectByKeyboard",
|
||||||
|
"mouseSelectionMode",
|
||||||
|
|
||||||
|
/*
|
||||||
|
covered by unwrappedTextSize
|
||||||
|
*/
|
||||||
|
"contentWidth",
|
||||||
|
"contentHeight",
|
||||||
|
"paintedWidth",
|
||||||
|
"paintedHeight",
|
||||||
|
|
||||||
|
/*
|
||||||
|
unused we have our own padding from the skin hints
|
||||||
|
*/
|
||||||
|
"padding",
|
||||||
|
"topPadding",
|
||||||
|
"leftPadding",
|
||||||
|
"rightPadding",
|
||||||
|
"bottomPadding",
|
||||||
|
|
||||||
|
/*
|
||||||
|
ends up in QTextDocument::documentMargin. But how is its
|
||||||
|
effect different to what you get from the padding ?
|
||||||
|
*/
|
||||||
|
"textMargin",
|
||||||
|
|
||||||
|
/*
|
||||||
|
not covered so far, but IMHO of little relevance
|
||||||
|
*/
|
||||||
|
"renderType"
|
||||||
|
};
|
||||||
|
|
||||||
|
for ( const auto n : properties )
|
||||||
|
{
|
||||||
|
if ( strcmp( name, n ) == 0 )
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
class PropertyBinder : public QObject
|
class PropertyBinder : public QObject
|
||||||
|
@ -167,7 +253,8 @@ namespace
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// qDebug() << "Missing" << property.name();
|
if ( !qskIsIrrelevantProperty( property.name() ) )
|
||||||
|
qDebug() << "Missing:" << mo->className() << property.name();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -197,6 +284,11 @@ namespace
|
||||||
const auto property = mo->property( binding.first );
|
const auto property = mo->property( binding.first );
|
||||||
|
|
||||||
const auto value = property.read( sender() );
|
const auto value = property.read( sender() );
|
||||||
|
#if 0
|
||||||
|
qDebug() << property.name() << value
|
||||||
|
<< binding.second.methodSignature();
|
||||||
|
#endif
|
||||||
|
|
||||||
void* args[3] = { nullptr, const_cast< void* >( value.data() ), nullptr };
|
void* args[3] = { nullptr, const_cast< void* >( value.data() ), nullptr };
|
||||||
|
|
||||||
qskInvokeMetaMethod( parent(), binding.second, args, Qt::DirectConnection );
|
qskInvokeMetaMethod( parent(), binding.second, args, Qt::DirectConnection );
|
||||||
|
@ -270,6 +362,21 @@ void QskAbstractTextInput::setSelectByMouse( bool on )
|
||||||
m_data->input->setProperty( "selectByMouse", on );
|
m_data->input->setProperty( "selectByMouse", on );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QskAbstractTextInput::persistentSelection() const
|
||||||
|
{
|
||||||
|
return m_data->input->property( "persistentSelection" ).value< bool >();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QskAbstractTextInput::setPersistentSelection( bool on )
|
||||||
|
{
|
||||||
|
m_data->input->setProperty( "persistentSelection", on );
|
||||||
|
}
|
||||||
|
|
||||||
|
int QskAbstractTextInput::length() const
|
||||||
|
{
|
||||||
|
return m_data->input->property( "length" ).value< int >();
|
||||||
|
}
|
||||||
|
|
||||||
QString QskAbstractTextInput::text() const
|
QString QskAbstractTextInput::text() const
|
||||||
{
|
{
|
||||||
return m_data->input->property( "text" ).value< QString >();
|
return m_data->input->property( "text" ).value< QString >();
|
||||||
|
@ -310,6 +417,11 @@ bool QskAbstractTextInput::canRedo() const
|
||||||
return m_data->input->property( "canRedo" ).value< bool >();
|
return m_data->input->property( "canRedo" ).value< bool >();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QskAbstractTextInput::canPaste() const
|
||||||
|
{
|
||||||
|
return m_data->input->property( "canPaste" ).value< bool >();
|
||||||
|
}
|
||||||
|
|
||||||
void QskAbstractTextInput::setFontRole( const QskFontRole& role )
|
void QskAbstractTextInput::setFontRole( const QskFontRole& role )
|
||||||
{
|
{
|
||||||
if ( setFontRoleHint( Text, role ) )
|
if ( setFontRoleHint( Text, role ) )
|
||||||
|
@ -580,6 +692,11 @@ void QskAbstractTextInput::setReadOnly( bool on )
|
||||||
setSkinStateFlag( ReadOnly, on );
|
setSkinStateFlag( ReadOnly, on );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QskAbstractTextInput::isInputMethodComposing() const
|
||||||
|
{
|
||||||
|
return m_data->input->property( "inputMethodComposing" ).value< bool >();
|
||||||
|
}
|
||||||
|
|
||||||
bool QskAbstractTextInput::isEditing() const
|
bool QskAbstractTextInput::isEditing() const
|
||||||
{
|
{
|
||||||
return hasSkinState( Editing );
|
return hasSkinState( Editing );
|
||||||
|
@ -667,6 +784,14 @@ QskTextOptions::WrapMode QskAbstractTextInput::wrapMode() const
|
||||||
return static_cast< QskTextOptions::WrapMode >( mode );
|
return static_cast< QskTextOptions::WrapMode >( mode );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSizeF QskAbstractTextInput::unwrappedTextSize() const
|
||||||
|
{
|
||||||
|
const auto w = m_data->input->property( "contentWidth" ).value< qreal >();
|
||||||
|
const auto h = m_data->input->property( "contentHeight" ).value< qreal >();
|
||||||
|
|
||||||
|
return QSizeF( w, h );
|
||||||
|
}
|
||||||
|
|
||||||
void QskAbstractTextInput::setAlignment( Qt::Alignment alignment )
|
void QskAbstractTextInput::setAlignment( Qt::Alignment alignment )
|
||||||
{
|
{
|
||||||
if ( setAlignmentHint( Text, alignment ) )
|
if ( setAlignmentHint( Text, alignment ) )
|
||||||
|
|
|
@ -18,6 +18,8 @@ class QSK_EXPORT QskAbstractTextInput : public QskControl
|
||||||
Q_PROPERTY( QString text READ text
|
Q_PROPERTY( QString text READ text
|
||||||
WRITE setText NOTIFY textChanged USER true )
|
WRITE setText NOTIFY textChanged USER true )
|
||||||
|
|
||||||
|
Q_PROPERTY( int length READ length NOTIFY lengthChanged )
|
||||||
|
|
||||||
Q_PROPERTY( QString preeditText READ preeditText
|
Q_PROPERTY( QString preeditText READ preeditText
|
||||||
NOTIFY preeditTextChanged )
|
NOTIFY preeditTextChanged )
|
||||||
|
|
||||||
|
@ -30,6 +32,12 @@ class QSK_EXPORT QskAbstractTextInput : public QskControl
|
||||||
Q_PROPERTY( ActivationModes activationModes READ activationModes
|
Q_PROPERTY( ActivationModes activationModes READ activationModes
|
||||||
WRITE setActivationModes NOTIFY activationModesChanged )
|
WRITE setActivationModes NOTIFY activationModesChanged )
|
||||||
|
|
||||||
|
Q_PROPERTY( Qt::InputMethodHints inputMethodHints READ inputMethodHints
|
||||||
|
WRITE setInputMethodHints NOTIFY inputMethodHintsChanged )
|
||||||
|
|
||||||
|
Q_PROPERTY( bool inputMethodComposing READ isInputMethodComposing
|
||||||
|
NOTIFY inputMethodComposingChanged )
|
||||||
|
|
||||||
Q_PROPERTY( QskFontRole fontRole READ fontRole
|
Q_PROPERTY( QskFontRole fontRole READ fontRole
|
||||||
WRITE setFontRole RESET resetFontRole NOTIFY fontRoleChanged )
|
WRITE setFontRole RESET resetFontRole NOTIFY fontRoleChanged )
|
||||||
|
|
||||||
|
@ -50,11 +58,12 @@ class QSK_EXPORT QskAbstractTextInput : public QskControl
|
||||||
Q_PROPERTY( QskTextOptions::WrapMode wrapMode READ wrapMode
|
Q_PROPERTY( QskTextOptions::WrapMode wrapMode READ wrapMode
|
||||||
WRITE setWrapMode NOTIFY wrapModeChanged )
|
WRITE setWrapMode NOTIFY wrapModeChanged )
|
||||||
|
|
||||||
Q_PROPERTY( bool selectByMouse READ selectByMouse
|
Q_PROPERTY( bool persistentSelection READ persistentSelection
|
||||||
WRITE setSelectByMouse NOTIFY selectByMouseChanged )
|
WRITE setPersistentSelection NOTIFY persistentSelectionChanged )
|
||||||
|
|
||||||
Q_PROPERTY( bool canUndo READ canUndo NOTIFY canUndoChanged )
|
Q_PROPERTY( bool canUndo READ canUndo NOTIFY canUndoChanged )
|
||||||
Q_PROPERTY( bool canRedo READ canRedo NOTIFY canRedoChanged )
|
Q_PROPERTY( bool canRedo READ canRedo NOTIFY canRedoChanged )
|
||||||
|
Q_PROPERTY( bool canPaste READ canPaste NOTIFY canPasteChanged )
|
||||||
|
|
||||||
using Inherited = QskControl;
|
using Inherited = QskControl;
|
||||||
|
|
||||||
|
@ -82,10 +91,13 @@ class QSK_EXPORT QskAbstractTextInput : public QskControl
|
||||||
QString text() const;
|
QString text() const;
|
||||||
QString preeditText() const;
|
QString preeditText() const;
|
||||||
|
|
||||||
|
int length() const;
|
||||||
|
|
||||||
bool isReadOnly() const;
|
bool isReadOnly() const;
|
||||||
void setReadOnly( bool );
|
void setReadOnly( bool );
|
||||||
|
|
||||||
bool isEditing() const;
|
bool isEditing() const;
|
||||||
|
bool isInputMethodComposing() const;
|
||||||
|
|
||||||
void setActivationModes( ActivationModes );
|
void setActivationModes( ActivationModes );
|
||||||
ActivationModes activationModes() const;
|
ActivationModes activationModes() const;
|
||||||
|
@ -93,6 +105,9 @@ class QSK_EXPORT QskAbstractTextInput : public QskControl
|
||||||
void setSelectByMouse( bool );
|
void setSelectByMouse( bool );
|
||||||
bool selectByMouse() const;
|
bool selectByMouse() const;
|
||||||
|
|
||||||
|
void setPersistentSelection( bool );
|
||||||
|
bool persistentSelection() const;
|
||||||
|
|
||||||
void setAlignment( Qt::Alignment );
|
void setAlignment( Qt::Alignment );
|
||||||
void resetAlignment();
|
void resetAlignment();
|
||||||
Qt::Alignment alignment() const;
|
Qt::Alignment alignment() const;
|
||||||
|
@ -123,6 +138,9 @@ class QSK_EXPORT QskAbstractTextInput : public QskControl
|
||||||
|
|
||||||
bool canUndo() const;
|
bool canUndo() const;
|
||||||
bool canRedo() const;
|
bool canRedo() const;
|
||||||
|
bool canPaste() const;
|
||||||
|
|
||||||
|
QSizeF unwrappedTextSize() const;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void setText( const QString& );
|
void setText( const QString& );
|
||||||
|
@ -136,15 +154,20 @@ class QSK_EXPORT QskAbstractTextInput : public QskControl
|
||||||
void editingChanged( bool );
|
void editingChanged( bool );
|
||||||
void readOnlyChanged( bool );
|
void readOnlyChanged( bool );
|
||||||
void activationModesChanged();
|
void activationModesChanged();
|
||||||
|
void inputMethodHintsChanged( Qt::InputMethodHints );
|
||||||
void fontRoleChanged();
|
void fontRoleChanged();
|
||||||
void overwriteModeChanged( bool );
|
void overwriteModeChanged( bool );
|
||||||
void cursorPositionChanged( int );
|
void cursorPositionChanged( int );
|
||||||
void cursorVisibleChanged( bool );
|
void cursorVisibleChanged( bool );
|
||||||
void selectByMouseChanged( bool );
|
void selectByMouseChanged( bool );
|
||||||
|
void persistentSelectionChanged( bool );
|
||||||
|
|
||||||
void wrapModeChanged( QskTextOptions::WrapMode );
|
void wrapModeChanged( QskTextOptions::WrapMode );
|
||||||
void alignmentChanged();
|
void alignmentChanged();
|
||||||
|
|
||||||
|
void inputMethodComposingChanged( bool );
|
||||||
|
|
||||||
|
void lengthChanged( int );
|
||||||
void textChanged( const QString& );
|
void textChanged( const QString& );
|
||||||
void textEdited( const QString& );
|
void textEdited( const QString& );
|
||||||
void displayTextChanged( const QString& );
|
void displayTextChanged( const QString& );
|
||||||
|
@ -153,6 +176,7 @@ class QSK_EXPORT QskAbstractTextInput : public QskControl
|
||||||
#if 1
|
#if 1
|
||||||
void canUndoChanged( bool );
|
void canUndoChanged( bool );
|
||||||
void canRedoChanged( bool );
|
void canRedoChanged( bool );
|
||||||
|
void canPasteChanged( bool );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -130,6 +130,26 @@ QskTextEdit::~QskTextEdit()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QUrl QskTextEdit::baseUrl() const
|
||||||
|
{
|
||||||
|
return m_data->wrappedEdit->baseUrl();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QskTextEdit::setBaseUrl( const QUrl& url )
|
||||||
|
{
|
||||||
|
m_data->wrappedEdit->setBaseUrl( url );
|
||||||
|
}
|
||||||
|
|
||||||
|
void QskTextEdit::resetBaseUrl()
|
||||||
|
{
|
||||||
|
m_data->wrappedEdit->resetBaseUrl();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QskTextEdit::hoveredLink() const
|
||||||
|
{
|
||||||
|
return m_data->wrappedEdit->hoveredLink();
|
||||||
|
}
|
||||||
|
|
||||||
void QskTextEdit::setTextFormat( QskTextOptions::TextFormat textFormat )
|
void QskTextEdit::setTextFormat( QskTextOptions::TextFormat textFormat )
|
||||||
{
|
{
|
||||||
m_data->wrappedEdit->setTextFormat(
|
m_data->wrappedEdit->setTextFormat(
|
||||||
|
|
|
@ -21,6 +21,11 @@ class QSK_EXPORT QskTextEdit : public QskAbstractTextInput
|
||||||
Q_PROPERTY( qreal tabStopDistance READ tabStopDistance
|
Q_PROPERTY( qreal tabStopDistance READ tabStopDistance
|
||||||
WRITE setTabStopDistance NOTIFY tabStopDistanceChanged )
|
WRITE setTabStopDistance NOTIFY tabStopDistanceChanged )
|
||||||
|
|
||||||
|
Q_PROPERTY( QUrl baseUrl READ baseUrl WRITE setBaseUrl
|
||||||
|
RESET resetBaseUrl NOTIFY baseUrlChanged )
|
||||||
|
|
||||||
|
Q_PROPERTY( QString hoveredLink READ hoveredLink NOTIFY linkHovered )
|
||||||
|
|
||||||
using Inherited = QskAbstractTextInput;
|
using Inherited = QskAbstractTextInput;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -37,12 +42,21 @@ class QSK_EXPORT QskTextEdit : public QskAbstractTextInput
|
||||||
int tabStopDistance() const;
|
int tabStopDistance() const;
|
||||||
void setTabStopDistance( qreal );
|
void setTabStopDistance( qreal );
|
||||||
|
|
||||||
|
QUrl baseUrl() const;
|
||||||
|
void setBaseUrl( const QUrl& );
|
||||||
|
void resetBaseUrl();
|
||||||
|
|
||||||
|
QString hoveredLink() const;
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void lineCountChanged( int );
|
void lineCountChanged( int );
|
||||||
|
void baseUrlChanged( QUrl );
|
||||||
|
|
||||||
void textFormatChanged( QskTextOptions::TextFormat );
|
void textFormatChanged( QskTextOptions::TextFormat );
|
||||||
void tabStopDistanceChanged( qreal );
|
void tabStopDistanceChanged( qreal );
|
||||||
|
|
||||||
|
void linkHovered( const QString& );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class PrivateData;
|
class PrivateData;
|
||||||
std::unique_ptr< PrivateData > m_data;
|
std::unique_ptr< PrivateData > m_data;
|
||||||
|
|
|
@ -184,6 +184,16 @@ void QskTextInput::setInputMask( const QString& mask )
|
||||||
m_data->wrappedInput->setInputMask( mask );
|
m_data->wrappedInput->setInputMask( mask );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QskTextInput::autoScroll() const
|
||||||
|
{
|
||||||
|
return m_data->wrappedInput->autoScroll();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QskTextInput::setAutoScroll( bool on )
|
||||||
|
{
|
||||||
|
m_data->wrappedInput->setAutoScroll( on );
|
||||||
|
}
|
||||||
|
|
||||||
QskTextInput::EchoMode QskTextInput::echoMode() const
|
QskTextInput::EchoMode QskTextInput::echoMode() const
|
||||||
{
|
{
|
||||||
const auto mode = m_data->wrappedInput->echoMode();
|
const auto mode = m_data->wrappedInput->echoMode();
|
||||||
|
|
|
@ -15,6 +15,20 @@ class QSK_EXPORT QskTextInput : public QskAbstractTextInput
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
Q_PROPERTY( QString displayText READ displayText NOTIFY displayTextChanged )
|
||||||
|
|
||||||
|
Q_PROPERTY( int maximumLength READ maxLength
|
||||||
|
WRITE setMaxLength NOTIFY maximumLengthChanged )
|
||||||
|
|
||||||
|
Q_PROPERTY( QString inputMask READ inputMask
|
||||||
|
WRITE setInputMask NOTIFY inputMaskChanged )
|
||||||
|
|
||||||
|
Q_PROPERTY( bool acceptableInput READ hasAcceptableInput
|
||||||
|
NOTIFY acceptableInputChanged)
|
||||||
|
|
||||||
|
Q_PROPERTY( bool autoScroll READ autoScroll
|
||||||
|
WRITE setAutoScroll NOTIFY autoScrollChanged )
|
||||||
|
|
||||||
Q_PROPERTY( EchoMode echoMode READ echoMode
|
Q_PROPERTY( EchoMode echoMode READ echoMode
|
||||||
WRITE setEchoMode NOTIFY echoModeChanged )
|
WRITE setEchoMode NOTIFY echoModeChanged )
|
||||||
|
|
||||||
|
@ -26,6 +40,9 @@ class QSK_EXPORT QskTextInput : public QskAbstractTextInput
|
||||||
WRITE setPasswordMaskDelay RESET resetPasswordMaskDelay
|
WRITE setPasswordMaskDelay RESET resetPasswordMaskDelay
|
||||||
NOTIFY passwordMaskDelayChanged )
|
NOTIFY passwordMaskDelayChanged )
|
||||||
|
|
||||||
|
Q_PROPERTY( QValidator* validator READ validator
|
||||||
|
WRITE setValidator NOTIFY validatorChanged )
|
||||||
|
|
||||||
using Inherited = QskAbstractTextInput;
|
using Inherited = QskAbstractTextInput;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -55,6 +72,9 @@ class QSK_EXPORT QskTextInput : public QskAbstractTextInput
|
||||||
QString inputMask() const;
|
QString inputMask() const;
|
||||||
void setInputMask( const QString& );
|
void setInputMask( const QString& );
|
||||||
|
|
||||||
|
bool autoScroll() const;
|
||||||
|
void setAutoScroll( bool );
|
||||||
|
|
||||||
EchoMode echoMode() const;
|
EchoMode echoMode() const;
|
||||||
void setEchoMode( EchoMode );
|
void setEchoMode( EchoMode );
|
||||||
|
|
||||||
|
@ -77,12 +97,17 @@ class QSK_EXPORT QskTextInput : public QskAbstractTextInput
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void maximumLengthChanged( int );
|
void maximumLengthChanged( int );
|
||||||
|
|
||||||
|
void autoScrollChanged( bool );
|
||||||
|
|
||||||
void echoModeChanged( EchoMode );
|
void echoModeChanged( EchoMode );
|
||||||
void passwordMaskDelayChanged();
|
void passwordMaskDelayChanged();
|
||||||
void passwordCharacterChanged();
|
void passwordCharacterChanged();
|
||||||
|
|
||||||
void validatorChanged();
|
void validatorChanged( const QValidator* );
|
||||||
void inputMaskChanged( const QString& );
|
void inputMaskChanged( const QString& );
|
||||||
|
void acceptableInputChanged( bool );
|
||||||
|
|
||||||
|
void displayTextChanged( const QString& );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class PrivateData;
|
class PrivateData;
|
||||||
|
|
|
@ -59,11 +59,15 @@ QSizeF QskTextInputSkinlet::sizeHint( const QskSkinnable* skinnable,
|
||||||
if ( which != Qt::PreferredSize )
|
if ( which != Qt::PreferredSize )
|
||||||
return QSizeF();
|
return QSizeF();
|
||||||
|
|
||||||
const auto text = static_cast< const QskTextInput* >( skinnable )->text();
|
const auto textInput = static_cast< const QskTextInput* >( skinnable );
|
||||||
|
|
||||||
const QFontMetricsF fm( skinnable->effectiveFont( Q::Text ) );
|
const QFontMetricsF fm( skinnable->effectiveFont( Q::Text ) );
|
||||||
|
|
||||||
auto hint = fm.size( Qt::TextSingleLine | Qt::TextExpandTabs, text );
|
#if 0
|
||||||
|
auto hint = QSizeF( textInput->unwrappedTextSize().width(), fm.height() );
|
||||||
|
#else
|
||||||
|
auto hint = fm.size( Qt::TextSingleLine | Qt::TextExpandTabs, textInput->text() );
|
||||||
|
#endif
|
||||||
|
|
||||||
hint = skinnable->outerBoxSize( Q::TextPanel, hint );
|
hint = skinnable->outerBoxSize( Q::TextPanel, hint );
|
||||||
hint = hint.expandedTo( skinnable->strutSizeHint( Q::TextPanel ) );
|
hint = hint.expandedTo( skinnable->strutSizeHint( Q::TextPanel ) );
|
||||||
|
|
Loading…
Reference in New Issue