More fixes for the selection & inspector mechanisms.

* Bug: In Common.h, makes the INSPECTOR_PV_SUPPORT to generate a getRecord()
    by *value* instead of *by reference*. Seems the overload resolution
    system has changed and discriminate between them using now the exact
    match.
      This was causing InspectorWidget::setRootoccurrence() to fail, the
    getRecord(Occurrence) not corectly resolved always returning NULL.
* Change: In Occurrence, now use INSPECTOR_PV_SUPPORT (instead of PR).
* Change: In SelectionPopup, added a _cellWidget attribute to be able
    to call setShowSelection() in ::mouseReleaseEvent(), same as for
    SelectCommand.
* Bug: In SelectionWidget::changeSelectionMode(), reset the _updateState
    to ExternalEmit in *all cases* at the end of the function call.
    Failing to do that was another cause for the selection check box
    to desinchronize.
This commit is contained in:
Jean-Paul Chaput 2021-11-09 10:53:56 +01:00
parent f5bfeb3eae
commit fcf6ec97c3
14 changed files with 153 additions and 152 deletions

View File

@ -993,6 +993,15 @@ inline Hurricane::Record* getRecord ( const std::multiset<Element,Compare>* s )
GETRECORD_REFERENCE_SUPPORT(Data) GETRECORD_REFERENCE_SUPPORT(Data)
# define INSPECTOR_PV_SUPPORT(Data) \
GETSTRING_POINTER_SUPPORT(Data) \
GETSTRING_VALUE_SUPPORT(Data) \
IOSTREAM_POINTER_SUPPORT(Data) \
IOSTREAM_VALUE_SUPPORT(Data) \
GETRECORD_POINTER_SUPPORT(Data) \
GETRECORD_VALUE_SUPPORT(Data)
#include "hurricane/Tabulation.h" #include "hurricane/Tabulation.h"

View File

@ -124,7 +124,7 @@ class JsonOccurrence : public JsonObject {
} // End of Hurricane namespace. } // End of Hurricane namespace.
INSPECTOR_PR_SUPPORT(Hurricane::Occurrence); INSPECTOR_PV_SUPPORT(Hurricane::Occurrence);
#endif // HURRICANE_OCCURENCE #endif // HURRICANE_OCCURENCE

View File

@ -1281,6 +1281,7 @@ namespace Hurricane {
void CellWidget::setShowSelection ( bool state ) void CellWidget::setShowSelection ( bool state )
{ {
//cerr << "CellWidget::setShowSelection(): " << state << " vs. " << _state->showSelection() << endl;
if ( state != _state->showSelection() ) { if ( state != _state->showSelection() ) {
_state->setShowSelection ( state ); _state->setShowSelection ( state );
_selectionHasChanged = false; _selectionHasChanged = false;
@ -2796,7 +2797,6 @@ namespace Hurricane {
if ( occurrence.getOwnerCell() != getCell() ) if ( occurrence.getOwnerCell() != getCell() )
throw Error( "CellWidget::toggleSelection(): Occurrence do not belong to the loaded cell." ); throw Error( "CellWidget::toggleSelection(): Occurrence do not belong to the loaded cell." );
cerr << "CellWidget::toggleSelection() " << occurrence << endl;
Property* property = occurrence.getProperty( Selector::getPropertyName() ); Property* property = occurrence.getProperty( Selector::getPropertyName() );
Selector* selector = NULL; Selector* selector = NULL;
if (not property) { if (not property) {

View File

@ -51,6 +51,7 @@ namespace Hurricane {
} }
void Command::setCellWidget ( CellWidget* widget ) { _cellWidget=widget; }
void Command::wheelEvent ( QWheelEvent* ) { } void Command::wheelEvent ( QWheelEvent* ) { }
void Command::keyPressEvent ( QKeyEvent* ) { } void Command::keyPressEvent ( QKeyEvent* ) { }
void Command::keyReleaseEvent ( QKeyEvent* ) { } void Command::keyReleaseEvent ( QKeyEvent* ) { }

View File

@ -14,26 +14,26 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#include <QAction> #include <QAction>
#include <QFrame> #include <QFrame>
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QCheckBox> #include <QCheckBox>
#include <QComboBox> #include <QComboBox>
#include <hurricane/configuration/Configuration.h> #include <hurricane/configuration/Configuration.h>
#include <hurricane/configuration/ConfigurationWidget.h> #include <hurricane/configuration/ConfigurationWidget.h>
#include <hurricane/DataBase.h> #include <hurricane/DataBase.h>
#include <hurricane/Cell.h> #include <hurricane/Cell.h>
#include <hurricane/viewer/Graphics.h> #include <hurricane/viewer/Graphics.h>
#include <hurricane/viewer/CellWidget.h> #include <hurricane/viewer/CellWidget.h>
#include <hurricane/viewer/GraphicsWidget.h> #include <hurricane/viewer/GraphicsWidget.h>
#include <hurricane/viewer/PaletteWidget.h> #include <hurricane/viewer/PaletteWidget.h>
#include <hurricane/viewer/DisplayFilterWidget.h> #include <hurricane/viewer/DisplayFilterWidget.h>
#include <hurricane/viewer/NetlistWidget.h> #include <hurricane/viewer/NetlistWidget.h>
#include <hurricane/viewer/HierarchyWidget.h> #include <hurricane/viewer/HierarchyWidget.h>
#include <hurricane/viewer/SelectionWidget.h> #include <hurricane/viewer/SelectionWidget.h>
#include <hurricane/viewer/InspectorWidget.h> #include <hurricane/viewer/InspectorWidget.h>
#include <hurricane/viewer/ControllerWidget.h> #include <hurricane/viewer/ControllerWidget.h>
namespace Hurricane { namespace Hurricane {

View File

@ -1,14 +1,14 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2018, All Rights Reserved // Copyright (c) Sorbonne Université 2008-2021, All Rights Reserved
// //
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
// | H U R R I C A N E | // | H U R R I C A N E |
// | V L S I B a c k e n d D a t a - B a s e | // | V L S I B a c k e n d D a t a - B a s e |
// | | // | |
// | Author : Jean-Paul CHAPUT | // | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Module : "./InspectorWidget.cpp" | // | C++ Module : "./InspectorWidget.cpp" |
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
@ -24,7 +24,6 @@
#include <QKeyEvent> #include <QKeyEvent>
#include <QGroupBox> #include <QGroupBox>
#include <QVBoxLayout> #include <QVBoxLayout>
#include "hurricane/viewer/Graphics.h" #include "hurricane/viewer/Graphics.h"
#include "hurricane/viewer/RecordModel.h" #include "hurricane/viewer/RecordModel.h"
#include "hurricane/viewer/InspectorWidget.h" #include "hurricane/viewer/InspectorWidget.h"

View File

@ -1,7 +1,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC 2008-2018, All Rights Reserved // Copyright (c) Sorbonne Université 2008-2021, All Rights Reserved
// //
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
// | H U R R I C A N E | // | H U R R I C A N E |
@ -14,20 +14,20 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#include <QString> #include <QString>
#include <QMouseEvent> #include <QMouseEvent>
#include <QKeyEvent> #include <QKeyEvent>
#include <QAction> #include <QAction>
#include "hurricane/Path.h" #include "hurricane/Path.h"
#include "hurricane/Entity.h" #include "hurricane/Entity.h"
#include "hurricane/Net.h" #include "hurricane/Net.h"
#include "hurricane/Component.h" #include "hurricane/Component.h"
#include "hurricane/Occurrence.h" #include "hurricane/Occurrence.h"
#include "hurricane/HyperNet.h" #include "hurricane/HyperNet.h"
#include "hurricane/Cell.h" #include "hurricane/Cell.h"
#include "hurricane/viewer/CellWidget.h" #include "hurricane/viewer/CellWidget.h"
#include "hurricane/viewer/SelectCommand.h" #include "hurricane/viewer/SelectCommand.h"
#include "hurricane/viewer/SelectionPopup.h" #include "hurricane/viewer/SelectionPopup.h"
namespace Hurricane { namespace Hurricane {
@ -217,34 +217,34 @@ namespace Hurricane {
void SelectCommand::mousePressEvent ( QMouseEvent* event ) void SelectCommand::mousePressEvent ( QMouseEvent* event )
{ {
if ( isActive() ) return; if (isActive()) return;
if ( event->button() == Qt::RightButton ) { if (event->button() == Qt::RightButton) {
if ( !event->modifiers() ) { if (not event->modifiers() ) {
event->accept (); event->accept();
setActive ( true ); setActive ( true );
setStartPoint ( event->pos() ); setStartPoint ( event->pos() );
setDrawingEnabled ( true ); setDrawingEnabled( true );
} else if ( event->modifiers() == Qt::ControlModifier ) { } else if (event->modifiers() == Qt::ControlModifier) {
event->accept (); event->accept();
QRect selectArea ( event->pos() - QPoint(2,2), QSize(4,4) ); QRect selectArea ( event->pos() - QPoint(2,2), QSize(4,4) );
Occurrences selection; Occurrences selection;
switch ( _selectMode ) { switch ( _selectMode ) {
case AllMode: // 0 case AllMode: // 0
selection = _cellWidget->getOccurrencesUnder(selectArea); selection = _cellWidget->getOccurrencesUnder( selectArea );
break; break;
case NetMode: // 1 case NetMode: // 1
selection = Occurrences_GetNets(_cellWidget->getOccurrencesUnder(selectArea),false); selection = Occurrences_GetNets( _cellWidget->getOccurrencesUnder(selectArea), false );
break; break;
case NoAnonNetMode: // 2 case NoAnonNetMode: // 2
selection = Occurrences_GetNets(_cellWidget->getOccurrencesUnder(selectArea),true); selection = Occurrences_GetNets( _cellWidget->getOccurrencesUnder(selectArea), true );
break; break;
} }
_selectionPopup->loadOccurrences ( selection ); _selectionPopup->loadOccurrences( selection );
_selectionPopup->updateLayout (); _selectionPopup->updateLayout();
_selectionPopup->move ( event->globalPos() ); _selectionPopup->move( event->globalPos() );
_selectionPopup->popup (); _selectionPopup->popup();
} }
} }
} }
@ -257,25 +257,37 @@ namespace Hurricane {
event->accept (); event->accept ();
setActive ( false ); setActive( false );
setDrawingEnabled ( false ); setDrawingEnabled( false );
QRect selectArea; QRect selectArea;
if ( _startPoint == _stopPoint ) if ( _startPoint == _stopPoint )
selectArea = QRect ( _startPoint - QPoint(2,2), QSize(4,4) ); selectArea = QRect( _startPoint - QPoint(2,2), QSize(4,4) );
else else
selectArea = QRect ( _startPoint, _stopPoint ); selectArea = QRect( _startPoint, _stopPoint );
//_cellWidget->unselectAll (); //_cellWidget->unselectAll ();
_cellWidget->selectOccurrencesUnder ( _cellWidget->screenToDbuBox(selectArea) ); _cellWidget->selectOccurrencesUnder( _cellWidget->screenToDbuBox(selectArea) );
bool somethingSelected = not _cellWidget->getSelectorSet().empty(); setShowSelection( not _cellWidget->getSelectorSet().empty() );
if ( _cellWidget->showSelection() != somethingSelected )
_cellWidget->setShowSelection ( somethingSelected );
else
_cellWidget->refresh ();
} }
void SelectCommand::setCellWidget ( CellWidget* cellWidget )
{
Super::setCellWidget( cellWidget );
_selectionPopup->setCellWidget( cellWidget );
}
void SelectCommand::setShowSelection ( bool state )
{
//cerr << "SelectCommand::setShowSelection(): "
// << state << " vs. " << _cellWidget->showSelection() << endl;
if (_cellWidget->showSelection() != state)
_cellWidget->setShowSelection( state );
else
_cellWidget->refresh();
}
} // End of Hurricane namespace. } // End of Hurricane namespace.

View File

@ -1,13 +1,14 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC 2008-2018, All Rights Reserved // Copyright (c) Sorbonne Université 2008-2021, All Rights Reserved
// //
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
// | H U R R I C A N E | // | H U R R I C A N E |
// | V L S I B a c k e n d D a t a - B a s e |
// | | // | |
// | Author : Jean-Paul CHAPUT | // | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Module : "./SelectionPopup.cpp" | // | C++ Module : "./SelectionPopup.cpp" |
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
@ -21,6 +22,7 @@
#include <QVBoxLayout> #include <QVBoxLayout>
#include "hurricane/Commons.h" #include "hurricane/Commons.h"
#include "hurricane/viewer/Graphics.h" #include "hurricane/viewer/Graphics.h"
#include "hurricane/viewer/CellWidget.h"
#include "hurricane/viewer/SelectionPopupModel.h" #include "hurricane/viewer/SelectionPopupModel.h"
#include "hurricane/viewer/SelectionPopup.h" #include "hurricane/viewer/SelectionPopup.h"
@ -34,6 +36,7 @@ namespace Hurricane {
SelectionPopup::SelectionPopup ( QWidget* parent ) SelectionPopup::SelectionPopup ( QWidget* parent )
: QWidget(parent) : QWidget(parent)
, _cellWidget(NULL)
, _model(NULL) , _model(NULL)
, _view(NULL) , _view(NULL)
, _rowHeight(20) , _rowHeight(20)
@ -75,10 +78,10 @@ namespace Hurricane {
} }
void SelectionPopup::popup () bool SelectionPopup::popup ()
{ {
show (); show();
grabMouse (); grabMouse();
} }
@ -96,7 +99,6 @@ namespace Hurricane {
} }
void SelectionPopup::mouseMoveEvent ( QMouseEvent* event ) void SelectionPopup::mouseMoveEvent ( QMouseEvent* event )
{ {
QModelIndex index = _view->indexAt ( event->pos() ); QModelIndex index = _view->indexAt ( event->pos() );
@ -107,20 +109,21 @@ namespace Hurricane {
} }
void SelectionPopup::mouseReleaseEvent ( QMouseEvent* event ) void SelectionPopup::mouseReleaseEvent ( QMouseEvent* event )
{ {
releaseMouse (); releaseMouse();
hide (); hide();
QModelIndex index = _view->indexAt ( event->pos() ); QModelIndex index = _view->indexAt( event->pos() );
if ( index.isValid() ) { if (index.isValid()) {
Occurrence occurrence = _model->getOccurrence(index.row()); Occurrence occurrence = _model->getOccurrence(index.row());
if ( occurrence.getEntity() ) if (occurrence.getEntity()) {
emit selectionToggled ( occurrence ); if (_cellWidget) _cellWidget->setShowSelection( true );
emit selectionToggled( occurrence );
}
} }
clear (); clear();
} }

View File

@ -160,7 +160,7 @@ namespace Hurricane {
connect( _cellWidget, SIGNAL(selectionChanged(const SelectorSet&)) connect( _cellWidget, SIGNAL(selectionChanged(const SelectorSet&))
, this , SLOT (setSelection (const SelectorSet&)) ); , this , SLOT (setSelection (const SelectorSet&)) );
connect( _cellWidget, SIGNAL(selectionToggled(Selector*)), this , SLOT(toggleSelection(Selector*)) ); connect( _cellWidget, SIGNAL(selectionToggled(Selector*)), this, SLOT(toggleSelection(Selector*)) );
_updateState = ExternalEmit; _updateState = ExternalEmit;
changeSelectionMode (); changeSelectionMode ();
@ -169,22 +169,20 @@ namespace Hurricane {
void SelectionWidget::changeSelectionMode () void SelectionWidget::changeSelectionMode ()
{ {
if ( !_cellWidget ) return; if (not _cellWidget) return;
if ( _updateState == InternalEmit ) { if (_updateState == InternalEmit) {
_updateState = InternalReceive; _updateState = InternalReceive;
emit selectionModeChanged (); emit selectionModeChanged ();
} else { } else {
if ( _updateState == ExternalEmit ) { if (_updateState == ExternalEmit) {
blockAllSignals ( true ); blockAllSignals( true );
_showSelection->setChecked( _cellWidget->getState()->showSelection () );
_showSelection->setChecked ( _cellWidget->getState()->showSelection () ); _cumulative ->setChecked( _cellWidget->getState()->cumulativeSelection() );
_cumulative ->setChecked ( _cellWidget->getState()->cumulativeSelection() ); blockAllSignals( false );
blockAllSignals ( false );
} }
_updateState = ExternalEmit;
} }
_updateState = ExternalEmit;
} }

View File

@ -43,7 +43,7 @@ namespace Hurricane {
virtual Type getType () const; virtual Type getType () const;
inline bool isActive () const; inline bool isActive () const;
void setActive ( bool state ); void setActive ( bool state );
inline void setCellWidget ( CellWidget* ); virtual void setCellWidget ( CellWidget* );
virtual void wheelEvent ( QWheelEvent* ); virtual void wheelEvent ( QWheelEvent* );
virtual void keyPressEvent ( QKeyEvent* ); virtual void keyPressEvent ( QKeyEvent* );
virtual void keyReleaseEvent ( QKeyEvent* ); virtual void keyReleaseEvent ( QKeyEvent* );
@ -63,7 +63,6 @@ namespace Hurricane {
// Inline Functions. // Inline Functions.
bool Command::isActive () const { return _active; } bool Command::isActive () const { return _active; }
void Command::setCellWidget ( CellWidget* widget ) { _cellWidget=widget; }
} }

View File

@ -2,39 +2,26 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2018, All Rights Reserved // Copyright (c) Sorbonne Université 2008-2021, All Rights Reserved
//
// ===================================================================
//
// $Id$
// //
// x-----------------------------------------------------------------x // x-----------------------------------------------------------------x
// | |
// | H U R R I C A N E | // | H U R R I C A N E |
// | V L S I B a c k e n d D a t a - B a s e | // | V L S I B a c k e n d D a t a - B a s e |
// | | // | |
// | Author : Jean-Paul CHAPUT | // | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Header : "./SelectCommand.h" | // | C++ Header : "./SelectCommand.h" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x // x-----------------------------------------------------------------x
#ifndef __HURRICANE_SELECT_COMMAND_H__ #pragma once
#define __HURRICANE_SELECT_COMMAND_H__ #include <set>
#include <QObject>
#include <set> #include <QPoint>
#include <QObject>
#include <QPoint>
class QAction; class QAction;
#include "hurricane/Occurrence.h"
#include "hurricane/Occurrence.h" #include "hurricane/viewer/AreaCommand.h"
#include "hurricane/viewer/AreaCommand.h"
using namespace std; using namespace std;
@ -50,7 +37,8 @@ namespace Hurricane {
class SelectCommand : public QObject, public AreaCommand { class SelectCommand : public QObject, public AreaCommand {
Q_OBJECT; Q_OBJECT;
public:
typedef AreaCommand Super;
public: public:
enum SelectMode { AllMode=0, NetMode=1, NoAnonNetMode=2 }; enum SelectMode { AllMode=0, NetMode=1, NoAnonNetMode=2 };
public: public:
@ -64,6 +52,8 @@ namespace Hurricane {
virtual void mousePressEvent ( QMouseEvent* ); virtual void mousePressEvent ( QMouseEvent* );
virtual void mouseReleaseEvent ( QMouseEvent* ); virtual void mouseReleaseEvent ( QMouseEvent* );
void bindToAction ( QAction* ); void bindToAction ( QAction* );
virtual void setCellWidget ( CellWidget* );
void setShowSelection ( bool state );
signals: signals:
void selectionToggled ( Occurrence ); void selectionToggled ( Occurrence );
private: private:
@ -81,6 +71,3 @@ namespace Hurricane {
} // End of Hurricane namespace. } // End of Hurricane namespace.
#endif

View File

@ -1,7 +1,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2018, All Rights Reserved // Copyright (c) Sornonne Université 2008-2021, All Rights Reserved
// //
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
// | H U R R I C A N E | // | H U R R I C A N E |
@ -14,9 +14,7 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#ifndef HURRICANE_SELECTION_MODEL_H #pragma once
#define HURRICANE_SELECTION_MODEL_H
#include <vector> #include <vector>
#include <QFont> #include <QFont>
#include <QApplication> #include <QApplication>
@ -34,10 +32,10 @@ namespace Hurricane {
class SelectionModel : public QAbstractTableModel { class SelectionModel : public QAbstractTableModel {
Q_OBJECT; Q_OBJECT;
public: public:
SelectionModel ( QObject* parent=NULL ); SelectionModel ( QObject* parent=NULL );
~SelectionModel (); ~SelectionModel ();
inline CellWidget* getCellWidget () const;
void setCellWidget ( CellWidget* ); void setCellWidget ( CellWidget* );
Selector* getSelector ( const QModelIndex& index ); Selector* getSelector ( const QModelIndex& index );
void setSelection ( const SelectorSet& selection ); void setSelection ( const SelectorSet& selection );
@ -53,13 +51,13 @@ namespace Hurricane {
public slots: public slots:
void unlink ( Selector* ); void unlink ( Selector* );
void clear (); void clear ();
private: private:
CellWidget* _cellWidget; CellWidget* _cellWidget;
vector<Selector*> _selection; vector<Selector*> _selection;
}; };
inline CellWidget* SelectionModel::getCellWidget () const { return _cellWidget; }
} // Hurricane namespace. } // Hurricane namespace.
#endif // HURRICANE_SELECTION_MODEL_H

View File

@ -1,22 +1,20 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC 2008-2018, All Rights Reserved // Copyright (c) Sorbonne Université 2008-2021, All Rights Reserved
// //
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
// | H U R R I C A N E | // | H U R R I C A N E |
// | V L S I B a c k e n d D a t a - B a s e | // | V L S I B a c k e n d D a t a - B a s e |
// | | // | |
// | Author : Jean-Paul CHAPUT | // | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Header : "./hurricane/viewer/SelectionPopup.h" | // | C++ Header : "./hurricane/viewer/SelectionPopup.h" |
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#ifndef HURRICANE_SELECTION_POPUP_WIDGET_H #pragma once
#define HURRICANE_SELECTION_POPUP_WIDGET_H
#include <QWidget> #include <QWidget>
#include <QTableView> #include <QTableView>
#include "hurricane/Commons.h" #include "hurricane/Commons.h"
@ -38,15 +36,16 @@ namespace Hurricane {
class SelectionPopupModel; class SelectionPopupModel;
class CellWidget;
class SelectionPopup : public QWidget { class SelectionPopup : public QWidget {
Q_OBJECT; Q_OBJECT;
public: public:
SelectionPopup ( QWidget* parent=NULL ); SelectionPopup ( QWidget* parent=NULL );
inline void setCellWidget ( CellWidget* );
void updateLayout (); void updateLayout ();
void popup (); bool popup ();
void clearFilter (); void clearFilter ();
void setFilter ( OccurrenceFilter ); void setFilter ( OccurrenceFilter );
signals: signals:
@ -59,8 +58,8 @@ namespace Hurricane {
virtual void keyPressEvent ( QKeyEvent * ); virtual void keyPressEvent ( QKeyEvent * );
virtual void mouseMoveEvent ( QMouseEvent* ); virtual void mouseMoveEvent ( QMouseEvent* );
virtual void mouseReleaseEvent ( QMouseEvent* ); virtual void mouseReleaseEvent ( QMouseEvent* );
private: private:
CellWidget* _cellWidget;
SelectionPopupModel* _model; SelectionPopupModel* _model;
QTableView* _view; QTableView* _view;
int _rowHeight; int _rowHeight;
@ -68,6 +67,7 @@ namespace Hurricane {
}; };
} // Hurricane namespace. inline void SelectionPopup::setCellWidget ( CellWidget* cellWidget ) { _cellWidget=cellWidget; }
#endif // HURRICANE_SELECTION_POPUP_WIDGET_H
} // Hurricane namespace.

View File

@ -1,29 +1,27 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2019, All Rights Reserved // Copyright (c) Sorbonne Université 2008-2021, All Rights Reserved
// //
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
// | H U R R I C A N E | // | H U R R I C A N E |
// | V L S I B a c k e n d D a t a - B a s e | // | V L S I B a c k e n d D a t a - B a s e |
// | | // | |
// | Author : Jean-Paul CHAPUT | // | Author : Jean-Paul CHAPUT |
// | E-mail : Jean-Paul.Chaput@lip6.fr | // | E-mail : Jean-Paul.Chaput@lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Header : "./hurricane/viewer/SelectionWidget.h" | // | C++ Header : "./hurricane/viewer/SelectionWidget.h" |
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#ifndef HURRICANE_SELECTION_WIDGET_H #pragma once
#define HURRICANE_SELECTION_WIDGET_H #include <QWidget>
#include <QTableView>
#include <QWidget> #include <QSortFilterProxyModel>
#include <QTableView> #include "hurricane/Commons.h"
#include <QSortFilterProxyModel> #include "hurricane/Occurrence.h"
#include "hurricane/Commons.h" #include "hurricane/viewer/SelectionModel.h"
#include "hurricane/Occurrence.h" #include "hurricane/viewer/CellWidget.h"
#include "hurricane/viewer/SelectionModel.h"
#include "hurricane/viewer/CellWidget.h"
class QCloseEvent; class QCloseEvent;
class QSortFilterProxyModel; class QSortFilterProxyModel;
@ -42,7 +40,6 @@ namespace Hurricane {
class SelectionWidget : public QWidget { class SelectionWidget : public QWidget {
Q_OBJECT; Q_OBJECT;
public: public:
SelectionWidget ( QWidget* parent=NULL ); SelectionWidget ( QWidget* parent=NULL );
void inspect ( const QModelIndex& index ); void inspect ( const QModelIndex& index );
@ -84,5 +81,3 @@ namespace Hurricane {
} // Hurricane namespace. } // Hurricane namespace.
#endif // HURRICANE_SELECTION_WIDGET_H