ctkDICOMQueryRetrieveWidget.cpp

Go to the documentation of this file.
00001 #include <QDebug>
00002 #include <QTreeView>
00003 #include <QTabBar>
00004 
00005 // ctkDICOMWidgets includes
00006 #include "ctkDICOMQueryRetrieveWidget.h"
00007 #include "ctkDICOMQueryResultsTabWidget.h"
00008 #include "ui_ctkDICOMQueryRetrieveWidget.h"
00009 
00010 #include <ctkLogger.h>
00011 static ctkLogger logger("org.commontk.DICOM.Widgets.ctkDICOMQueryRetrieveWidget");
00012 
00013 //----------------------------------------------------------------------------
00014 class ctkDICOMQueryRetrieveWidgetPrivate: public ctkPrivate<ctkDICOMQueryRetrieveWidget>,
00015                                           public Ui_ctkDICOMQueryRetrieveWidget
00016 {
00017 public:
00018   ctkDICOMQueryRetrieveWidgetPrivate(){}
00019 };
00020 
00021 //----------------------------------------------------------------------------
00022 // ctkDICOMQueryRetrieveWidgetPrivate methods
00023 
00024 
00025 //----------------------------------------------------------------------------
00026 // ctkDICOMQueryRetrieveWidget methods
00027 
00028 //----------------------------------------------------------------------------
00029 ctkDICOMQueryRetrieveWidget::ctkDICOMQueryRetrieveWidget(QWidget* _parent):Superclass(_parent)
00030 {
00031   CTK_INIT_PRIVATE(ctkDICOMQueryRetrieveWidget);
00032   CTK_D(ctkDICOMQueryRetrieveWidget);
00033   
00034   d->setupUi(this);
00035 
00036   d->results->disableCloseOnTab(0);
00037   connect(d->queryButton, SIGNAL(clicked()), this, SLOT(processQuery()));
00038   connect(d->results, SIGNAL(tabCloseRequested(int)), this, SLOT(onTabCloseRequested(int)));
00039 }
00040 
00041 //----------------------------------------------------------------------------
00042 ctkDICOMQueryRetrieveWidget::~ctkDICOMQueryRetrieveWidget()
00043 {
00044 }
00045 
00046 //----------------------------------------------------------------------------
00047 void ctkDICOMQueryRetrieveWidget::onTabCloseRequested(int index)
00048 {
00049   CTK_D(ctkDICOMQueryRetrieveWidget);
00050 
00051   if (index == 0)
00052   {
00053     return;
00054   }
00055 
00056   d->results->removeTab(index);
00057 }
00058 
00059 //----------------------------------------------------------------------------
00060 void ctkDICOMQueryRetrieveWidget::processQuery()
00061 {
00062   CTK_D(ctkDICOMQueryRetrieveWidget);
00063 
00064   d->serverNodeWidget->populateQuery();
00065   d->queryWidget->populateQuery();
00066 
00067   QTreeView *queryResults = new QTreeView;
00068   int tabIndex = d->results->addTab(queryResults, tr("Query Results"));
00069   d->results->setCurrentIndex(tabIndex);
00070 }
00071 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated on 21 May 2010 for CTK by  doxygen 1.6.1