示例#1
0
DisplayWindow::DisplayWindow( QWidget* parent )
: QWidget(parent)
{
#ifndef RELEASE
    CallStackEntry entry("DisplayWindow::DisplayWindow");
#endif
    matrix_ = 0;

    // For the real matrix
    QHBoxLayout* matrixLayout = new QHBoxLayout();
    display_ = new DisplayWidget<double>();
    scroll_ = new QScrollArea();
    scroll_->setWidget( display_ );
    matrixLayout->addWidget( scroll_ );

    // Add two buttons at the bottom
    QHBoxLayout* buttonLayout = new QHBoxLayout();
    QPushButton* localButton = new QPushButton("Local");
    QPushButton* globalButton = new QPushButton("Global");
    buttonLayout->addWidget( localButton );
    buttonLayout->addWidget( globalButton );

    // Stack the matrix on top of the buttons
    QVBoxLayout* mainLayout = new QVBoxLayout();
    mainLayout->addLayout( matrixLayout );
    mainLayout->addLayout( buttonLayout );
    setLayout( mainLayout );

    connect( localButton, SIGNAL(clicked()), this, SLOT(UseLocalScale()) );
    connect( globalButton, SIGNAL(clicked()), this, SLOT(UseGlobalScale()) );
    setAttribute( Qt::WA_DeleteOnClose );

    // Elemental needs to know if a window was opened for cleanup purposes
    OpenedWindow();
}
示例#2
0
DisplayWindow::DisplayWindow( QWidget* parent )
: QWidget(parent)
{
    DEBUG_ONLY(CallStackEntry cse("DisplayWindow::DisplayWindow"))
    matrix_ = 0;
    QVBoxLayout* mainLayout = new QVBoxLayout();

    QHBoxLayout* matrixLayout = new QHBoxLayout();
    // Real data
    display_ = new DisplayWidget<double>();
    scroll_ = new QScrollArea();
    scroll_->setWidget( display_ );
    matrixLayout->addWidget( scroll_ );
    // Push
    mainLayout->addLayout( matrixLayout );

    // Add a save button and a check box for the scale
    QHBoxLayout* optionsLayout = new QHBoxLayout();
    QPushButton* saveButton = new QPushButton("Save");
    QCheckBox* scaleBox = new QCheckBox("Global scale");
    optionsLayout->addWidget( saveButton );
    optionsLayout->addWidget( scaleBox );
    // Push
    mainLayout->addLayout( optionsLayout ); 

    setLayout( mainLayout );
    connect( saveButton, SIGNAL(clicked()), this, SLOT(Save()) );
    connect( scaleBox, SIGNAL(clicked(bool)), this, SLOT(SetScale(bool)) );
    setAttribute( Qt::WA_DeleteOnClose );

    // Elemental needs to know if a window was opened for cleanup purposes
    OpenedWindow();
}
示例#3
0
SpyWindow::SpyWindow( QWidget* parent )
: QWidget(parent)
{
    DEBUG_ONLY(CallStackEntry cse("SpyWindow::SpyWindow"))
    matrix_ = 0;

    // For the real matrix
    QHBoxLayout* matrixLayout = new QHBoxLayout();
    spy_ = new SpyWidget();
    scroll_ = new QScrollArea();
    scroll_->setWidget( spy_ );
    matrixLayout->addWidget( scroll_ );
    setLayout( matrixLayout );

    setAttribute( Qt::WA_DeleteOnClose );

    // Elemental needs to know if a window was opened for cleanup purposes
    OpenedWindow();
}
ComplexDisplayWindow::ComplexDisplayWindow( QWidget* parent )
: QWidget(parent)
{
    DEBUG_ONLY(CSE cse("ComplexDisplayWindow::ComplexDisplayWindow"))
    matrix_ = 0;
    QVBoxLayout* mainLayout = new QVBoxLayout();

    QHBoxLayout* matrixLayout = new QHBoxLayout();
    // Real data
    realDisplay_ = new DisplayWidget<Complex<double>>();
    realScroll_ = new QScrollArea();
    realScroll_->setWidget( realDisplay_ );
    matrixLayout->addWidget( realScroll_ );
    // Imaginary data
    imagDisplay_ = new DisplayWidget<Complex<double>>();
    imagScroll_ = new QScrollArea();
    imagScroll_->setWidget( imagDisplay_ );
    matrixLayout->addWidget( imagScroll_ );
    // Push both
    mainLayout->addLayout( matrixLayout );

    // Two buttons for saving real and imaginary images
    QHBoxLayout* saveLayout = new QHBoxLayout();
    QPushButton* realSaveButton = new QPushButton("Save real");
    QPushButton* imagSaveButton = new QPushButton("Save imag");
    saveLayout->addWidget( realSaveButton );
    saveLayout->addWidget( imagSaveButton );
    mainLayout->addLayout( saveLayout );

    // Checkbox for switching to the global scale
    QCheckBox* scaleBox = new QCheckBox("Global scale");
    mainLayout->addWidget( scaleBox );

    setLayout( mainLayout );
    connect( realSaveButton, SIGNAL(clicked()), this, SLOT(SaveReal()) );
    connect( imagSaveButton, SIGNAL(clicked()), this, SLOT(SaveImag()) );
    connect( scaleBox, SIGNAL(clicked(bool)), this, SLOT(SetScale(bool)) );
    setAttribute( Qt::WA_DeleteOnClose );

    // Elemental needs to know if a window was opened for cleanup purposes
    OpenedWindow();
}