Changeset 4454

Show
Ignore:
Timestamp:
06/28/06 03:35:50 (2 years ago)
Author:
erijo
Message:

Added alternatives for cut, copy and paste:

  • cut: Shift+Delete
  • copy: Ctrl+Insert
  • paste: Shift+Insert

Closes #765.

Location:
trunk/qt-gui/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/qt-gui/src/ewidgets.cpp

    r4388 r4454  
    696696} 
    697697 
     698void CInfoField::keyPressEvent(QKeyEvent *e) 
     699{ 
     700  const bool isShift   = e->state() & ShiftButton; 
     701  const bool isControl = e->state() & ControlButton; 
     702 
     703  if (isShift && e->key() == Key_Insert) 
     704    return paste(); 
     705 
     706  if (isShift && e->key() == Key_Delete) 
     707    return cut(); 
     708 
     709  if (isControl && e->key() == Key_Insert) 
     710    return copy(); 
     711 
     712  QLineEdit::keyPressEvent(e); 
     713} 
    698714 
    699715 
  • trunk/qt-gui/src/ewidgets.h

    r4388 r4454  
    154154  void SetReadOnly(bool); 
    155155protected: 
     156  virtual void keyPressEvent(QKeyEvent *e); 
    156157  QColor baseRO, baseRW; 
    157158}; 
  • trunk/qt-gui/src/mledit.cpp

    r3011 r4454  
    5454                 this, SIGNAL(signal_CtrlEnterPressed())); 
    5555 
    56   if (editFont) QWidget::setFont(*editFont, true); 
     56  if (editFont) 
     57    QWidget::setFont(*editFont, true); 
    5758} 
    5859 
     
    123124bool MLEditWrap::focusNextPrevChild( bool f) 
    124125{ 
    125     return QWidget::focusNextPrevChild(f); 
     126  return QWidget::focusNextPrevChild(f); 
    126127} 
    127128 
     
    155156void MLEditWrap::keyPressEvent( QKeyEvent *e ) 
    156157{ 
    157   if(e->state() & ControlButton) { 
    158     switch(e->key()) { 
     158  const bool isShift   = e->state() & ShiftButton; 
     159  const bool isControl = e->state() & ControlButton; 
     160 
     161  if (isShift && e->key() == Key_Insert) 
     162    return paste(); 
     163 
     164  if (isShift && e->key() == Key_Delete) 
     165    return cut(); 
     166 
     167  if (isControl && e->key() == Key_Insert) 
     168    return copy(); 
     169 
     170  if (isControl) 
     171  { 
     172    switch (e->key()) 
     173    { 
    159174    case Key_W: 
    160175      cursorWordBackward(true);