AlbumShaper 1.0a3
TextEdit Class Reference

#include <photoDescEdit.h>

Inheritance diagram for TextEdit:
Collaboration diagram for TextEdit:

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.

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

References contextMenu.

Member Function Documentation

◆ contextMenuHiding

void TextEdit::contextMenuHiding ( )
privateslot

Definition at line 619 of file photoDescEdit.cpp.

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()

References contextMenu, and contextMenuHiding().

Referenced by contextMenuHiding(), and createPopupMenu().

◆ createPopupMenu()

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

Definition at line 610 of file photoDescEdit.cpp.

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}

References contextMenu, and contextMenuHiding().

◆ finished

void TextEdit::finished ( )
signal

Referenced by focusOutEvent(), and keyPressEvent().

◆ focusOutEvent()

void TextEdit::focusOutEvent ( QFocusEvent * )
protected

Definition at line 603 of file photoDescEdit.cpp.

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()

References contextMenu, and finished().

◆ keyPressEvent()

void TextEdit::keyPressEvent ( QKeyEvent * e)
protected

Definition at line 585 of file photoDescEdit.cpp.

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}

References finished().

◆ paintNow()

void TextEdit::paintNow ( )

Definition at line 579 of file photoDescEdit.cpp.

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

Referenced by PhotoDescEdit::PhotoDescEdit().

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: