@@ -22,6 +22,10 @@ class QSearchField : public QWidget {
|
||||
|
||||
QString text() const;
|
||||
QString placeholderText() const;
|
||||
|
||||
#ifndef Q_OS_MACOS
|
||||
bool hasFocus() const;
|
||||
#endif
|
||||
void setFocus(Qt::FocusReason);
|
||||
|
||||
public slots:
|
||||
|
||||
@@ -131,6 +131,11 @@ QString QSearchField::placeholderText() const {
|
||||
return pimpl->lineedit_->placeholderText();
|
||||
}
|
||||
|
||||
bool QSearchField::hasFocus() const {
|
||||
Q_ASSERT(pimpl && pimpl->lineedit_);
|
||||
return pimpl && pimpl->lineedit_ && pimpl->lineedit_->hasFocus();
|
||||
}
|
||||
|
||||
void QSearchField::setFocus(Qt::FocusReason reason) {
|
||||
Q_ASSERT(pimpl && pimpl->lineedit_);
|
||||
if (pimpl && pimpl->lineedit_) pimpl->lineedit_->setFocus(reason);
|
||||
|
||||
Reference in New Issue
Block a user