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>
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) |
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().
{None, OkCancel, Close, TitleClose};
QGpGuiTools::Dialog::Dialog | ( | QWidget * | parent = 0 , |
Qt::WFlags | f = 0 |
||
) |
Referenced by QGpGuiTools::CoordinateFile::write().
void QGpGuiTools::Dialog::addButtons | ( | Buttons | b = OkCancel | ) |
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.
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.
References TRACE.
Referenced by setMainWidget().
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] |
References QGpGuiTools::Settings::getRect().
Referenced by QGpGuiTools::BugReport::BugReport(), QGpGuiTools::CoordinateFile::CoordinateFile(), and QGpGuiTools::CoordinateFile::write().
{Settings::getRect(this, name);}
void QGpGuiTools::Dialog::moveEvent | ( | QMoveEvent * | e | ) | [protected, virtual] |
References QGpGuiTools::FrameGrabber::setFrame(), and TRACE.
{ TRACE; setFrame(this); QDialog::moveEvent(e); }
void QGpGuiTools::Dialog::resizeEvent | ( | QResizeEvent * | e | ) | [protected, virtual] |
References QGpGuiTools::FrameGrabber::setFrame(), and TRACE.
{ TRACE; setFrame(this); QDialog::resizeEvent(e); }
void QGpGuiTools::Dialog::setMainWidget | ( | QWidget * | w, |
Buttons | b = OkCancel |
||
) |
Shows any widget in a modal dialog box with bottom buttons. Convenient function for dialogs containing only one widget.
References addButtons(), addWidget(), Close, None, OkCancel, TitleClose, and TRACE.
Referenced by MainWindow::about(), ProcessStatus::changeLegend(), GeopsyMainWindow::createNewGroup(), MonoStation::WinResults::editPeaks(), WaveformConsole::filter(), MonoStation::WinResults::groupsToCategories(), DinverGui::helpAbout(), SciFigs::CurveBrowser::legend(), SciFigs::CurveBrowser::loadMultiColumns(), MonoStation::WinResults::options(), GroupView::properties(), WaveformConsole::waveletTransform(), and QGpGuiTools::CoordinateFile::write().
{ TRACE; addWidget(w); switch(b) { case None: case TitleClose: _buttons=b; break; case OkCancel: case Close: addButtons(b); break; } }
void QGpGuiTools::Dialog::setRect | ( | QString | name | ) | [inline] |
References QGpGuiTools::FrameGrabber::setRect().
Referenced by QGpGuiTools::CoordinateFile::read(), QGpGuiTools::Settings::setRect(), QGpGuiTools::CoordinateFile::write(), and QGpGuiTools::BugReport::~BugReport().
{FrameGrabber::setRect(this, name);}