#include <photoDescEdit.h>
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 |
Definition at line 126 of file photoDescEdit.h.
TextEdit::TextEdit | ( | QWidget * | parent = 0 , |
|
const char * | name = 0 | |||
) |
Definition at line 565 of file photoDescEdit.cpp.
References contextMenu.
00565 : QTextEdit(parent,name) 00566 { 00567 setHScrollBarMode( QScrollView::AlwaysOff ); 00568 setTextFormat( Qt::PlainText ); 00569 contextMenu = NULL; 00570 }
void TextEdit::contextMenuHiding | ( | ) | [private, slot] |
Definition at line 612 of file photoDescEdit.cpp.
References contextMenu.
Referenced by createPopupMenu().
00613 { 00614 //clear context menu handle since it's disappearing 00615 disconnect( ((QObject*)contextMenu), SIGNAL(aboutToHide()), 00616 this, SLOT(contextMenuHiding()) ); 00617 contextMenu = NULL; 00618 }
QPopupMenu * TextEdit::createPopupMenu | ( | const QPoint & | pos | ) | [protected] |
Definition at line 603 of file photoDescEdit.cpp.
References contextMenu, and contextMenuHiding().
00604 { 00605 //when context menu's are created store their handle 00606 contextMenu = QTextEdit::createPopupMenu( pos ); 00607 connect( ((QObject*)contextMenu), SIGNAL(aboutToHide()), 00608 this, SLOT(contextMenuHiding()) ); 00609 return contextMenu; 00610 }
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().
00597 { 00598 //if user right clicked on text field a context menu is popping up so ignore focusOut. 00599 //otherwise user has clicked off photo description so close 00600 if( contextMenu == NULL ) emit finished(); 00601 }
void TextEdit::keyPressEvent | ( | QKeyEvent * | e | ) | [protected] |
Definition at line 578 of file photoDescEdit.cpp.
References finished().
00579 { 00580 //finish when user hits escape 00581 if( e->key() == Qt::Key_Escape ) 00582 { 00583 emit finished(); 00584 } 00585 //if Ctrl+A then select all text, otherwise, apply base class key press rules 00586 else if( (e->state() & Qt::ControlButton) && e->key() == Qt::Key_A ) 00587 { 00588 selectAll(); 00589 } 00590 else 00591 { 00592 QTextEdit::keyPressEvent( e ); 00593 } 00594 }
void TextEdit::paintNow | ( | ) |
Definition at line 572 of file photoDescEdit.cpp.
Referenced by PhotoDescEdit::PhotoDescEdit().
QPopupMenu* TextEdit::contextMenu [private] |
Definition at line 135 of file photoDescEdit.h.
Referenced by contextMenuHiding(), createPopupMenu(), focusOutEvent(), and TextEdit().