arbeit
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

FieldVecProps.cpp

Go to the documentation of this file.
00001 //------------------------------------------------------------------------
00002 //
00003 //   Joe Kniss
00004 //     6-20-03
00005 //                   ________    ____   ___ 
00006 //                  |        \  /    | /  /
00007 //                  +---+     \/     |/  /
00008 //                  +--+|  |\    /|     < 
00009 //                  |  ||  | \  / |  |\  \ 
00010 //                  |      |  \/  |  | \  \ 
00011 //                   \_____|      |__|  \__\
00012 //                       Copyright  2003 
00013 //                      Joe Michael Kniss
00014 //                   <<< jmk@cs.utah.edu >>>
00015 //               "All Your Base are Belong to Us"
00016 //-------------------------------------------------------------------------
00017 
00018 
00019 ///FieldVecProps.h
00020 ///  simianUI
00021 
00022 #include "FieldVecProps.h"
00023 #include <iostream>
00024 #include <qlayout.h>
00025 
00026 using namespace std;
00027 
00028 FieldVecProps::FieldVecProps(VolumeSP v, QWidget *parent, const char *name, WFlags wf)
00029 : QWidget(parent, name, wf), _v(v)
00030 {
00031    conf();
00032 }
00033 
00034 FieldVecProps::~FieldVecProps()
00035 {
00036    
00037 }
00038 
00039 void FieldVecProps::conf()
00040 {
00041    if(_v.isNull())
00042    {
00043       cerr << "null volume" << endl;
00044       return;
00045    }
00046 
00047    // Create a layout to position the widgets
00048    //QHBoxLayout *topLayout = new QHBoxLayout( this, 1 );
00049 
00050    int nFields = _v->fields.size();
00051    
00052    // Create a grid layout for all the info
00053    // n rows, 1 column
00054    QGridLayout *grid = new QGridLayout(this, nFields, 1);
00055    grid->setAlignment(Qt::AlignTop);
00056 
00057    for(int i=0; i< nFields; ++i)
00058    {
00059       VolFieldSP vf = _v->fields.getField(i);
00060       if(vf.isNull()) continue;
00061       FieldProperties *fp = new FieldProperties(vf,this, "a field");
00062       grid->addWidget(fp, i, 0, Qt::AlignLeft|Qt::AlignTop);
00063    }
00064 
00065 }

Send questions, comments, and bug reports to:
jmk