AlbumShaper  1.0a3
Signals | Public Member Functions | Protected Member Functions | Private Slots | Private Attributes | List of all members
TextEdit Class Reference

#include <photoDescEdit.h>

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

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 *)
 
Q3PopupMenu * createPopupMenu (const QPoint &pos)
 

Private Slots

void contextMenuHiding ()
 

Private Attributes

Q3PopupMenu * contextMenu
 

Detailed Description

Definition at line 133 of file photoDescEdit.h.

Constructor & Destructor Documentation

§ TextEdit()

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

Definition at line 572 of file photoDescEdit.cpp.

References contextMenu.

572  : Q3TextEdit(parent,name)
573 {
574  setHScrollBarMode( Q3ScrollView::AlwaysOff );
575  setTextFormat( Qt::PlainText );
576  contextMenu = NULL;
577 }
Q3PopupMenu * contextMenu

Member Function Documentation

§ contextMenuHiding

void TextEdit::contextMenuHiding ( )
privateslot

Definition at line 619 of file photoDescEdit.cpp.

References contextMenu.

Referenced by createPopupMenu().

620 {
621  //clear context menu handle since it's disappearing
622  disconnect( ((QObject*)contextMenu), SIGNAL(aboutToHide()),
623  this, SLOT(contextMenuHiding()) );
624  contextMenu = NULL;
625 }
void contextMenuHiding()
Q3PopupMenu * contextMenu

§ createPopupMenu()

Q3PopupMenu * TextEdit::createPopupMenu ( const QPoint &  pos)
protected

Definition at line 610 of file photoDescEdit.cpp.

References contextMenu, and contextMenuHiding().

611 {
612  //when context menu's are created store their handle
613  contextMenu = Q3TextEdit::createPopupMenu( pos );
614  connect( ((QObject*)contextMenu), SIGNAL(aboutToHide()),
615  this, SLOT(contextMenuHiding()) );
616  return contextMenu;
617 }
void contextMenuHiding()
Q3PopupMenu * contextMenu

§ finished

void TextEdit::finished ( )
signal

Referenced by focusOutEvent(), and keyPressEvent().

§ focusOutEvent()

void TextEdit::focusOutEvent ( QFocusEvent *  )
protected

Definition at line 603 of file photoDescEdit.cpp.

References contextMenu, and finished().

604 {
605  //if user right clicked on text field a context menu is popping up so ignore focusOut.
606  //otherwise user has clicked off photo description so close
607  if( contextMenu == NULL ) emit finished();
608 }
void finished()
Q3PopupMenu * contextMenu

§ keyPressEvent()

void TextEdit::keyPressEvent ( QKeyEvent *  e)
protected

Definition at line 585 of file photoDescEdit.cpp.

References finished().

586 {
587  //finish when user hits escape
588  if( e->key() == Qt::Key_Escape )
589  {
590  emit finished();
591  }
592  //if Ctrl+A then select all text, otherwise, apply base class key press rules
593  else if( (e->state() & Qt::ControlModifier) && e->key() == Qt::Key_A )
594  {
595  selectAll();
596  }
597  else
598  {
599  Q3TextEdit::keyPressEvent( e );
600  }
601 }
void finished()

§ paintNow()

void TextEdit::paintNow ( )

Definition at line 579 of file photoDescEdit.cpp.

Referenced by PhotoDescEdit::PhotoDescEdit().

580 {
581  constPolish();
582  repaint( rect(), false );
583 }

Member Data Documentation

§ contextMenu

Q3PopupMenu* TextEdit::contextMenu
private

Definition at line 142 of file photoDescEdit.h.

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


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