* ./hurricane/src/hviewer :
- Bug : InspectorWidget was using Record from Occurrences in the SelectionWidget. but those Occurences were created on the fly by the CellWidget/Selectors. So, whenever the selection changes the Occurrence may diseapear leaving a bad Record in the InspectorWidget (core dump). Now, the TabInspector keep a copy of the Inspected occurrence, so it can go through any selection change. In addition, the InspectorWidget could be passed Occurrence that it keeps local copy along with Record*. - New Feature : internal, first step toward an extensible ControllerWidget : now all Tab are derived classes of ControllerTab.
This commit is contained in:
parent
9c4d322de1
commit
e5f5ce3592
|
@ -76,6 +76,91 @@ namespace Hurricane {
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "Hurricane::TabGraphics".
|
||||||
|
|
||||||
|
|
||||||
|
TabGraphics::TabGraphics ( QWidget* parent )
|
||||||
|
: ControllerTab(parent)
|
||||||
|
, _graphics (new GraphicsWidget())
|
||||||
|
{
|
||||||
|
_graphics->setObjectName ( "controller.tabGraphics.graphics" );
|
||||||
|
|
||||||
|
QVBoxLayout* wLayout = new QVBoxLayout ();
|
||||||
|
wLayout->setContentsMargins ( 0, 0, 0, 0 );
|
||||||
|
wLayout->addWidget ( _graphics );
|
||||||
|
setLayout ( wLayout );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TabGraphics::setCellWidget ( CellWidget* cellWidget )
|
||||||
|
{
|
||||||
|
if ( getCellWidget() != cellWidget ) {
|
||||||
|
ControllerTab::setCellWidget ( cellWidget );
|
||||||
|
if ( getCellWidget() ) {
|
||||||
|
connect ( _graphics, SIGNAL(styleChanged()), getCellWidget(), SLOT(redraw()) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "Hurricane::TabDisplayFilter".
|
||||||
|
|
||||||
|
|
||||||
|
TabDisplayFilter::TabDisplayFilter ( QWidget* parent )
|
||||||
|
: ControllerTab (parent)
|
||||||
|
, _displayFilter(new DisplayFilterWidget())
|
||||||
|
{
|
||||||
|
_displayFilter->setObjectName ( "controller.tabDisplayFilter.graphics" );
|
||||||
|
|
||||||
|
QVBoxLayout* wLayout = new QVBoxLayout ();
|
||||||
|
wLayout->setContentsMargins ( 0, 0, 0, 0 );
|
||||||
|
wLayout->addWidget ( _displayFilter );
|
||||||
|
setLayout ( wLayout );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TabDisplayFilter::setCellWidget ( CellWidget* cellWidget )
|
||||||
|
{
|
||||||
|
if ( getCellWidget() != cellWidget ) {
|
||||||
|
ControllerTab::setCellWidget ( cellWidget );
|
||||||
|
_displayFilter->setCellWidget ( cellWidget );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "Hurricane::TabPalette".
|
||||||
|
|
||||||
|
|
||||||
|
TabPalette::TabPalette ( QWidget* parent )
|
||||||
|
: ControllerTab(parent)
|
||||||
|
, _palette (new PaletteWidget())
|
||||||
|
{
|
||||||
|
_palette->setObjectName ( "controller.tabPalette.palette" );
|
||||||
|
|
||||||
|
QVBoxLayout* wLayout = new QVBoxLayout ();
|
||||||
|
wLayout->setContentsMargins ( 0, 0, 0, 0 );
|
||||||
|
wLayout->addWidget ( _palette );
|
||||||
|
setLayout ( wLayout );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void TabPalette::setCellWidget ( CellWidget* cellWidget )
|
||||||
|
{
|
||||||
|
if ( getCellWidget() )
|
||||||
|
getCellWidget()->detachFromPalette ();
|
||||||
|
|
||||||
|
if ( getCellWidget() != cellWidget ) {
|
||||||
|
ControllerTab::setCellWidget ( cellWidget );
|
||||||
|
if ( getCellWidget() ) {
|
||||||
|
getCellWidget()->bindToPalette ( _palette );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Class : "Hurricane::TabNetlist".
|
// Class : "Hurricane::TabNetlist".
|
||||||
|
|
||||||
|
@ -132,7 +217,7 @@ namespace Hurricane {
|
||||||
void TabNetlist::setCellWidget ( CellWidget* cellWidget )
|
void TabNetlist::setCellWidget ( CellWidget* cellWidget )
|
||||||
{
|
{
|
||||||
if ( getCellWidget() != cellWidget ) {
|
if ( getCellWidget() != cellWidget ) {
|
||||||
setCellWidget ( cellWidget );
|
ControllerTab::setCellWidget ( cellWidget );
|
||||||
if ( getCellWidget() ) {
|
if ( getCellWidget() ) {
|
||||||
connect ( getCellWidget(), SIGNAL(cellChanged(Cell*)) , this , SLOT(setCell(Cell*)) );
|
connect ( getCellWidget(), SIGNAL(cellChanged(Cell*)) , this , SLOT(setCell(Cell*)) );
|
||||||
connect ( _netlistBrowser, SIGNAL(netSelected(const Net*)), getCellWidget(), SLOT(select(const Net*)) );
|
connect ( _netlistBrowser, SIGNAL(netSelected(const Net*)), getCellWidget(), SLOT(select(const Net*)) );
|
||||||
|
@ -159,9 +244,8 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
TabSelection::TabSelection ( QWidget* parent )
|
TabSelection::TabSelection ( QWidget* parent )
|
||||||
: QWidget (parent)
|
: ControllerTab(parent)
|
||||||
, _cellWidget(NULL)
|
, _selection (new SelectionWidget())
|
||||||
, _selection (new SelectionWidget())
|
|
||||||
{
|
{
|
||||||
_selection->setObjectName ( "controller.tabSelection.selection" );
|
_selection->setObjectName ( "controller.tabSelection.selection" );
|
||||||
|
|
||||||
|
@ -180,25 +264,25 @@ namespace Hurricane {
|
||||||
|
|
||||||
void TabSelection::setCellWidget ( CellWidget* cellWidget )
|
void TabSelection::setCellWidget ( CellWidget* cellWidget )
|
||||||
{
|
{
|
||||||
if ( _cellWidget != cellWidget ) {
|
if ( getCellWidget() != cellWidget ) {
|
||||||
_cellWidget = cellWidget;
|
ControllerTab::setCellWidget ( cellWidget );
|
||||||
if ( _cellWidget ) {
|
if ( getCellWidget() ) {
|
||||||
connect ( _cellWidget , SIGNAL(cellChanged(Cell*))
|
connect ( getCellWidget() , SIGNAL(cellChanged(Cell*))
|
||||||
, this , SLOT(setCell(Cell*)) );
|
, this , SLOT(setCell(Cell*)) );
|
||||||
connect ( _cellWidget , SIGNAL(selectionChanged(const set<Selector*>&,Cell*))
|
connect ( getCellWidget(), SIGNAL(selectionChanged(const set<Selector*>&,Cell*))
|
||||||
, _selection , SLOT (setSelection (const set<Selector*>&,Cell*)) );
|
, _selection , SLOT (setSelection (const set<Selector*>&,Cell*)) );
|
||||||
connect ( _selection , SIGNAL(occurrenceToggled(Occurrence,bool))
|
connect ( _selection , SIGNAL(occurrenceToggled(Occurrence,bool))
|
||||||
, _cellWidget , SLOT (toggleSelect (Occurrence,bool)) );
|
, getCellWidget(), SLOT (toggleSelect (Occurrence,bool)) );
|
||||||
connect ( _cellWidget , SIGNAL(occurrenceToggled(Occurrence))
|
connect ( getCellWidget(), SIGNAL(occurrenceToggled(Occurrence))
|
||||||
, _selection , SLOT (toggleSelection (Occurrence)) );
|
, _selection , SLOT (toggleSelection (Occurrence)) );
|
||||||
connect ( _selection , SIGNAL(cumulativeToggled (bool))
|
connect ( _selection , SIGNAL(cumulativeToggled (bool))
|
||||||
, _cellWidget , SLOT (setCumulativeSelection(bool)) );
|
, getCellWidget(), SLOT (setCumulativeSelection(bool)) );
|
||||||
connect ( _selection , SIGNAL(showSelectionToggled(bool))
|
connect ( _selection , SIGNAL(showSelectionToggled(bool))
|
||||||
, _cellWidget , SLOT (setShowSelection (bool)) );
|
, getCellWidget(), SLOT (setShowSelection (bool)) );
|
||||||
connect ( _cellWidget , SIGNAL(showSelectionToggled(bool))
|
connect ( getCellWidget(), SIGNAL(showSelectionToggled(bool))
|
||||||
, _selection , SLOT (setShowSelection (bool)) );
|
, _selection , SLOT (setShowSelection (bool)) );
|
||||||
connect ( _selection , SIGNAL(selectionCleared())
|
connect ( _selection , SIGNAL(selectionCleared())
|
||||||
, _cellWidget , SLOT (unselectAll ()) );
|
, getCellWidget(), SLOT (unselectAll ()) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -222,8 +306,8 @@ namespace Hurricane {
|
||||||
void TabSelection::cellPostModificate ()
|
void TabSelection::cellPostModificate ()
|
||||||
{
|
{
|
||||||
//updateTab ();
|
//updateTab ();
|
||||||
if ( _cellWidget && _cellWidget->getCell() )
|
if ( getCellWidget() && getCellWidget()->getCell() )
|
||||||
_selection->setSelection ( _cellWidget->getSelectorSet(), _cellWidget->getCell() );
|
_selection->setSelection ( getCellWidget()->getSelectorSet(), getCellWidget()->getCell() );
|
||||||
else
|
else
|
||||||
_selection->setSelection ( set<Selector*>() );
|
_selection->setSelection ( set<Selector*>() );
|
||||||
}
|
}
|
||||||
|
@ -234,12 +318,11 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
TabInspector::TabInspector ( QWidget* parent )
|
TabInspector::TabInspector ( QWidget* parent )
|
||||||
: QWidget (parent)
|
: ControllerTab (parent)
|
||||||
, _cellWidget (NULL)
|
|
||||||
, _inspectorWidget (new InspectorWidget())
|
, _inspectorWidget (new InspectorWidget())
|
||||||
, _bookmarks (new QComboBox())
|
, _bookmarks (new QComboBox())
|
||||||
, _selectionRecord (NULL)
|
, _selectionOccurrence()
|
||||||
, _updateFromSelection(false)
|
, _updateFromSelection(true)
|
||||||
{
|
{
|
||||||
_inspectorWidget->setObjectName ( "controller.tabInspector.inspectorWidget" );
|
_inspectorWidget->setObjectName ( "controller.tabInspector.inspectorWidget" );
|
||||||
|
|
||||||
|
@ -281,10 +364,10 @@ namespace Hurricane {
|
||||||
|
|
||||||
void TabInspector::setCellWidget ( CellWidget* cellWidget )
|
void TabInspector::setCellWidget ( CellWidget* cellWidget )
|
||||||
{
|
{
|
||||||
if ( _cellWidget != cellWidget ) {
|
if ( getCellWidget() != cellWidget ) {
|
||||||
_cellWidget = cellWidget;
|
ControllerTab::setCellWidget( cellWidget );
|
||||||
if ( _cellWidget ) {
|
if ( getCellWidget() ) {
|
||||||
connect ( _cellWidget, SIGNAL(cellChanged(Cell*)), this, SLOT(setCell(Cell*)) );
|
connect ( getCellWidget(), SIGNAL(cellChanged(Cell*)), this, SLOT(setCell(Cell*)) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -296,12 +379,12 @@ namespace Hurricane {
|
||||||
case 0: _inspectorWidget->setRootRecord ( NULL ); break;
|
case 0: _inspectorWidget->setRootRecord ( NULL ); break;
|
||||||
case 1: _inspectorWidget->setRootRecord ( getRecord(DataBase::getDB()) ); break;
|
case 1: _inspectorWidget->setRootRecord ( getRecord(DataBase::getDB()) ); break;
|
||||||
case 2:
|
case 2:
|
||||||
if ( _cellWidget && _cellWidget->getCell() )
|
if ( getCellWidget() && getCellWidget()->getCell() )
|
||||||
_inspectorWidget->setRootRecord ( getRecord(_cellWidget->getCell()) );
|
_inspectorWidget->setRootRecord ( getRecord(getCellWidget()->getCell()) );
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if ( _cellWidget && _cellWidget->getCell() )
|
if ( getCellWidget() && getCellWidget()->getCell() )
|
||||||
_inspectorWidget->setRootRecord ( _selectionRecord );
|
_inspectorWidget->setRootRecord ( getRecord(_selectionOccurrence) );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -309,22 +392,23 @@ namespace Hurricane {
|
||||||
|
|
||||||
void TabInspector::updateTab ()
|
void TabInspector::updateTab ()
|
||||||
{
|
{
|
||||||
if ( _updateFromSelection && (_bookmarks->currentIndex() == 3) )
|
if ( _updateFromSelection && (_bookmarks->currentIndex() == 3) ) {
|
||||||
_inspectorWidget->setRootRecord ( _selectionRecord );
|
_inspectorWidget->setRootRecord ( getRecord(_selectionOccurrence) );
|
||||||
|
}
|
||||||
_updateFromSelection = false;
|
_updateFromSelection = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TabInspector::setSelectionRecord ( Record* record )
|
void TabInspector::setSelectionOccurrence ( Occurrence& occurrence )
|
||||||
{
|
{
|
||||||
_updateFromSelection = true;
|
_updateFromSelection = true;
|
||||||
_selectionRecord = record;
|
_selectionOccurrence = occurrence;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TabInspector::cellPreModificate ()
|
void TabInspector::cellPreModificate ()
|
||||||
{
|
{
|
||||||
_selectionRecord = NULL;
|
_selectionOccurrence = Occurrence();
|
||||||
if ( _bookmarks->currentIndex() > 1 )
|
if ( _bookmarks->currentIndex() > 1 )
|
||||||
_inspectorWidget->setRootRecord ( NULL );
|
_inspectorWidget->setRootRecord ( NULL );
|
||||||
}
|
}
|
||||||
|
@ -332,8 +416,8 @@ namespace Hurricane {
|
||||||
|
|
||||||
void TabInspector::cellPostModificate ()
|
void TabInspector::cellPostModificate ()
|
||||||
{
|
{
|
||||||
if ( ( _bookmarks->currentIndex() == 2 ) && _cellWidget && _cellWidget->getCell() )
|
if ( ( _bookmarks->currentIndex() == 2 ) && getCellWidget() && getCellWidget()->getCell() )
|
||||||
_inspectorWidget->setRootRecord ( getRecord(_cellWidget->getCell()) );
|
_inspectorWidget->setRootRecord ( getRecord(getCellWidget()->getCell()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -342,14 +426,14 @@ namespace Hurricane {
|
||||||
|
|
||||||
|
|
||||||
ControllerWidget::ControllerWidget ( QWidget* parent )
|
ControllerWidget::ControllerWidget ( QWidget* parent )
|
||||||
: QTabWidget (parent)
|
: QTabWidget (parent)
|
||||||
, _cellWidget (NULL)
|
, _cellWidget (NULL)
|
||||||
, _graphics (new GraphicsWidget())
|
, _tabGraphics (new TabGraphics())
|
||||||
, _palette (new PaletteWidget())
|
, _tabPalette (new TabPalette())
|
||||||
, _displayFilter(new DisplayFilterWidget())
|
, _tabDisplayFilter(new TabDisplayFilter())
|
||||||
, _tabNetlist (new TabNetlist())
|
, _tabNetlist (new TabNetlist())
|
||||||
, _tabSelection (new TabSelection())
|
, _tabSelection (new TabSelection())
|
||||||
, _tabInspector (new TabInspector())
|
, _tabInspector (new TabInspector())
|
||||||
{
|
{
|
||||||
setObjectName ( "controller" );
|
setObjectName ( "controller" );
|
||||||
setAttribute ( Qt::WA_QuitOnClose, false );
|
setAttribute ( Qt::WA_QuitOnClose, false );
|
||||||
|
@ -357,47 +441,40 @@ namespace Hurricane {
|
||||||
|
|
||||||
//connect ( _netlistBrowser, SIGNAL(destroyed()), this, SLOT(netlistBrowserDestroyed()) );
|
//connect ( _netlistBrowser, SIGNAL(destroyed()), this, SLOT(netlistBrowserDestroyed()) );
|
||||||
|
|
||||||
_graphics ->setObjectName ( "controller.graphics" );
|
_tabGraphics ->setObjectName ( "controller.graphics" );
|
||||||
_palette ->setObjectName ( "controller.palette" );
|
_tabPalette ->setObjectName ( "controller.palette" );
|
||||||
_displayFilter->setObjectName ( "controller.displayFilter" );
|
_tabDisplayFilter->setObjectName ( "controller.displayFilter" );
|
||||||
_tabNetlist ->setObjectName ( "controller.tabNetlist" );
|
_tabNetlist ->setObjectName ( "controller.tabNetlist" );
|
||||||
_tabSelection ->setObjectName ( "controller.tabSelection" );
|
_tabSelection ->setObjectName ( "controller.tabSelection" );
|
||||||
_tabInspector ->setObjectName ( "controller.tabInspector" );
|
_tabInspector ->setObjectName ( "controller.tabInspector" );
|
||||||
|
|
||||||
addTab ( _graphics , "Look" );
|
addTab ( _tabGraphics , "Look" );
|
||||||
addTab ( _displayFilter , "Filter" );
|
addTab ( _tabDisplayFilter , "Filter" );
|
||||||
addTab ( _palette , "Layers&&Gos" );
|
addTab ( _tabPalette , "Layers&&Gos" );
|
||||||
addTab ( _tabNetlist , "Netlist" );
|
addTab ( _tabNetlist , "Netlist" );
|
||||||
addTab ( _tabSelection , "Selection" );
|
addTab ( _tabSelection , "Selection" );
|
||||||
addTab ( _tabInspector , "Inspector" );
|
addTab ( _tabInspector , "Inspector" );
|
||||||
|
|
||||||
connect ( this, SIGNAL(currentChanged(int)), this, SLOT(updateTab(int)) );
|
connect ( this, SIGNAL(currentChanged(int)), this, SLOT(updateTab(int)) );
|
||||||
//connect ( _tabNetlist->getNetlistBrowser(), SIGNAL(netSelected(const Net*))
|
//connect ( _tabNetlist->getNetlistBrowser(), SIGNAL(netSelected(const Net*))
|
||||||
// , _tabSelection , SLOT(setUpdateFromNetlist(const Net*)) );
|
// , _tabSelection , SLOT(setUpdateFromNetlist(const Net*)) );
|
||||||
connect ( _tabSelection->getSelection() , SIGNAL(inspect(Record*))
|
connect ( _tabSelection->getSelection() , SIGNAL(inspect(Occurrence&))
|
||||||
, _tabInspector , SLOT(setSelectionRecord(Record*)) );
|
, _tabInspector , SLOT(setSelectionOccurrence(Occurrence&)) );
|
||||||
|
|
||||||
resize ( 540, 540 );
|
resize ( 540, 540 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ControllerWidget::setCellWidget ( CellWidget* widget )
|
void ControllerWidget::setCellWidget ( CellWidget* cellWidget )
|
||||||
{
|
{
|
||||||
if ( _cellWidget )
|
_cellWidget = cellWidget;
|
||||||
_cellWidget->detachFromPalette ();
|
|
||||||
|
|
||||||
_cellWidget = widget;
|
|
||||||
if ( _cellWidget ) {
|
if ( _cellWidget ) {
|
||||||
_displayFilter->setCellWidget ( _cellWidget );
|
for ( int i=0 ; i<count() ; ++i )
|
||||||
_tabNetlist ->setCellWidget ( _cellWidget );
|
(static_cast<ControllerTab*>(widget(i)))->setCellWidget ( _cellWidget );
|
||||||
_tabSelection ->setCellWidget ( _cellWidget );
|
|
||||||
_tabInspector ->setCellWidget ( _cellWidget );
|
|
||||||
_cellWidget ->bindToPalette ( _palette );
|
|
||||||
|
|
||||||
connect ( _graphics , SIGNAL(styleChanged()) , _cellWidget, SLOT(redraw()) );
|
connect ( _cellWidget, SIGNAL(cellChanged(Cell*)) , this, SLOT(cellChanged(Cell*)) );
|
||||||
connect ( _cellWidget, SIGNAL(cellChanged(Cell*)) , this , SLOT(cellChanged(Cell*)) );
|
connect ( _cellWidget, SIGNAL(cellPreModificated()) , this, SLOT(cellPreModificate()) );
|
||||||
connect ( _cellWidget, SIGNAL(cellPreModificated()) , this , SLOT(cellPreModificate()) );
|
connect ( _cellWidget, SIGNAL(cellPostModificated()), this, SLOT(cellPostModificate()) );
|
||||||
connect ( _cellWidget, SIGNAL(cellPostModificated()), this , SLOT(cellPostModificate()) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -408,26 +485,21 @@ namespace Hurricane {
|
||||||
|
|
||||||
void ControllerWidget::updateTab ( int index )
|
void ControllerWidget::updateTab ( int index )
|
||||||
{
|
{
|
||||||
switch ( index ) {
|
(static_cast<ControllerTab*>(widget(index)))->updateTab ();
|
||||||
case 4: _tabSelection->updateTab (); break;
|
|
||||||
case 5: _tabInspector->updateTab (); break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ControllerWidget::cellPreModificate ()
|
void ControllerWidget::cellPreModificate ()
|
||||||
{
|
{
|
||||||
_tabInspector ->cellPreModificate ();
|
for ( int i=0 ; i<count() ; ++i )
|
||||||
_tabSelection ->cellPreModificate ();
|
(static_cast<ControllerTab*>(widget(i)))->cellPreModificate ();
|
||||||
_tabNetlist ->cellPreModificate ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ControllerWidget::cellPostModificate ()
|
void ControllerWidget::cellPostModificate ()
|
||||||
{
|
{
|
||||||
_tabNetlist ->cellPostModificate ();
|
for ( int i=0 ; i<count() ; ++i )
|
||||||
_tabSelection ->cellPostModificate ();
|
(static_cast<ControllerTab*>(widget(i)))->cellPostModificate ();
|
||||||
_tabInspector ->cellPostModificate ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -165,6 +165,7 @@ namespace Hurricane {
|
||||||
, _view(NULL)
|
, _view(NULL)
|
||||||
, _rowHeight(20)
|
, _rowHeight(20)
|
||||||
, _history()
|
, _history()
|
||||||
|
, _rootOccurrence()
|
||||||
{
|
{
|
||||||
setAttribute ( Qt::WA_DeleteOnClose );
|
setAttribute ( Qt::WA_DeleteOnClose );
|
||||||
setAttribute ( Qt::WA_QuitOnClose, false );
|
setAttribute ( Qt::WA_QuitOnClose, false );
|
||||||
|
@ -223,9 +224,24 @@ namespace Hurricane {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void InspectorWidget::setRootOccurrence ( Occurrence& occurrence )
|
||||||
|
{
|
||||||
|
_rootOccurrence = occurrence;
|
||||||
|
_setRootRecord ( getRecord(occurrence) );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void InspectorWidget::setRootRecord ( Record* record )
|
void InspectorWidget::setRootRecord ( Record* record )
|
||||||
|
{
|
||||||
|
_rootOccurrence = Occurrence();
|
||||||
|
_setRootRecord ( record );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void InspectorWidget::_setRootRecord ( Record* record )
|
||||||
{
|
{
|
||||||
_history.setRootRecord ( record );
|
_history.setRootRecord ( record );
|
||||||
|
if ( !record ) _rootOccurrence = Occurrence ();
|
||||||
|
|
||||||
if ( !_baseModel ) {
|
if ( !_baseModel ) {
|
||||||
_baseModel = new RecordModel ( this );
|
_baseModel = new RecordModel ( this );
|
||||||
|
|
|
@ -198,6 +198,8 @@ namespace Hurricane {
|
||||||
|
|
||||||
_view->selectRow ( 0 );
|
_view->selectRow ( 0 );
|
||||||
_view->resizeColumnToContents ( 0 );
|
_view->resizeColumnToContents ( 0 );
|
||||||
|
|
||||||
|
//if ( !_cumulative->isChecked() ) emit inspect ( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,8 +213,9 @@ namespace Hurricane {
|
||||||
{
|
{
|
||||||
if ( index.isValid() ) {
|
if ( index.isValid() ) {
|
||||||
Occurrence occurrence = _baseModel->getOccurrence ( _sortModel->mapToSource(index).row() );
|
Occurrence occurrence = _baseModel->getOccurrence ( _sortModel->mapToSource(index).row() );
|
||||||
emit inspect ( getRecord(occurrence) );
|
emit inspect ( occurrence );
|
||||||
}
|
} else
|
||||||
|
emit inspect ( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
class QCheckBox;
|
class QCheckBox;
|
||||||
class QComboBox;
|
class QComboBox;
|
||||||
|
|
||||||
|
#include "hurricane/Occurrence.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
|
|
||||||
|
@ -72,6 +74,69 @@ namespace Hurricane {
|
||||||
inline CellWidget* ControllerTab::getCellWidget () { return _cellWidget; }
|
inline CellWidget* ControllerTab::getCellWidget () { return _cellWidget; }
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "Hurricane::TabGraphics".
|
||||||
|
|
||||||
|
|
||||||
|
class TabGraphics : public ControllerTab {
|
||||||
|
Q_OBJECT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TabGraphics ( QWidget* parent=NULL );
|
||||||
|
inline GraphicsWidget* getGraphics ();
|
||||||
|
public slots:
|
||||||
|
void setCellWidget ( CellWidget* );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
GraphicsWidget* _graphics;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
inline GraphicsWidget* TabGraphics::getGraphics () { return _graphics; }
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "Hurricane::TabDisplayFilter".
|
||||||
|
|
||||||
|
|
||||||
|
class TabDisplayFilter : public ControllerTab {
|
||||||
|
Q_OBJECT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TabDisplayFilter ( QWidget* parent=NULL );
|
||||||
|
inline DisplayFilterWidget* getDisplayFilter ();
|
||||||
|
public slots:
|
||||||
|
virtual void setCellWidget ( CellWidget* );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
DisplayFilterWidget* _displayFilter;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
inline DisplayFilterWidget* TabDisplayFilter::getDisplayFilter () { return _displayFilter; }
|
||||||
|
|
||||||
|
|
||||||
|
// -------------------------------------------------------------------
|
||||||
|
// Class : "Hurricane::TabPalette".
|
||||||
|
|
||||||
|
|
||||||
|
class TabPalette : public ControllerTab {
|
||||||
|
Q_OBJECT;
|
||||||
|
|
||||||
|
public:
|
||||||
|
TabPalette ( QWidget* parent=NULL );
|
||||||
|
inline PaletteWidget* getPalette ();
|
||||||
|
public slots:
|
||||||
|
virtual void setCellWidget ( CellWidget* );
|
||||||
|
|
||||||
|
protected:
|
||||||
|
PaletteWidget* _palette;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
inline PaletteWidget* TabPalette::getPalette () { return _palette; }
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Class : "Hurricane::TabNetlist".
|
// Class : "Hurricane::TabNetlist".
|
||||||
|
|
||||||
|
@ -104,28 +169,25 @@ namespace Hurricane {
|
||||||
// Class : "Hurricane::TabSelection".
|
// Class : "Hurricane::TabSelection".
|
||||||
|
|
||||||
|
|
||||||
class TabSelection : public QWidget {
|
class TabSelection : public ControllerTab {
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TabSelection ( QWidget* parent=NULL );
|
TabSelection ( QWidget* parent=NULL );
|
||||||
inline CellWidget* getCellWidget ();
|
inline SelectionWidget* getSelection ();
|
||||||
inline SelectionWidget* getSelection ();
|
virtual void updateTab ();
|
||||||
void updateTab ();
|
virtual void cellPreModificate ();
|
||||||
void cellPreModificate ();
|
virtual void cellPostModificate ();
|
||||||
void cellPostModificate ();
|
|
||||||
public slots:
|
public slots:
|
||||||
void setCell ( Cell* );
|
virtual void setCell ( Cell* );
|
||||||
void setCellWidget ( CellWidget* );
|
virtual void setCellWidget ( CellWidget* );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CellWidget* _cellWidget;
|
|
||||||
SelectionWidget* _selection;
|
SelectionWidget* _selection;
|
||||||
bool _selectionChanged;
|
bool _selectionChanged;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline CellWidget* TabSelection::getCellWidget () { return _cellWidget; }
|
|
||||||
inline SelectionWidget* TabSelection::getSelection () { return _selection; }
|
inline SelectionWidget* TabSelection::getSelection () { return _selection; }
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,33 +195,30 @@ namespace Hurricane {
|
||||||
// Class : "Hurricane::TabInspector".
|
// Class : "Hurricane::TabInspector".
|
||||||
|
|
||||||
|
|
||||||
class TabInspector : public QWidget {
|
class TabInspector : public ControllerTab {
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TabInspector ( QWidget* parent=NULL );
|
TabInspector ( QWidget* parent=NULL );
|
||||||
inline CellWidget* getCellWidget ();
|
inline InspectorWidget* getInspectorWidget ();
|
||||||
inline InspectorWidget* getInspectorWidget ();
|
inline QComboBox* getBookmarks ();
|
||||||
inline QComboBox* getBookmarks ();
|
virtual void updateTab ();
|
||||||
void updateTab ();
|
virtual void cellPreModificate ();
|
||||||
void cellPreModificate ();
|
virtual void cellPostModificate ();
|
||||||
void cellPostModificate ();
|
public slots:
|
||||||
public slots:
|
virtual void setCell ( Cell* );
|
||||||
void setCell ( Cell* );
|
virtual void setCellWidget ( CellWidget* );
|
||||||
void setCellWidget ( CellWidget* );
|
virtual void setSelectionOccurrence ( Occurrence& );
|
||||||
void setSelectionRecord ( Record* );
|
virtual void bookmarkChanged ( int index );
|
||||||
void bookmarkChanged ( int index );
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CellWidget* _cellWidget;
|
|
||||||
InspectorWidget* _inspectorWidget;
|
InspectorWidget* _inspectorWidget;
|
||||||
QComboBox* _bookmarks;
|
QComboBox* _bookmarks;
|
||||||
Record* _selectionRecord;
|
Occurrence _selectionOccurrence;
|
||||||
bool _updateFromSelection;
|
bool _updateFromSelection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline CellWidget* TabInspector::getCellWidget () { return _cellWidget; }
|
|
||||||
inline InspectorWidget* TabInspector::getInspectorWidget () { return _inspectorWidget; }
|
inline InspectorWidget* TabInspector::getInspectorWidget () { return _inspectorWidget; }
|
||||||
inline QComboBox* TabInspector::getBookmarks () { return _bookmarks; }
|
inline QComboBox* TabInspector::getBookmarks () { return _bookmarks; }
|
||||||
|
|
||||||
|
@ -188,20 +247,20 @@ namespace Hurricane {
|
||||||
void updateTab ( int index );
|
void updateTab ( int index );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CellWidget* _cellWidget;
|
CellWidget* _cellWidget;
|
||||||
GraphicsWidget* _graphics;
|
TabGraphics* _tabGraphics;
|
||||||
PaletteWidget* _palette;
|
TabPalette* _tabPalette;
|
||||||
DisplayFilterWidget* _displayFilter;
|
TabDisplayFilter* _tabDisplayFilter;
|
||||||
TabNetlist* _tabNetlist;
|
TabNetlist* _tabNetlist;
|
||||||
TabSelection* _tabSelection;
|
TabSelection* _tabSelection;
|
||||||
TabInspector* _tabInspector;
|
TabInspector* _tabInspector;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
inline CellWidget* ControllerWidget::getCellWidget () { return _cellWidget; }
|
inline CellWidget* ControllerWidget::getCellWidget () { return _cellWidget; }
|
||||||
inline GraphicsWidget* ControllerWidget::getGraphics () { return _graphics; }
|
inline GraphicsWidget* ControllerWidget::getGraphics () { return _tabGraphics->getGraphics(); }
|
||||||
inline PaletteWidget* ControllerWidget::getPalette () { return _palette; }
|
inline PaletteWidget* ControllerWidget::getPalette () { return _tabPalette->getPalette(); }
|
||||||
inline DisplayFilterWidget* ControllerWidget::getDisplayFilter () { return _displayFilter; }
|
inline DisplayFilterWidget* ControllerWidget::getDisplayFilter () { return _tabDisplayFilter->getDisplayFilter(); }
|
||||||
inline NetlistWidget* ControllerWidget::getNetlistBrowser () { return _tabNetlist->getNetlistBrowser(); }
|
inline NetlistWidget* ControllerWidget::getNetlistBrowser () { return _tabNetlist->getNetlistBrowser(); }
|
||||||
inline SelectionWidget* ControllerWidget::getSelection () { return _tabSelection->getSelection(); }
|
inline SelectionWidget* ControllerWidget::getSelection () { return _tabSelection->getSelection(); }
|
||||||
inline InspectorWidget* ControllerWidget::getInspectorWidget () { return _tabInspector->getInspectorWidget(); }
|
inline InspectorWidget* ControllerWidget::getInspectorWidget () { return _tabInspector->getInspectorWidget(); }
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
#include "hurricane/Commons.h"
|
#include "hurricane/Commons.h"
|
||||||
|
#include "hurricane/Occurrence.h"
|
||||||
|
|
||||||
|
|
||||||
class QSortFilterProxyModel;
|
class QSortFilterProxyModel;
|
||||||
|
@ -79,16 +80,18 @@ namespace Hurricane {
|
||||||
public:
|
public:
|
||||||
InspectorWidget ( QWidget* parent=NULL );
|
InspectorWidget ( QWidget* parent=NULL );
|
||||||
~InspectorWidget ();
|
~InspectorWidget ();
|
||||||
void setRootRecord ( Record* record );
|
void setRootRecord ( Record* );
|
||||||
|
void setRootOccurrence ( Occurrence& );
|
||||||
private slots:
|
private slots:
|
||||||
void forceRowHeight ();
|
void forceRowHeight ();
|
||||||
void textFilterChanged ();
|
void textFilterChanged ();
|
||||||
void historyChanged ( int depth );
|
void historyChanged ( int depth );
|
||||||
void forkInspector ( const QModelIndex& index );
|
void forkInspector ( const QModelIndex& );
|
||||||
protected:
|
protected:
|
||||||
void keyPressEvent ( QKeyEvent * event );
|
void keyPressEvent ( QKeyEvent* );
|
||||||
private:
|
private:
|
||||||
void pushSlot ( Slot* slot );
|
void _setRootRecord ( Record* );
|
||||||
|
void pushSlot ( Slot* );
|
||||||
void popSlot ();
|
void popSlot ();
|
||||||
void back ();
|
void back ();
|
||||||
bool setSlot ();
|
bool setSlot ();
|
||||||
|
@ -101,6 +104,7 @@ namespace Hurricane {
|
||||||
QLineEdit* _filterPatternLineEdit;
|
QLineEdit* _filterPatternLineEdit;
|
||||||
int _rowHeight;
|
int _rowHeight;
|
||||||
History _history;
|
History _history;
|
||||||
|
Occurrence _rootOccurrence;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -66,6 +66,7 @@ namespace Hurricane {
|
||||||
void showSelectionToggled ( bool );
|
void showSelectionToggled ( bool );
|
||||||
void selectionCleared ();
|
void selectionCleared ();
|
||||||
void inspect ( Record* );
|
void inspect ( Record* );
|
||||||
|
void inspect ( Occurrence& );
|
||||||
public slots:
|
public slots:
|
||||||
void setShowSelection ( bool );
|
void setShowSelection ( bool );
|
||||||
void selectCurrent ( const QModelIndex& current, const QModelIndex& );
|
void selectCurrent ( const QModelIndex& current, const QModelIndex& );
|
||||||
|
|
Loading…
Reference in New Issue