Back to index

texmacs  1.0.7.15
Public Slots | Public Member Functions | Public Attributes | Private Attributes
QTMInputTextWidgetHelper Class Reference

#include <QTMMenuHelper.hpp>

Collaboration diagram for QTMInputTextWidgetHelper:
Collaboration graph
[legend]

List of all members.

Public Slots

void commit ()
void leave ()
void remove (QObject *)
void doit ()

Public Member Functions

 QTMInputTextWidgetHelper (qt_input_text_widget_rep *_wid)
 ~QTMInputTextWidgetHelper ()
qt_input_text_widget_repwid ()
void add (QLineEdit *)

Public Attributes

QList< QLineEdit * > views

Private Attributes

widget p_wid
 A reference to the tm widget, always a qt_input_text_widget_rep.
bool done

Detailed Description

Definition at line 114 of file QTMMenuHelper.hpp.


Constructor & Destructor Documentation

Definition at line 125 of file QTMMenuHelper.hpp.

    : QObject(NULL), p_wid(abstract(_wid)), done(false) { }

Definition at line 64 of file QTMMenuHelper.cpp.

                                                    {
  //cout << "deleting" << LF;
  // remove refernce to helper in the texmacs widget
  wid()->helper = NULL;
  // if needed the texmacs widget is automatically deleted
}

Here is the call graph for this function:


Member Function Documentation

void QTMInputTextWidgetHelper::add ( QLineEdit *  obj)

Definition at line 106 of file QTMMenuHelper.cpp.

                                            {
  if (!views.contains (obj)) {
    QObject::connect (obj, SIGNAL(destroyed (QObject*)), this, SLOT(remove (QObject*)));
    views << obj;
  }
}

Here is the call graph for this function:

Definition at line 73 of file QTMMenuHelper.cpp.

                                  {
  QLineEdit *le = qobject_cast <QLineEdit*> (sender());
  if (le) {
    //    le -> setFrame(false);
    wid()->ok = true;
    done = false;
    wid () -> text = from_qstring (le -> text());
  }
}

Here is the call graph for this function:

Definition at line 116 of file QTMMenuHelper.cpp.

                                {
  if (done) return;
  done = true;
#if 0
  if (wid()->ok) 
    cout << "Committing: " << wid () -> text << LF;
  else 
    cout << "Leaving with text: " << wid () -> text << LF;
#endif
#if 0
  wid () -> cmd (wid()->ok ? list_object (object (wid() -> text)) : 
                 list_object (object (false)));
#else
  the_gui -> process_command(wid()->cmd, wid()->ok ? list_object (object (wid() -> text)) : 
                             list_object (object (false)));
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 84 of file QTMMenuHelper.cpp.

                                 {
  // this is executed after commit
  // and when losing focus
  QLineEdit *le = qobject_cast <QLineEdit*> (sender());  
  if (le) {
    // reset the text according to the texmacs widget
    le -> setText (to_qstring (wid () -> text));
    //ok = false;
    QTimer::singleShot (0, this, SLOT (doit ()));
  }
}

Here is the call graph for this function:

void QTMInputTextWidgetHelper::remove ( QObject *  obj) [slot]

Definition at line 97 of file QTMMenuHelper.cpp.

                                              {
  views.removeAll (qobject_cast<QLineEdit*> (obj));
  if (views.count () == 0) {
    // no more view, free the helper 
    deleteLater();
  }
}

Definition at line 129 of file QTMMenuHelper.hpp.

    { return (qt_input_text_widget_rep*) p_wid.rep; }

Here is the caller graph for this function:


Member Data Documentation

Definition at line 119 of file QTMMenuHelper.hpp.

A reference to the tm widget, always a qt_input_text_widget_rep.

Definition at line 117 of file QTMMenuHelper.hpp.

Definition at line 123 of file QTMMenuHelper.hpp.


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