Implemented QETMainWindow::firstActivation, used it to fit view when editing an element.

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.3@1573 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavier
2012-03-16 18:01:32 +00:00
parent a92bfa5e29
commit 87d3021bd3
6 changed files with 29 additions and 12 deletions

View File

@@ -35,7 +35,6 @@ QETTitleBlockTemplateEditor::QETTitleBlockTemplateEditor(QWidget *parent) :
opened_from_file_(false),
read_only_(false),
duplicate_(false),
first_activation_(true),
tb_template_(0),
logo_manager_(0)
{
@@ -108,15 +107,12 @@ bool QETTitleBlockTemplateEditor::canClose() {
/**
@param event Object describing the received event.
*/
bool QETTitleBlockTemplateEditor::event(QEvent *event) {
if (first_activation_ && event -> type() == QEvent::WindowActivate) {
if (duplicate_ && !opened_from_file_ && location_.parentCollection()) {
// this editor is supposed to duplicate its current location
QTimer::singleShot(250, this, SLOT(duplicateCurrentLocation()));
}
first_activation_ = false;
void QETTitleBlockTemplateEditor::firstActivation(QEvent *event) {
Q_UNUSED(event)
if (duplicate_ && !opened_from_file_ && location_.parentCollection()) {
// this editor is supposed to duplicate its current location
QTimer::singleShot(250, this, SLOT(duplicateCurrentLocation()));
}
return(QETMainWindow::event(event));
}
/**