ListDialogBase.cpp

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

Generated for HippoDraw Class Library by doxygen