9 #include <QRadioButton> 
   10 #include <QPushButton> 
   11 #include <QButtonGroup> 
   14 namespace te_qt = te::qt::widgets;
 
   20   QRadioButton* f = 
new QRadioButton(tr(
"File"), 
this);
 
   21   QRadioButton* d = 
new QRadioButton(tr(
"Directory"), 
this);
 
   22   QButtonGroup* grp = 
new QButtonGroup(
this);
 
   23   QHBoxLayout* hlay = 
new QHBoxLayout;
 
   24   QVBoxLayout* vlay = 
new QVBoxLayout;
 
   27   vlay->addSpacerItem(
new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum));
 
   31   vlay->addLayout(hlay);
 
   32   vlay->addSpacerItem(
new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::Expanding));
 
   34   QGridLayout* grd = 
new QGridLayout(
this);
 
   35   grd->addLayout(vlay, 0, 0, 1, 1);
 
   42   connect(grp, SIGNAL(buttonClicked(
int)), SLOT(
setResource(
int)));
 
   51   return m_fchooser->getSelectedResource();
 
   56   m_fchooser->setFilterPattern(filter);
 
   63   QPushButton* okBtn = 
new QPushButton(tr(
"&Ok"), &dlg);
 
   64   QPushButton* cancelBtn = 
new QPushButton(tr(
"&Cancel"), &dlg);
 
   65   QPushButton* helpBtn = 
new QPushButton(tr(
"&Help"), &dlg);
 
   66   QHBoxLayout* hlay = 
new QHBoxLayout;
 
   67   QVBoxLayout* vlay = 
new QVBoxLayout;
 
   68   QGridLayout* grd = 
new QGridLayout(&dlg);
 
   70   hlay->addWidget(helpBtn);
 
   71   hlay->addSpacerItem(
new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum));
 
   72   hlay->addWidget(okBtn);
 
   73   hlay->addWidget(cancelBtn);
 
   76   vlay->addLayout(hlay);
 
   77   grd->addLayout(vlay, 0, 0, 1, 1);
 
   82   dlg.setWindowTitle(tr(
"Choose a xml file or a directory containing xml plug-in files"));
 
   84   dlg.connect(okBtn, SIGNAL(pressed()), SLOT(accept()));
 
   85   dlg.connect(cancelBtn, SIGNAL(pressed()), SLOT(reject()));
 
   88   if(dlg.exec() == QDialog::Accepted)
 
Defines a component for choose a file. 
 
Defines a component for choosing a file or directory.