All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Types | Public Member Functions | Protected Member Functions
QGpGuiTools::Dialog Class Reference

Dialog class for saving current rect in registry When a dialog box is not visible on the screen, it is not possible to retrieve its correct rectangle and state (maximized, minimized,...). This class dynamically store the rectangle while the dialog box is visible and save it to registry upon request, usually after Settings::setWidget(). More...

#include <Dialog.h>

Inheritance diagram for QGpGuiTools::Dialog:
QGpGuiTools::FrameGrabber AddPlotParam AGC Convolution Correlations CustomAsciiFormatsEditor CutSignal DecimateAmplitude DinverDCGui::ViewerParam DownloadGpsRaw ExportFileType ExportPick FKOptions FreqVelocityFilter GenerateGeometry GenericOptions GeopsyAboutDialog GeopsyGui::ArrayDefinition GeopsyGui::AsciiSignalFormatEditor GeopsyGui::CityLoader GeopsyGui::LoadFormat GeopsyGui::PickToPick GeopsyGui::RD3LogParameter GeopsyGui::RelativePositions GeopsyGui::TimeReference GeopsySLinkGui::SeedLinkLoaderOptions LoadFilePattern MaxNumProcess ModelSliderEditor MonoStation::LoadWinStatList MonoStation::PeakSearchRange MonoStation::ReplaceLog MonoStation::SetCategory MonoStation::StudentTest NetworkParameterEditor PluginPaths PluginSelector Preferences QGpGuiTools::Attachments QGpGuiTools::BugReport QGpGuiTools::ColumnTextColumnsProperties QGpGuiTools::ColumnTextLinesProperties QGpGuiTools::ColumnTextSectionsProperties QGpGuiTools::ConnectionParam QGpGuiTools::CoordinateFile QGpGuiTools::MessageBox RotateComponents SciFigs::CurveBrowserCut SciFigs::CurveBrowserResample SciFigs::CurveBrowserSmooth SciFigs::CurveSelector SciFigs::MakeUpFilter SciFigs::PaletteInterpole SciFigs::PointProperties SciFigs::SciFigsPreferences SeismicParameterEditor SelectPSViewer SetHeader SetTableFields SortKeys SPACOptions StaLta StationCoordinates StructureIntro SubtractSignals SubtractValue Taper TFAOptions Thresholds

List of all members.

Public Types

enum  Buttons { None, OkCancel, Close, TitleClose }

Public Member Functions

void addButtons (Buttons b=OkCancel)
void addWidget (QWidget *w)
 Dialog (QWidget *parent=0, Qt::WFlags f=0)
void getRect (QString name)
void setMainWidget (QWidget *w, Buttons b=OkCancel)
void setRect (QString name)

Protected Member Functions

virtual void closeEvent (QCloseEvent *e)
virtual void moveEvent (QMoveEvent *e)
virtual void resizeEvent (QResizeEvent *e)

Detailed Description

Dialog class for saving current rect in registry When a dialog box is not visible on the screen, it is not possible to retrieve its correct rectangle and state (maximized, minimized,...). This class dynamically store the rectangle while the dialog box is visible and save it to registry upon request, usually after Settings::setWidget().


Member Enumeration Documentation

Enumerator:
None 
OkCancel 
Close 
TitleClose 

Constructor & Destructor Documentation

QGpGuiTools::Dialog::Dialog ( QWidget *  parent = 0,
Qt::WFlags  f = 0 
)

References None, and TRACE.

Referenced by QGpGuiTools::CoordinateFile::write().

  : QDialog(parent, f)
{
  TRACE;
  _vboxLayout=0;
  _buttons=None;
}

Member Function Documentation

Shows any number of widgets (vertical layout) in a modal dialog box with bottom buttons. At least one call to addWidget is required by calling this function.

See also:
addWidget(), setMainWidget()

References Close, None, OkCancel, TitleClose, and TRACE.

Referenced by setMainWidget().

{
  TRACE;
  ASSERT(_vboxLayout);

  QDialogButtonBox * buttonBox=0;
  switch(b) {
  case OkCancel:
    buttonBox=new QDialogButtonBox(this);
    buttonBox->addButton(QDialogButtonBox::Ok);
    buttonBox->addButton(QDialogButtonBox::Cancel);
    connect (buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect (buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    _vboxLayout->addWidget(buttonBox);
    resize(minimumSizeHint());
    break;
  case Close:
    buttonBox=new QDialogButtonBox(this);
    buttonBox->addButton(QDialogButtonBox::Close);
    connect (buttonBox, SIGNAL(rejected()), this, SLOT(accept()));
    _vboxLayout->addWidget(buttonBox);
    resize(minimumSizeHint());
    break;
  case TitleClose:
  case None:
    break;
  }
  _buttons=b;
}
void QGpGuiTools::Dialog::addWidget ( QWidget *  w)

Shows any number of widgets (vertical layout) in a modal dialog box with bottom buttons.

See also:
addButtons(), setMainWidget()

References TRACE.

Referenced by setMainWidget().

{
  TRACE;
  if(!_vboxLayout) {
    _vboxLayout=new QVBoxLayout(this);
    _vboxLayout->setObjectName(QString::fromUtf8("vboxLayout"));
  }
  _vboxLayout->addWidget(w);

  if(windowTitle().isEmpty()) setWindowTitle(w->windowTitle());
}
void QGpGuiTools::Dialog::closeEvent ( QCloseEvent *  e) [protected, virtual]

Reimplemented in SetHeader.

References TitleClose, and TRACE.

{
  TRACE;
  if(_buttons==TitleClose) {
    emit(accept());
    e->accept();
  } else {
    QDialog::closeEvent(e);
  }
}
void QGpGuiTools::Dialog::getRect ( QString  name) [inline]
void QGpGuiTools::Dialog::moveEvent ( QMoveEvent *  e) [protected, virtual]
void QGpGuiTools::Dialog::resizeEvent ( QResizeEvent *  e) [protected, virtual]
void QGpGuiTools::Dialog::setMainWidget ( QWidget *  w,
Buttons  b = OkCancel 
)
void QGpGuiTools::Dialog::setRect ( QString  name) [inline]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines