AlbumShaper  1.0a3
Signals | Public Member Functions | Protected Member Functions | Private Slots | Private Attributes
TextEdit Class Reference

#include <photoDescEdit.h>

Inheritance diagram for TextEdit:
Inheritance graph
[legend]
Collaboration diagram for TextEdit:
Collaboration graph
[legend]

List of all members.

Signals

void finished ()

Public Member Functions

 TextEdit (QWidget *parent=0, const char *name=0)
void paintNow ()

Protected Member Functions

void keyPressEvent (QKeyEvent *e)
void focusOutEvent (QFocusEvent *)
QPopupMenu * createPopupMenu (const QPoint &pos)

Private Slots

void contextMenuHiding ()

Private Attributes

QPopupMenu * contextMenu

Detailed Description

Definition at line 126 of file photoDescEdit.h.


Constructor & Destructor Documentation

TextEdit::TextEdit ( QWidget parent = 0,
const char *  name = 0 
)

Definition at line 565 of file photoDescEdit.cpp.

References contextMenu.

                                                      : QTextEdit(parent,name) 
{ 
  setHScrollBarMode( QScrollView::AlwaysOff );
  setTextFormat( Qt::PlainText );
  contextMenu = NULL;
}

Member Function Documentation

void TextEdit::contextMenuHiding ( ) [private, slot]

Definition at line 612 of file photoDescEdit.cpp.

References contextMenu.

Referenced by createPopupMenu().

{
  //clear context menu handle since it's disappearing
  disconnect( ((QObject*)contextMenu), SIGNAL(aboutToHide()),
              this, SLOT(contextMenuHiding()) );
  contextMenu = NULL;
}
QPopupMenu * TextEdit::createPopupMenu ( const QPoint &  pos) [protected]

Definition at line 603 of file photoDescEdit.cpp.

References contextMenu, and contextMenuHiding().

{
  //when context menu's are created store their handle
  contextMenu = QTextEdit::createPopupMenu( pos );
  connect( ((QObject*)contextMenu), SIGNAL(aboutToHide()),
           this, SLOT(contextMenuHiding()) );
  return contextMenu;
}
void TextEdit::finished ( ) [signal]

Referenced by focusOutEvent(), and keyPressEvent().

void TextEdit::focusOutEvent ( QFocusEvent *  ) [protected]

Definition at line 596 of file photoDescEdit.cpp.

References contextMenu, and finished().

{
  //if user right clicked on text field a context menu is popping up so ignore focusOut.
  //otherwise user has clicked off photo description so close
  if( contextMenu == NULL ) emit finished();
}
void TextEdit::keyPressEvent ( QKeyEvent *  e) [protected]

Definition at line 578 of file photoDescEdit.cpp.

References finished().

{
  //finish when user hits escape
  if( e->key() == Qt::Key_Escape )
  {
    emit finished();
  }
  //if Ctrl+A then select all text, otherwise, apply base class key press rules
  else if( (e->state() & Qt::ControlButton) && e->key() == Qt::Key_A )
  {
    selectAll();
  }
  else
  {
    QTextEdit::keyPressEvent( e );
  }
}
void TextEdit::paintNow ( )

Definition at line 572 of file photoDescEdit.cpp.

Referenced by PhotoDescEdit::PhotoDescEdit().

{
  constPolish();
  repaint( rect(), false );
}

Member Data Documentation

QPopupMenu* TextEdit::contextMenu [private]

Definition at line 135 of file photoDescEdit.h.

Referenced by contextMenuHiding(), createPopupMenu(), focusOutEvent(), and TextEdit().


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