Back to index

texmacs  1.0.7.15
Public Member Functions | Public Attributes | Protected Member Functions
QTMLineEdit Class Reference
Collaboration diagram for QTMLineEdit:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 QTMLineEdit (QWidget *parent, string _ww)
virtual QSize sizeHint () const

Public Attributes

string ww

Protected Member Functions

void keyPressEvent (QKeyEvent *event)
void focusInEvent (QFocusEvent *evenement)

Detailed Description

Definition at line 358 of file qt_dialogues.cpp.


Constructor & Destructor Documentation

QTMLineEdit::QTMLineEdit ( QWidget *  parent,
string  _ww 
) [inline]

Definition at line 363 of file qt_dialogues.cpp.

  : QLineEdit (parent), ww (_ww) {
    setStyle (qtmstyle());
    QPalette pal (palette());
    pal.setColor (QPalette::Base, QColor (252, 252, 248));
    setPalette (pal);
  };

Here is the call graph for this function:


Member Function Documentation

void QTMLineEdit::focusInEvent ( QFocusEvent *  evenement) [protected]

Definition at line 432 of file qt_dialogues.cpp.

{
  setCursorPosition (text().size());
//  selectAll ();
  QLineEdit::focusInEvent (event);
}
void QTMLineEdit::keyPressEvent ( QKeyEvent *  event) [protected]

Definition at line 379 of file qt_dialogues.cpp.

{
  QCompleter *c = completer();
  // reset completion
  if (c) c->setCompletionPrefix (QString ());

  if (event->key() == Qt::Key_Up){
    if (c) {
      int row = c->currentRow();
      c->setCurrentRow(row-1);
      setText(c->currentCompletion());
    }
    event->accept();
    // move back in history
  } else if (event->key() == Qt::Key_Down){
    if (c) {
      int row = c->currentRow();
      c->setCurrentRow(row+1);
      setText(c->currentCompletion());
    }
    event->accept();
    // move forward in history
  } else if (event->key() == Qt::Key_Escape){
    emit editingFinished();
    event->accept();
    // exit editing
  }
  else {
    // default handler for event
    QLineEdit::keyPressEvent(event);
  }
}
QSize QTMLineEdit::sizeHint ( ) const [virtual]

Definition at line 413 of file qt_dialogues.cpp.

                             {
  QSize sz(QLineEdit::sizeHint());
  string s = ww; // to avoid const casting
  if (ends (s, "w") && is_double (s (0, N(s) - 1)) && parentWidget()) {
    double x= as_double (s (0, N(s) - 1));
    sz.setWidth(parentWidget()->width() * x);
//    ev->w= max (ev->w, (4 * fn->wquad + 2*dw) / SHRINK);
  } else if (ends (s, "em") && is_double (s (0, N(s) - 2))) {
    double x= as_double (s (0, N(s) - 2));
    QFontMetrics fm(fontMetrics());
    sz.setWidth(x*fm.width("m")); //FIXME: put real font width
  }  else if (ends (s, "px") && is_double (s (0, N(s) - 2))) {
    double x= as_double (s (0, N(s) - 2));
    sz.setWidth(x);
  }  
  return sz;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 361 of file qt_dialogues.cpp.


The documentation for this class was generated from the following file: