47 #ifndef _MIRA_LINEEDITTEXTFORMAT_H_ 48 #define _MIRA_LINEEDITTEXTFORMAT_H_ 51 #include <QCoreApplication> 52 #include <QTextLayout> 80 QList<QInputMethodEvent::Attribute> attributes;
81 foreach(
const QTextLayout::FormatRange& fr, formats)
83 QInputMethodEvent::AttributeType
type = QInputMethodEvent::TextFormat;
84 int start = fr.start - lineEdit->cursorPosition();
85 int length = fr.length;
86 QVariant value = fr.format;
87 attributes.append(QInputMethodEvent::Attribute(
type, start, length, value));
89 QInputMethodEvent event(QString(), attributes);
90 QCoreApplication::sendEvent(lineEdit, &event);
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
PropertyHint type(const std::string &t)
Sets the attribute "type" to the specified value.
Definition: PropertyHint.h:295
void setLineEditTextFormat(QLineEdit *lineEdit, const QList< QTextLayout::FormatRange > &formats)
Allows to format the text of a QLineEdit.
Definition: LineEditTextFormat.h:76
void clearLineEditTextFormat(QLineEdit *lineEdit)
Removes all formatting instructions, set by the above method.
Definition: LineEditTextFormat.h:96