ListDialogBase.cpp

Go to the documentation of this file.
00001 /****************************************************************************
00002 ** Form implementation generated from reading ui file 'ListDialogBase.ui'
00003 **
00004 ** Created by: The User Interface Compiler ($Id: qt/main.cpp   3.3.8   edited Jan 11 14:47 $)
00005 **
00006 ** WARNING! All changes made in this file will be lost!
00007 ****************************************************************************/
00008 
00009 #include "ListDialogBase.h"
00010 
00011 #include <qvariant.h>
00012 #include <qlabel.h>
00013 #include <qheader.h>
00014 #include <qlistview.h>
00015 #include <qpushbutton.h>
00016 #include <qlayout.h>
00017 #include <qtooltip.h>
00018 #include <qwhatsthis.h>
00019 
00020 /*
00021  *  Constructs a ListDialogBase as a child of 'parent', with the
00022  *  name 'name' and widget flags set to 'f'.
00023  *
00024  *  The dialog will by default be modeless, unless you set 'modal' to
00025  *  TRUE to construct a modal dialog.
00026  */
00027 ListDialogBase::ListDialogBase( QWidget* parent, const char* name, bool modal, WFlags fl )
00028     : QDialog( parent, name, modal, fl )
00029 {
00030     if ( !name )
00031         setName( "ListDialogBase" );
00032 
00033     textLabel1 = new QLabel( this, "textLabel1" );
00034     textLabel1->setGeometry( QRect( 10, 10, 280, 101 ) );
00035 
00036     m_tuple_list = new QListView( this, "m_tuple_list" );
00037     m_tuple_list->addColumn( tr( "Item" ) );
00038     m_tuple_list->addColumn( tr( "Name" ) );
00039     m_tuple_list->setGeometry( QRect( 10, 110, 280, 100 ) );
00040     m_tuple_list->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)7, 0, 0, m_tuple_list->sizePolicy().hasHeightForWidth() ) );
00041     m_tuple_list->setFrameShape( QListView::StyledPanel );
00042     m_tuple_list->setFrameShadow( QListView::Sunken );
00043     m_tuple_list->setHScrollBarMode( QListView::Auto );
00044     m_tuple_list->setAllColumnsShowFocus( TRUE );
00045     m_tuple_list->setShowSortIndicator( TRUE );
00046     m_tuple_list->setResizeMode( QListView::AllColumns );
00047 
00048     m_select_button = new QPushButton( this, "m_select_button" );
00049     m_select_button->setGeometry( QRect( 160, 225, 91, 28 ) );
00050     m_select_button->setAutoDefault( FALSE );
00051     m_select_button->setDefault( TRUE );
00052 
00053     m_cancel_button = new QPushButton( this, "m_cancel_button" );
00054     m_cancel_button->setGeometry( QRect( 40, 225, 91, 28 ) );
00055     m_cancel_button->setAutoDefault( FALSE );
00056     languageChange();
00057     resize( QSize(307, 272).expandedTo(minimumSizeHint()) );
00058     clearWState( WState_Polished );
00059 
00060     // signals and slots connections
00061     connect( m_select_button, SIGNAL( clicked() ), this, SLOT( accept() ) );
00062     connect( m_cancel_button, SIGNAL( clicked() ), this, SLOT( reject() ) );
00063     connect( m_tuple_list, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( doubleClicked() ) );
00064 }
00065 
00066 /*
00067  *  Destroys the object and frees any allocated resources
00068  */
00069 ListDialogBase::~ListDialogBase()
00070 {
00071     // no need to delete child widgets, Qt does it all for us
00072 }
00073 
00074 /*
00075  *  Sets the strings of the subwidgets using the current
00076  *  language.
00077  */
00078 void ListDialogBase::languageChange()
00079 {
00080     setCaption( tr( "Select ntuple" ) );
00081     textLabel1->setText( tr( "The selected file contains\n"
00082 "more than one ntuple.\n"
00083 "\n"
00084 "Select which one you want from list below.\n"
00085 "" ) );
00086     m_tuple_list->header()->setLabel( 0, tr( "Item" ) );
00087     m_tuple_list->header()->setLabel( 1, tr( "Name" ) );
00088     m_select_button->setText( tr( "Select" ) );
00089     m_cancel_button->setText( tr( "Cancel" ) );
00090 }
00091 

Generated for HippoDraw Class Library by doxygen