diff options
author | Robert Griebl <rgriebl@trolltech.com> | 2009-06-10 11:46:23 (GMT) |
---|---|---|
committer | Robert Griebl <rgriebl@trolltech.com> | 2009-06-10 11:46:23 (GMT) |
commit | 7604f8087f88171ef933d8ae08f501467e647338 (patch) | |
tree | 51d071f462ed48d0b25884d9f62b8ba11c5dff13 /tools/shared/qtgradienteditor | |
parent | 8c265860b41214daade7c8a28237c1e07ea71a3c (diff) | |
download | Qt-7604f8087f88171ef933d8ae08f501467e647338.zip Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.gz Qt-7604f8087f88171ef933d8ae08f501467e647338.tar.bz2 |
Make Qt exception safer.
Squashed commit of the branch haralds-haralds-qt-s60-topics/topic/exceptions,
which also contains the full history.
Rev-By: Harald Fernengel
Rev-By: Ralf Engels
Diffstat (limited to 'tools/shared/qtgradienteditor')
16 files changed, 18 insertions, 35 deletions
diff --git a/tools/shared/qtgradienteditor/qtcolorbutton.cpp b/tools/shared/qtgradienteditor/qtcolorbutton.cpp index 6926f60..49581bd 100644 --- a/tools/shared/qtgradienteditor/qtcolorbutton.cpp +++ b/tools/shared/qtgradienteditor/qtcolorbutton.cpp @@ -121,9 +121,8 @@ QPixmap QtColorButtonPrivate::generatePixmap() const /////////////// QtColorButton::QtColorButton(QWidget *parent) - : QToolButton(parent) + : QToolButton(parent), d_ptr(new QtColorButtonPrivate) { - d_ptr = new QtColorButtonPrivate; d_ptr->q_ptr = this; d_ptr->m_dragging = false; d_ptr->m_backgroundCheckered = true; @@ -136,7 +135,6 @@ QtColorButton::QtColorButton(QWidget *parent) QtColorButton::~QtColorButton() { - delete d_ptr; } void QtColorButton::setColor(const QColor &color) diff --git a/tools/shared/qtgradienteditor/qtcolorbutton.h b/tools/shared/qtgradienteditor/qtcolorbutton.h index fb91452..9e4f357 100644 --- a/tools/shared/qtgradienteditor/qtcolorbutton.h +++ b/tools/shared/qtgradienteditor/qtcolorbutton.h @@ -75,7 +75,7 @@ protected: void dropEvent(QDropEvent *event); #endif private: - class QtColorButtonPrivate *d_ptr; + QScopedPointer<class QtColorButtonPrivate> d_ptr; Q_DECLARE_PRIVATE(QtColorButton) Q_DISABLE_COPY(QtColorButton) Q_PRIVATE_SLOT(d_func(), void slotEditColor()) diff --git a/tools/shared/qtgradienteditor/qtcolorline.cpp b/tools/shared/qtgradienteditor/qtcolorline.cpp index 337726c..b0b0ee0 100644 --- a/tools/shared/qtgradienteditor/qtcolorline.cpp +++ b/tools/shared/qtgradienteditor/qtcolorline.cpp @@ -999,9 +999,8 @@ void QtColorLinePrivate::mouseDoubleClickEvent(QMouseEvent *event) //////////////////////////////////////////////////// QtColorLine::QtColorLine(QWidget *parent) - : QWidget(parent) + : QWidget(parent), d_ptr(new QtColorLinePrivate) { - d_ptr = new QtColorLinePrivate; d_ptr->q_ptr = this; setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); @@ -1009,7 +1008,6 @@ QtColorLine::QtColorLine(QWidget *parent) QtColorLine::~QtColorLine() { - delete d_ptr; } QSize QtColorLine::minimumSizeHint() const diff --git a/tools/shared/qtgradienteditor/qtcolorline.h b/tools/shared/qtgradienteditor/qtcolorline.h index d5535b1..16169d1 100644 --- a/tools/shared/qtgradienteditor/qtcolorline.h +++ b/tools/shared/qtgradienteditor/qtcolorline.h @@ -114,7 +114,7 @@ protected: private: - class QtColorLinePrivate *d_ptr; + QScopedPointer<class QtColorLinePrivate> d_ptr; Q_DECLARE_PRIVATE(QtColorLine) Q_DISABLE_COPY(QtColorLine) }; diff --git a/tools/shared/qtgradienteditor/qtgradientdialog.cpp b/tools/shared/qtgradienteditor/qtgradientdialog.cpp index 032cb16..001709c 100644 --- a/tools/shared/qtgradienteditor/qtgradientdialog.cpp +++ b/tools/shared/qtgradienteditor/qtgradientdialog.cpp @@ -200,10 +200,9 @@ void QtGradientDialogPrivate::slotAboutToShowDetails(bool details, int extension */ QtGradientDialog::QtGradientDialog(QWidget *parent) - : QDialog(parent) + : QDialog(parent), d_ptr(new QtGradientDialogPrivate()) { // setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - d_ptr = new QtGradientDialogPrivate(); d_ptr->q_ptr = this; d_ptr->m_ui.setupUi(this); QPushButton *button = d_ptr->m_ui.buttonBox->button(QDialogButtonBox::Ok); @@ -222,7 +221,6 @@ QtGradientDialog::QtGradientDialog(QWidget *parent) QtGradientDialog::~QtGradientDialog() { - delete d_ptr; } /*! diff --git a/tools/shared/qtgradienteditor/qtgradientdialog.h b/tools/shared/qtgradienteditor/qtgradientdialog.h index d3bafc9..819ad21 100644 --- a/tools/shared/qtgradienteditor/qtgradientdialog.h +++ b/tools/shared/qtgradienteditor/qtgradientdialog.h @@ -76,7 +76,7 @@ public: static QGradient getGradient(bool *ok, QWidget *parent = 0, const QString &caption = QString()); private: - class QtGradientDialogPrivate *d_ptr; + QScopedPointer<class QtGradientDialogPrivate> d_ptr; Q_DECLARE_PRIVATE(QtGradientDialog) Q_DISABLE_COPY(QtGradientDialog) Q_PRIVATE_SLOT(d_func(), void slotAboutToShowDetails(bool details, int extensionWidthHint)) diff --git a/tools/shared/qtgradienteditor/qtgradienteditor.cpp b/tools/shared/qtgradienteditor/qtgradienteditor.cpp index 9eca9d8..0a7eee0 100644 --- a/tools/shared/qtgradienteditor/qtgradienteditor.cpp +++ b/tools/shared/qtgradienteditor/qtgradienteditor.cpp @@ -727,9 +727,8 @@ void QtGradientEditorPrivate::setAngleConical(qreal angle) } QtGradientEditor::QtGradientEditor(QWidget *parent) - : QWidget(parent) + : QWidget(parent), d_ptr(new QtGradientEditorPrivate()) { - d_ptr = new QtGradientEditorPrivate(); d_ptr->q_ptr = this; d_ptr->m_type = QGradient::RadialGradient; d_ptr->m_ui.setupUi(this); @@ -835,7 +834,6 @@ QtGradientEditor::~QtGradientEditor() { if (d_ptr->m_hiddenWidget) delete d_ptr->m_hiddenWidget; - delete d_ptr; } void QtGradientEditor::setGradient(const QGradient &grad) diff --git a/tools/shared/qtgradienteditor/qtgradienteditor.h b/tools/shared/qtgradienteditor/qtgradienteditor.h index 9974065..7dc75195 100644 --- a/tools/shared/qtgradienteditor/qtgradienteditor.h +++ b/tools/shared/qtgradienteditor/qtgradienteditor.h @@ -78,7 +78,7 @@ signals: void aboutToShowDetails(bool details, int extenstionWidthHint); private: - class QtGradientEditorPrivate *d_ptr; + QScopedPointer<class QtGradientEditorPrivate> d_ptr; Q_DECLARE_PRIVATE(QtGradientEditor) Q_DISABLE_COPY(QtGradientEditor) Q_PRIVATE_SLOT(d_func(), void slotGradientStopsChanged(const QGradientStops &stops)) diff --git a/tools/shared/qtgradienteditor/qtgradientstopscontroller.cpp b/tools/shared/qtgradienteditor/qtgradientstopscontroller.cpp index cbc53db..0e9521c 100644 --- a/tools/shared/qtgradienteditor/qtgradientstopscontroller.cpp +++ b/tools/shared/qtgradienteditor/qtgradientstopscontroller.cpp @@ -594,9 +594,8 @@ void QtGradientStopsControllerPrivate::slotZoomChanged(double zoom) } QtGradientStopsController::QtGradientStopsController(QObject *parent) - : QObject(parent) + : QObject(parent), d_ptr(new QtGradientStopsControllerPrivate()) { - d_ptr = new QtGradientStopsControllerPrivate(); d_ptr->q_ptr = this; d_ptr->m_spec = QColor::Hsv; @@ -675,7 +674,6 @@ void QtGradientStopsController::setUi(Ui::QtGradientEditor *ui) QtGradientStopsController::~QtGradientStopsController() { - delete d_ptr; } void QtGradientStopsController::setGradientStops(const QGradientStops &stops) diff --git a/tools/shared/qtgradienteditor/qtgradientstopscontroller.h b/tools/shared/qtgradienteditor/qtgradientstopscontroller.h index 9f16fb0..37f2e01 100644 --- a/tools/shared/qtgradienteditor/qtgradientstopscontroller.h +++ b/tools/shared/qtgradienteditor/qtgradientstopscontroller.h @@ -70,7 +70,7 @@ signals: void gradientStopsChanged(const QGradientStops &stops); private: - class QtGradientStopsControllerPrivate *d_ptr; + QScopedPointer<class QtGradientStopsControllerPrivate> d_ptr; Q_DECLARE_PRIVATE(QtGradientStopsController) Q_DISABLE_COPY(QtGradientStopsController) Q_PRIVATE_SLOT(d_func(), void slotHsvClicked()) diff --git a/tools/shared/qtgradienteditor/qtgradientstopsmodel.cpp b/tools/shared/qtgradienteditor/qtgradientstopsmodel.cpp index a632c0f..6260870 100644 --- a/tools/shared/qtgradienteditor/qtgradientstopsmodel.cpp +++ b/tools/shared/qtgradienteditor/qtgradientstopsmodel.cpp @@ -78,8 +78,8 @@ void QtGradientStop::setPosition(qreal position) } QtGradientStop::QtGradientStop(QtGradientStopsModel *model) + : d_ptr(new QtGradientStopPrivate()) { - d_ptr = new QtGradientStopPrivate(); d_ptr->m_position = 0; d_ptr->m_color = Qt::white; d_ptr->m_model = model; @@ -87,7 +87,6 @@ QtGradientStop::QtGradientStop(QtGradientStopsModel *model) QtGradientStop::~QtGradientStop() { - delete d_ptr; } class QtGradientStopsModelPrivate @@ -104,9 +103,8 @@ public: QtGradientStopsModel::QtGradientStopsModel(QObject *parent) - : QObject(parent) + : QObject(parent), d_ptr(new QtGradientStopsModelPrivate) { - d_ptr = new QtGradientStopsModelPrivate; d_ptr->q_ptr = this; d_ptr->m_current = 0; } @@ -114,7 +112,6 @@ QtGradientStopsModel::QtGradientStopsModel(QObject *parent) QtGradientStopsModel::~QtGradientStopsModel() { clear(); - delete d_ptr; } QtGradientStopsModel::PositionStopMap QtGradientStopsModel::stops() const diff --git a/tools/shared/qtgradienteditor/qtgradientstopsmodel.h b/tools/shared/qtgradienteditor/qtgradientstopsmodel.h index d4e6b3c..2c04c8f 100644 --- a/tools/shared/qtgradienteditor/qtgradientstopsmodel.h +++ b/tools/shared/qtgradienteditor/qtgradientstopsmodel.h @@ -64,7 +64,7 @@ private: friend class QtGradientStopsModel; QtGradientStop(QtGradientStopsModel *model = 0); ~QtGradientStop(); - class QtGradientStopPrivate *d_ptr; + QScopedPointer<class QtGradientStopPrivate> d_ptr; }; class QtGradientStopsModel : public QObject @@ -111,7 +111,7 @@ signals: void currentStopChanged(QtGradientStop *stop); private: - class QtGradientStopsModelPrivate *d_ptr; + QScopedPointer<class QtGradientStopsModelPrivate> d_ptr; Q_DECLARE_PRIVATE(QtGradientStopsModel) Q_DISABLE_COPY(QtGradientStopsModel) }; diff --git a/tools/shared/qtgradienteditor/qtgradientstopswidget.cpp b/tools/shared/qtgradienteditor/qtgradientstopswidget.cpp index adaf57d..570bd6f 100644 --- a/tools/shared/qtgradienteditor/qtgradientstopswidget.cpp +++ b/tools/shared/qtgradienteditor/qtgradientstopswidget.cpp @@ -360,9 +360,8 @@ void QtGradientStopsWidgetPrivate::slotResetZoom() } QtGradientStopsWidget::QtGradientStopsWidget(QWidget *parent) - : QAbstractScrollArea(parent) + : QAbstractScrollArea(parent), d_ptr(new QtGradientStopsWidgetPrivate) { - d_ptr = new QtGradientStopsWidgetPrivate; d_ptr->q_ptr = this; d_ptr->m_backgroundCheckered = true; d_ptr->m_model = 0; @@ -391,7 +390,6 @@ QtGradientStopsWidget::QtGradientStopsWidget(QWidget *parent) QtGradientStopsWidget::~QtGradientStopsWidget() { - delete d_ptr; } QSize QtGradientStopsWidget::sizeHint() const diff --git a/tools/shared/qtgradienteditor/qtgradientstopswidget.h b/tools/shared/qtgradienteditor/qtgradientstopswidget.h index aafea8b..79d6576 100644 --- a/tools/shared/qtgradienteditor/qtgradientstopswidget.h +++ b/tools/shared/qtgradienteditor/qtgradientstopswidget.h @@ -91,7 +91,7 @@ protected: #endif private: - QtGradientStopsWidgetPrivate *d_ptr; + QScopedPointer<QtGradientStopsWidgetPrivate> d_ptr; Q_DECLARE_PRIVATE(QtGradientStopsWidget) Q_DISABLE_COPY(QtGradientStopsWidget) Q_PRIVATE_SLOT(d_func(), void slotStopAdded(QtGradientStop *stop)) diff --git a/tools/shared/qtgradienteditor/qtgradientwidget.cpp b/tools/shared/qtgradienteditor/qtgradientwidget.cpp index 3f6b48d..4b70cc2 100644 --- a/tools/shared/qtgradienteditor/qtgradientwidget.cpp +++ b/tools/shared/qtgradienteditor/qtgradientwidget.cpp @@ -232,9 +232,8 @@ void QtGradientWidgetPrivate::setupDrag(QtGradientStop *stop, int x) //////////////////////////// QtGradientWidget::QtGradientWidget(QWidget *parent) - : QWidget(parent) + : QWidget(parent), d_ptr(new QtGradientWidgetPrivate) { - d_ptr = new QtGradientWidgetPrivate; d_ptr->q_ptr = this; d_ptr->m_backgroundCheckered = true; d_ptr->m_handleSize = 20.0; @@ -253,7 +252,6 @@ QtGradientWidget::QtGradientWidget(QWidget *parent) QtGradientWidget::~QtGradientWidget() { - delete d_ptr; } QSize QtGradientWidget::sizeHint() const diff --git a/tools/shared/qtgradienteditor/qtgradientwidget.h b/tools/shared/qtgradienteditor/qtgradientwidget.h index 4dc740b..d994534 100644 --- a/tools/shared/qtgradienteditor/qtgradientwidget.h +++ b/tools/shared/qtgradienteditor/qtgradientwidget.h @@ -110,7 +110,7 @@ protected: void mouseDoubleClickEvent(QMouseEvent *e); private: - class QtGradientWidgetPrivate *d_ptr; + QScopedPointer<class QtGradientWidgetPrivate> d_ptr; Q_DECLARE_PRIVATE(QtGradientWidget) Q_DISABLE_COPY(QtGradientWidget) }; |