mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Improve last comit
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4955 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -128,17 +128,6 @@ void ElementsCollectionWidget::setCurrentLocation(const ElementsLocation &locati
|
||||
m_tree_view->setCurrentIndex(m_model->indexFromLocation(location));
|
||||
}
|
||||
|
||||
bool ElementsCollectionWidget::event(QEvent *event)
|
||||
{
|
||||
if (m_first_show && event->type() == QEvent::Show)
|
||||
{
|
||||
m_first_show = false;
|
||||
QTimer::singleShot(250, this, SLOT(reload()));
|
||||
}
|
||||
|
||||
return QWidget::event(event);
|
||||
}
|
||||
|
||||
void ElementsCollectionWidget::leaveEvent(QEvent *event)
|
||||
{
|
||||
if (QETDiagramEditor *qde = QETApp::diagramEditorAncestorOf(this))
|
||||
|
||||
@@ -54,7 +54,6 @@ class ElementsCollectionWidget : public QWidget
|
||||
void setCurrentLocation(const ElementsLocation &location);
|
||||
|
||||
protected:
|
||||
virtual bool event(QEvent *event);
|
||||
virtual void leaveEvent(QEvent *event);
|
||||
|
||||
private:
|
||||
@@ -78,7 +77,7 @@ class ElementsCollectionWidget : public QWidget
|
||||
void showAndExpandItem (const QModelIndex &index, bool parent = true, bool child = false);
|
||||
ElementCollectionItem *elementCollectionItemForIndex (const QModelIndex &index);
|
||||
|
||||
private slots:
|
||||
public slots:
|
||||
void reload();
|
||||
|
||||
private:
|
||||
|
||||
@@ -671,20 +671,30 @@ void QETDiagramEditor::closeEvent(QCloseEvent *qce) {
|
||||
}
|
||||
|
||||
/**
|
||||
Gere les evenements du l'editeur de schema
|
||||
Reimplemente ici pour :
|
||||
* eviter un conflit sur le raccourci clavier "Ctrl+W" (QKeySequence::Close)
|
||||
@param e Evenement
|
||||
*/
|
||||
bool QETDiagramEditor::event(QEvent *e) {
|
||||
if (e -> type() == QEvent::ShortcutOverride) {
|
||||
* @brief QETDiagramEditor::event
|
||||
* Reimplemented to :
|
||||
* -avoid conflic with shortcut "Ctrl+W" (QKeySequence::Close)
|
||||
* -Load elements collection when WindowActivate.
|
||||
* @param e
|
||||
* @return
|
||||
*/
|
||||
bool QETDiagramEditor::event(QEvent *e)
|
||||
{
|
||||
if (e -> type() == QEvent::ShortcutOverride)
|
||||
{
|
||||
QKeyEvent *shortcut_event = static_cast<QKeyEvent *>(e);
|
||||
if (shortcut_event && shortcut_event -> matches(QKeySequence::Close)) {
|
||||
if (shortcut_event && shortcut_event -> matches(QKeySequence::Close))
|
||||
{
|
||||
close_file -> trigger();
|
||||
e -> accept();
|
||||
return(true);
|
||||
}
|
||||
}
|
||||
if (m_first_show && e->type() == QEvent::WindowActivate)
|
||||
{
|
||||
m_first_show = false;
|
||||
QTimer::singleShot(250, m_element_collection_widget, SLOT(reload()));
|
||||
}
|
||||
return(QETMainWindow::event(e));
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class QETDiagramEditor : public QETMainWindow {
|
||||
bool drawGrid() const;
|
||||
|
||||
protected:
|
||||
virtual bool event(QEvent *);
|
||||
virtual bool event(QEvent *);
|
||||
|
||||
private:
|
||||
bool addProject(QETProject *, bool = true);
|
||||
@@ -239,5 +239,6 @@ class QETDiagramEditor : public QETMainWindow {
|
||||
// AutoNumbering Selection Dock
|
||||
AutoNumberingDockWidget *m_autonumbering_dock;
|
||||
int activeSubWindowIndex;
|
||||
bool m_first_show = true;
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user