[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeutils/kregexpeditor
From:       Bram Schoenmakers <bramschoenmakers () kde ! nl>
Date:       2005-04-07 7:11:59
Message-ID: 20050407071159.B0EC8485 () office ! kde ! org
[Download RAW message or body]

CVS commit by bram: 

Add clear button to ASCII regexp lineedit.


  M +9 -0      kregexpeditorprivate.cpp   1.34
  M +3 -1      kregexpeditorprivate.h   1.18


--- kdeutils/kregexpeditor/kregexpeditorprivate.cpp  #1.33:1.34
@@ -28,4 +28,6 @@
 
 #include <qlineedit.h>
+#include <qtooltip.h>
+#include <qtoolbutton.h>
 #include "kregexpeditorprivate.h"
 #include "scrollededitorwindow.h"
@@ -156,4 +158,10 @@ KRegExpEditorPrivate::KRegExpEditorPriva
   QLabel* label = new QLabel( i18n("ASCII syntax:"), this );
   layout->addWidget( label );
+  clearButton = new QToolButton( this );
+  QCString icon = QApplication::reverseLayout() ? "clear_left" : "locationbar_erase";
+  QIconSet clearIcon = SmallIconSet( icon );
+  clearButton->setIconSet( clearIcon );
+  layout->addWidget( clearButton );
+  QToolTip::add( clearButton, i18n("Clear expression") );
   _regexpEdit = new QLineEdit( this );
   layout->addWidget( _regexpEdit );
@@ -179,4 +187,5 @@ KRegExpEditorPrivate::KRegExpEditorPriva
   connect( _regexpEdit, SIGNAL(textChanged( const QString& ) ), this, SLOT( slotTriggerUpdate() ) );
   connect( _timer, SIGNAL( timeout() ), this, SLOT( slotTimeout() ) );
+  connect( clearButton, SIGNAL( clicked() ), _regexpEdit, SLOT( clear() ) );
 
   // Push an initial empty element on the stack.

--- kdeutils/kregexpeditor/kregexpeditorprivate.h  #1.17:1.18
@@ -36,9 +36,10 @@ class RegExpLineEdit;
 class RegExpConverter;
 class RegExpButtons;
+class QToolButton;
 
 /**
    Widget used to build a regular expression
 
-   @author Jesper Kjær Pedersen <blackie@kde.org>
+   @author Jesper K. Pedersen <blackie@kde.org>
    @version 0.1
 **/
@@ -99,4 +100,5 @@ private:
     bool _autoVerify;
     ErrorMap _errorMap;
+    QToolButton *clearButton;
 };
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic