00001 /*========================================================================= 00002 Program: bbtk 00003 Module: $RCSfile: bbtkQtBlackBoxDialog.cxx,v $ 00004 Language: C++ 00005 Date: $Date: 2010/01/14 13:17:27 $ 00006 Version: $Revision: 1.4 $ 00007 =========================================================================*/ 00008 00009 /* --------------------------------------------------------------------- 00010 00011 * Copyright (c) CREATIS-LRMN (Centre de Recherche en Imagerie Medicale) 00012 * Authors : Eduardo Davila, Laurent Guigues, Jean-Pierre Roux 00013 * 00014 * This software is governed by the CeCILL-B license under French law and 00015 * abiding by the rules of distribution of free software. You can use, 00016 * modify and/ or redistribute the software under the terms of the CeCILL-B 00017 * license as circulated by CEA, CNRS and INRIA at the following URL 00018 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 00019 * or in the file LICENSE.txt. 00020 * 00021 * As a counterpart to the access to the source code and rights to copy, 00022 * modify and redistribute granted by the license, users are provided only 00023 * with a limited warranty and the software's author, the holder of the 00024 * economic rights, and the successive licensors have only limited 00025 * liability. 00026 * 00027 * The fact that you are presently reading this means that you have had 00028 * knowledge of the CeCILL-B license and that you accept its terms. 00029 * ------------------------------------------------------------------------ */ 00030 00031 #ifdef USE_QT 00032 00033 #include "bbtkQtBlackBoxDialog.h" 00034 #include "bbtkQtBlackBox.h" 00035 00036 namespace bbtk 00037 { 00038 00039 00040 //========================================================================= 00041 QtBlackBoxDialog::QtBlackBoxDialog(QtBlackBox::Pointer box, 00042 QWidget *parent, 00043 const std::string& title, 00044 int width, int height) 00045 00046 : 00047 QDialog(parent), 00048 mBox(box) 00049 // QDialog( parent ) 00050 { 00051 bbtkDebugMessage("widget",9,"["<< 00052 box->bbGetName()<<"] QtBlackBoxDialog("<<parent<<",\"" 00053 <<title<<"\","<<width<<"x"<<height<<")"<<std::endl); 00054 Qt::IncNbWindowsAlive(); 00055 // Sets up the GUI inherited from Ui::bbtkQtblackBoxDialog 00056 setupUi(this); 00057 resize ( width , height ); 00058 setWindowTitle(title.c_str()); 00059 00061 box->bbSetWindow(this); 00062 // Create the widget 00063 box->bbUserCreateWidget(widget); 00064 00065 // Insert into the layout 00066 horizontalLayout->addWidget(box->bbGetOutputWidget()); 00067 00068 00069 // updateGeometry(); 00070 00071 } 00072 //========================================================================= 00073 00074 00075 //========================================================================= 00076 QtBlackBoxDialog::~QtBlackBoxDialog() 00077 { 00078 if (mBox.lock()) 00079 bbtkDebugMessage("widget",9,"["<<mBox.lock()->bbGetName() 00080 <<"] $$$$$$$$$$$$$$$$$$$ ~QtBlackBoxDialog()" 00081 <<std::endl); 00082 else 00083 bbtkDebugMessage("widget",9,"[DEAD] $$$$$$$$$$$$$$$$$$$$$ ~QtBlackBoxDialog()"<<std::endl); 00084 //bbtkDebugMessage("widget",9,"WxFrame::~WxFrame()"<<std::endl); 00085 if (mBox.lock()) mBox.lock()->bbSetWindow(0); 00086 Qt::DecNbWindowsAlive(); 00087 } 00088 //========================================================================= 00089 00090 } 00091 #endif 00092