Mercurial > projects > qtd
diff demos/browser/searchlineedit.d @ 73:7bfd46c330dc
more porting
author | mandel |
---|---|
date | Fri, 22 May 2009 10:59:00 +0000 |
parents | b149ef2cb18b |
children | 37caa90ce503 |
line wrap: on
line diff
--- a/demos/browser/searchlineedit.d Wed May 20 22:44:31 2009 +0000 +++ b/demos/browser/searchlineedit.d Fri May 22 10:59:00 2009 +0000 @@ -41,6 +41,7 @@ module searchlineedit; + import urllineedit; import qt.gui.QLineEdit; @@ -51,19 +52,12 @@ import qt.gui.QStyle; import qt.gui.QStyleOptionFrameV2; -/* -QT_BEGIN_NAMESPACE -class QMenu; -QT_END_NAMESPACE - -class SearchButton; -*/ /* - Clear button on the right hand side of the search widget. - Hidden by default - "A circle with an X in it" - */ +Clear button on the right hand side of the search widget. +Hidden by default +"A circle with an X in it" +*/ class ClearButton : public QAbstractButton { public: @@ -108,8 +102,8 @@ Search icon on the left hand side of the search widget When a menu is set a down arrow appears */ -class SearchButton : public QAbstractButton { - +class SearchButton : public QAbstractButton +{ public: SearchButton(QWidget parent = null) @@ -160,6 +154,7 @@ QMenu m_menu; protected: + void mousePressEvent(QMouseEvent event) { if (m_menu && event.button() == Qt.LeftButton) { @@ -176,17 +171,16 @@ class SearchLineEdit : public ExLineEdit { - //Q_PROPERTY(QString inactiveText READ inactiveText WRITE setInactiveText) - mixin Signal!("textChanged", QString &text); public: -/* - SearchLineEdit is an enhanced QLineEdit - - A Search icon on the left with optional menu - - When there is no text and doesn't have focus an "inactive text" is displayed - - When there is text a clear button is displayed on the right hand side - */ + + /* + SearchLineEdit is an enhanced QLineEdit + - A Search icon on the left with optional menu + - When there is no text and doesn't have focus an "inactive text" is displayed + - When there is text a clear button is displayed on the right hand side + */ this(QWidget parent = null) : ExLineEdit(parent) { m_searchButton = new SearchButton(this); @@ -227,6 +221,7 @@ } protected: + void resizeEvent(QResizeEvent event) { updateGeometries();