New class KHistoryDoubleNumInput

sebastian sebastian.bw at freenet.de
Mon Apr 2 18:26:42 BST 2007


I post this, because of a hint from kde-devel at kde.org to descuss it here.

Tested with KDE-3.5.6
It's a new class no patch !

KHistoryDoubleNumInput extends KDoubleNumInput class by a KCompletionBox for 
history input selection.

If the Mousecursor is over KHistoryDoubleNumInput:
 -The mouse will be grabbed if KCompletionBox has min. one entry.
 -MouseTracking is then active. If mouse position is out of this Widget the
  mouse will be released for QT.
 -The pop-up menu will be shown if you press a mousebutton and KCompletionBox
  has min. one entry.
 -If the KCompletionBox has min. one entry it uses one click for pop-up and
  one for close, until KHistoryDoubleNumInput works like KDoubleNumInput
  again. The second click can be double to select all for overwriting.
 -An entry will be stored if you enter something with the keyboard that's not
  exactly greater or less than one step.
 -Values entered with the SpinBox won't be stored because of that.
 -If KCompletionBox has no entry, KHistoryDoubleNumInput will behave like
  KDoubleNumInput.
 -By pressing a mouse key and moveing on a KHistoryDoubleNumInput the
  KCompletionBox won't be activated at all. So drag and drop is possible.
 
The SpinBox value can't be compared with the value I stored plus/minus the 
step of the SpinBox, for filtering, so I have to make them proper.
 
I think this is the most compact form for history extension, and it is good to 
handle. I was thinking about an overloaded version with a pulldown button for 
history but that would have made KHistoryDoubleNumInput too wide.

It's in separate class files, that you can test and change it better and I 
think knuminput gets now a little too big.
---------------------------------------------------

This class relays on KDoubleNumInput's widget (area) and on QT (mouse)events. 
So this class will work on all versions of KDoubleNumInput and KDE.
So this class can be used with KDE-4.x, KDE-3.x, KDE-2.x and should work on 
each app. that has a KDoubleNumInput and wants a history.

 Dependences:
- KDoubleNumInput::value()
- KDoubleNumInput::setValue()
- KDoubleNumInput::valueChanged( double ) [signal]
- KCompletionBox::activated( const QString & ) [signal]
- QWidget::releaseMouse()
- QWidget::enterEvent( QEvent * )
- QWidget::leaveEvent( QEvent * )
- QWidget::setFocus()
- QWidget::clearFocus()
- QWidget::mousePressEvent( QMouseEvent * )
- QWidget::mouseMoveEvent( QMouseEvent * )
- QWidget::mouseReleaseEvent( QMouseEvent * )
- QString::toDouble()


Now is the question if it should be included to kde-x/kdelibs-x/kdeui/ ?
And if it is handy, comfortable ?

              Sebastian Beck

from:
Germany/BW/Enzkreis/Stein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: khistorydoublenumInput.cpp
Type: text/x-c++src
Size: 4613 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070402/6613c0fe/attachment.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: khistorydoublenumInput.h
Type: text/x-c++hdr
Size: 2209 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070402/6613c0fe/attachment.h>


More information about the kde-core-devel mailing list