Back to index

salome-smesh  6.5.0
Classes | Public Types | Signals | Public Member Functions | Private Types | Private Slots | Private Member Functions | Private Attributes
StdMeshersGUI_DistrTableFrame Class Reference

Distribution table widget. More...

#include <StdMeshersGUI_DistrTable.h>

Collaboration diagram for StdMeshersGUI_DistrTableFrame:
Collaboration graph
[legend]

List of all members.

Classes

class  SpinBoxDelegate
 Custom item delegate (uses double spin box to edit table item) More...
class  Table
 Table function widget. More...

Public Types

enum  TableButton { InsertRowBtn, RemoveRowBtn }

Signals

void valueChanged (int, int)
void currentChanged (int, int)

Public Member Functions

 StdMeshersGUI_DistrTableFrame (QWidget *=0)
 ~StdMeshersGUI_DistrTableFrame ()
void showButton (const TableButton, const bool)
bool isButtonShown (const TableButton) const
void data (DataArray &) const
void setData (const DataArray &)
void setFuncMinValue (double)

Private Types

enum  { ArgColumn, FuncColumn }
typedef SMESH::double_array DataArray

Private Slots

void onInsert ()
void onRemove ()

Private Member Functions

QPushButton * button (const TableButton) const

Private Attributes

QMap< int, QPushButton * > myButtons
TablemyTable

Detailed Description

Distribution table widget.

Definition at line 43 of file StdMeshersGUI_DistrTable.h.


Member Typedef Documentation

Definition at line 50 of file StdMeshersGUI_DistrTable.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
ArgColumn 
FuncColumn 

Definition at line 47 of file StdMeshersGUI_DistrTable.h.

Enumerator:
InsertRowBtn 
RemoveRowBtn 

Definition at line 55 of file StdMeshersGUI_DistrTable.h.


Constructor & Destructor Documentation

Definition at line 510 of file StdMeshersGUI_DistrTable.cxx.

  : QWidget( parent )
{
  QGridLayout* main = new QGridLayout( this );
  main->setMargin( 0 );
  main->setSpacing( 0 );

  // ---
  myTable = new Table( this );
  connect( myTable, SIGNAL( valueChanged( int, int ) ), this, SIGNAL( valueChanged( int, int ) ) );

  myButtons[ InsertRowBtn ] = new QPushButton( tr( "SMESH_INSERT_ROW" ), this );
  myButtons[ RemoveRowBtn ] = new QPushButton( tr( "SMESH_REMOVE_ROW" ), this );


  // ---
  main->addWidget( myTable , 0, 0, 1, 3);
  main->addWidget( myButtons[ InsertRowBtn ] , 1, 0);
  main->addWidget( myButtons[ RemoveRowBtn ] , 1, 1);
  main->setColumnStretch(2, 1);
  main->setSpacing( SPACING );
  
  // ---
  connect( myButtons[ InsertRowBtn ], SIGNAL( clicked() ), this, SLOT( onInsert() ) );
  connect( myButtons[ RemoveRowBtn ], SIGNAL( clicked() ), this, SLOT( onRemove() ) );
  connect( myTable, SIGNAL( currentCellChanged( int, int, int, int ) ),
           this,    SIGNAL( currentChanged( int, int ) ) );
  connect( myTable, SIGNAL( cellChanged( int, int ) ),
           this,    SIGNAL( valueChanged( int, int ) ) );
}

Here is the call graph for this function:

Definition at line 542 of file StdMeshersGUI_DistrTable.cxx.

{
}

Member Function Documentation

QPushButton * StdMeshersGUI_DistrTableFrame::button ( const TableButton  b) const [private]

Definition at line 593 of file StdMeshersGUI_DistrTable.cxx.

{
  return myButtons.contains( b ) ? myButtons[ b ] : 0;
}

Here is the caller graph for this function:

void StdMeshersGUI_DistrTableFrame::currentChanged ( int  ,
int   
) [signal]

Here is the caller graph for this function:

Definition at line 562 of file StdMeshersGUI_DistrTable.cxx.

{
  QList<double> d = myTable->data();
  sortData( d );

  array.length( d.count() );
  for ( int i = 0; i < d.count(); i++ )
    array[i] = d[i];
}

Here is the call graph for this function:

Definition at line 555 of file StdMeshersGUI_DistrTable.cxx.

{
  return button( b ) ? button( b )->isVisible() : false;
}

Here is the call graph for this function:

void StdMeshersGUI_DistrTableFrame::onInsert ( ) [private, slot]

Definition at line 600 of file StdMeshersGUI_DistrTable.cxx.

{
  myTable->addRow();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void StdMeshersGUI_DistrTableFrame::onRemove ( ) [private, slot]

Definition at line 607 of file StdMeshersGUI_DistrTable.cxx.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 574 of file StdMeshersGUI_DistrTable.cxx.

{
  QList<double> d;
  for ( int i = 0; i < array.length(); i++ )
    d.append( array[i] );

  sortData( d );
  myTable->setData( d );
}

Here is the call graph for this function:

Definition at line 586 of file StdMeshersGUI_DistrTable.cxx.

Here is the call graph for this function:

void StdMeshersGUI_DistrTableFrame::showButton ( const TableButton  b,
const bool  on 
)

Definition at line 548 of file StdMeshersGUI_DistrTable.cxx.

{
  if ( button( b ) ) button( b )->setVisible( on );
}

Here is the call graph for this function:

void StdMeshersGUI_DistrTableFrame::valueChanged ( int  ,
int   
) [signal]

Here is the caller graph for this function:


Member Data Documentation

QMap<int, QPushButton*> StdMeshersGUI_DistrTableFrame::myButtons [private]

Definition at line 80 of file StdMeshersGUI_DistrTable.h.

Definition at line 81 of file StdMeshersGUI_DistrTable.h.


The documentation for this class was generated from the following files: