Skip to content

Commit

Permalink
Convert deprecated Qt3 QDialog(parent, name, modal, flags) constructo…
Browse files Browse the repository at this point in the history
…rs to Qt4 QDialog(parent, flags) constructors. Use QgisGui::ModalDialogFlags to specify modal dialogs.

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4688 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski committed Jan 15, 2006
1 parent 9cb8c41 commit c585f30
Show file tree
Hide file tree
Showing 82 changed files with 222 additions and 195 deletions.
2 changes: 1 addition & 1 deletion src/gui/qgisapp.cpp
Expand Up @@ -5709,7 +5709,7 @@ void QgisApp::customProjection()
// Create an instance of the Custom Projection Designer modeless dialog.
// Autodelete the dialog when closing since a pointer is not retained.
QgsCustomProjectionDialog * myDialog = new QgsCustomProjectionDialog(this,
"Projection Designer", Qt::WDestructiveClose);
Qt::WDestructiveClose);
myDialog->show();
}
void QgisApp::showBookmarks()
Expand Down
38 changes: 19 additions & 19 deletions src/gui/qgisgui.h
Expand Up @@ -25,25 +25,25 @@
namespace QgisGui
{

/*!
* /var ModalDialogFlags
* /brief Flags used to create a modal dialog (adapted from QMessageBox).
*
* Using these flags for all modal dialogs throughout QGIS ensures that
* for platforms such as the Mac where modal and modeless dialogs have
* different looks, QGIS modal dialogs will look the same as Qt modal
* dialogs and all modal dialogs will look distinct from modeless dialogs.
* Althought not the standard Mac modal look, it does lack the minimize
* control which makes sense only for modeless dislogs.
*
* The Qt3 method of creating a true Mac modal dialog is deprecated in Qt4
* and should not be used due to conflicts with QMessageBox style dialogs.
*
* Qt::WindowMaximizeButtonHint is included but will be ignored if
* the dialog is a fixed size and does not have a size grip.
*/
Qt::WFlags ModalDialogFlags =
Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMaximizeButtonHint;
/*!
* /var ModalDialogFlags
* /brief Flags used to create a modal dialog (adapted from QMessageBox).
*
* Using these flags for all modal dialogs throughout QGIS ensures that
* for platforms such as the Mac where modal and modeless dialogs have
* different looks, QGIS modal dialogs will look the same as Qt modal
* dialogs and all modal dialogs will look distinct from modeless dialogs.
* Althought not the standard Mac modal look, it does lack the minimize
* control which makes sense only for modeless dislogs.
*
* The Qt3 method of creating a true Mac modal dialog is deprecated in Qt4
* and should not be used due to conflicts with QMessageBox style dialogs.
*
* Qt::WindowMaximizeButtonHint is included but will be ignored if
* the dialog is a fixed size and does not have a size grip.
*/
static const Qt::WFlags ModalDialogFlags =
Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowMaximizeButtonHint;

}

Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsadvancedattrsearch.cpp
Expand Up @@ -21,8 +21,8 @@
#include <QMessageBox>


QgsAdvancedAttrSearch::QgsAdvancedAttrSearch(QWidget *parent, const char *name)
:QDialog(parent)
QgsAdvancedAttrSearch::QgsAdvancedAttrSearch(QWidget *parent, Qt::WFlags fl)
:QDialog(parent, fl)
{
setupUi(this);
connect(btnShowHelp, SIGNAL(clicked()), this, SLOT(showHelp()));
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsadvancedattrsearch.h
Expand Up @@ -21,15 +21,15 @@
#define QGSADVANCEDATTRSEARCH_H

#include "ui_qgsadvancedattrsearchbase.h"
#include <QDialog>
#include "qgisgui.h"

class QString;
class QgsAdvancedAttrSearch : public QDialog, private Ui::QgsAdvancedAttrSearchBase
{
Q_OBJECT

public:
QgsAdvancedAttrSearch(QWidget *parent = 0, const char *name = 0);
QgsAdvancedAttrSearch(QWidget *parent = 0, Qt::WFlags fl = QgisGui::ModalDialogFlags);
QString searchString();

public slots:
Expand Down
10 changes: 2 additions & 8 deletions src/gui/qgsbookmarks.cpp
Expand Up @@ -31,14 +31,8 @@
#include <sqlite3.h>
#include <fstream>

QgsBookmarks::QgsBookmarks(QWidget *parent, const char *name)
#ifdef Q_OS_MACX
// Mac modeless dialog dosn't have correct window type if parent is specified
: QDialog(NULL),
#else
// Specifying parent suppresses separate taskbar entry for dialog
: QDialog(parent),
#endif
QgsBookmarks::QgsBookmarks(QWidget *parent, Qt::WFlags fl)
: QDialog(parent, fl),
mParent(parent)
{
setupUi(this);
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsbookmarks.h
Expand Up @@ -28,7 +28,7 @@ class QgsBookmarks : public QDialog, private Ui::QgsBookmarksBase
{
Q_OBJECT
public:
QgsBookmarks(QWidget *parent=0, const char *name=0);
QgsBookmarks(QWidget *parent = 0, Qt::WFlags fl = 0);
~QgsBookmarks();
static bool createDatabase();
public slots:
Expand Down
10 changes: 2 additions & 8 deletions src/gui/qgscustomprojectiondialog.cpp
Expand Up @@ -32,14 +32,8 @@ extern "C"{
}


QgsCustomProjectionDialog::QgsCustomProjectionDialog( QWidget* parent , const char* name , Qt::WFlags fl )
#ifdef Q_OS_MACX
// Mac modeless dialog dosn't have correct window type if parent is specified
: QDialog(NULL, name, false, fl)
#else
// Specifying parent suppresses separate taskbar entry for dialog
: QDialog(parent, name, false, fl)
#endif
QgsCustomProjectionDialog::QgsCustomProjectionDialog(QWidget *parent, Qt::WFlags fl)
: QDialog(parent, fl)
{
setupUi(this);

Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgscustomprojectiondialog.h
Expand Up @@ -24,7 +24,7 @@ class QgsCustomProjectionDialog : public QDialog, private Ui::QgsCustomProjectio
{
Q_OBJECT
public:
QgsCustomProjectionDialog(QWidget* parent, const char* name = "", Qt::WFlags fl=0);
QgsCustomProjectionDialog(QWidget *parent = 0, Qt::WFlags fl = 0);
~QgsCustomProjectionDialog();
//a recursive function to make a directory and its ancestors
bool makeDir(QDir &theQDir);
Expand Down
5 changes: 2 additions & 3 deletions src/gui/qgsdbsourceselect.cpp
Expand Up @@ -20,7 +20,6 @@ email : sherman at mrcc.com
#include "qgsdbsourceselect.h"

#include "qgisapp.h"
#include "qgisgui.h"
#include "qgsapplication.h"
#include "qgscontexthelp.h"
#include "qgsnewconnection.h"
Expand All @@ -33,8 +32,8 @@ email : sherman at mrcc.com
#include <cassert>
#include <iostream>

QgsDbSourceSelect::QgsDbSourceSelect(QgisApp *app)
: QDialog(app, QgisGui::ModalDialogFlags), qgisApp(app)
QgsDbSourceSelect::QgsDbSourceSelect(QgisApp *app, Qt::WFlags fl)
: QDialog(app, fl), qgisApp(app)
{
setupUi(this);
btnAdd->setEnabled(false);
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsdbsourceselect.h
Expand Up @@ -18,7 +18,7 @@
#ifndef QGSDBSOURCESELECT_H
#define QGSDBSOURCESELECT_H
#include "ui_qgsdbsourceselectbase.h"
#include <QDialog>
#include "qgisgui.h"
extern "C"
{
#include <libpq-fe.h>
Expand All @@ -42,7 +42,7 @@ class QgsDbSourceSelect : public QDialog, private Ui::QgsDbSourceSelectBase
public:

//! Constructor
QgsDbSourceSelect(QgisApp *app);
QgsDbSourceSelect(QgisApp *app, Qt::WFlags fl = QgisGui::ModalDialogFlags);
//! Destructor
~QgsDbSourceSelect();
//! Opens the create connection dialog to build a new connection
Expand Down
7 changes: 3 additions & 4 deletions src/gui/qgshelpviewer.cpp
Expand Up @@ -26,11 +26,10 @@
#include <qtooltip.h>
#include <q3whatsthis.h>
#include "qgshelpviewer.h"
QgsHelpViewer::QgsHelpViewer(QWidget * parent, const char *name, bool modal, Qt::WFlags fl):
//tim removed parameters during qt4 ui port - FIXME !!!
QgsHelpViewerBase()
QgsHelpViewer::QgsHelpViewer(QWidget * parent, Qt::WFlags fl)
: QDialog(parent, fl)
{

setupUi(this);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgshelpviewer.h
Expand Up @@ -40,7 +40,7 @@ class QgsHelpViewer : public QDialog, private Ui::QgsHelpViewerBase
Q_OBJECT

public:
QgsHelpViewer( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
QgsHelpViewer( QWidget* parent = 0, Qt::WFlags fl = 0 );
~QgsHelpViewer();
void showContent(QString path, QString doc);

Expand Down
5 changes: 2 additions & 3 deletions src/gui/qgslayerprojectionselector.cpp
Expand Up @@ -23,9 +23,8 @@
* \class QgsLayerProjectionSelector - Set user layerprojectionselector and preferences
* Constructor
*/
QgsLayerProjectionSelector::QgsLayerProjectionSelector(QWidget *parent,
const char * name, bool modal)
: QDialog(parent, name, modal)
QgsLayerProjectionSelector::QgsLayerProjectionSelector(QWidget *parent, Qt::WFlags fl)
: QDialog(parent, fl)
{
setupUi(this);
connect(pbnOK, SIGNAL(clicked()), this, SLOT( accept()));
Expand Down
5 changes: 3 additions & 2 deletions src/gui/qgslayerprojectionselector.h
Expand Up @@ -19,18 +19,19 @@
#ifndef QGSLAYERPROJECTIONSELECTOR_H
#define QGSLAYERPROJECTIONSELECTOR_H
#include "ui_qgslayerprojectionselectorbase.h"
#include "qgisgui.h"
/**
* \class QgsLayerProjectionSelector
* \brief Set Projection system for a layer
*/
class QgsLayerProjectionSelector :public QDialog, private Ui::QgsLayerProjectionSelectorBase
class QgsLayerProjectionSelector : public QDialog, private Ui::QgsLayerProjectionSelectorBase
{
Q_OBJECT;
public:
/**
* Constructor
*/
QgsLayerProjectionSelector(QWidget *parent=0, const char *name=0, bool modal=true);
QgsLayerProjectionSelector(QWidget *parent = 0, Qt::WFlags fl = QgisGui::ModalDialogFlags);
//! Destructor
~QgsLayerProjectionSelector();

Expand Down
7 changes: 4 additions & 3 deletions src/gui/qgslinestyledialog.cpp
Expand Up @@ -21,10 +21,11 @@
#include <iostream>
#include "qgssymbologyutils.h"

QgsLineStyleDialog::QgsLineStyleDialog(QWidget * parent, const char *name, bool modal, Qt::WFlags fl):
//params disabled during qt4 gui port - Fixme!!
QgsLineStyleDialogBase()
QgsLineStyleDialog::QgsLineStyleDialog(QWidget * parent, Qt::WFlags fl):
QDialog(parent, fl)
{
setupUi(this);

//load the icons stored in QgsSymbologyUtils.cpp (to avoid redundancy)
solid->setPixmap(QgsSymbologyUtils::char2LinePixmap("SolidLine"));
dash->setPixmap(QgsSymbologyUtils::char2LinePixmap("DashLine"));
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgslinestyledialog.h
Expand Up @@ -21,13 +21,13 @@

class qnamespace;
#include "ui_qgslinestyledialogbase.h"
#include <QDialog>
#include "qgisgui.h"
/**Dialog class to query line styles*/
class QgsLineStyleDialog: public QDialog, private Ui::QgsLineStyleDialogBase
{
Q_OBJECT
public:
QgsLineStyleDialog(QWidget* parent = 0, const char* name = 0, bool modal = FALSE, Qt::WFlags fl = Qt::WStyle_StaysOnTop);
QgsLineStyleDialog(QWidget * parent = 0, Qt::WFlags fl = QgisGui::ModalDialogFlags);
~QgsLineStyleDialog();
Qt::PenStyle style();
protected:
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsludialog.cpp
Expand Up @@ -19,8 +19,8 @@
#include "qgsludialog.h"


QgsLUDialog::QgsLUDialog(QWidget *parent, const char *name, bool modal)
: QDialog(parent, name, modal)
QgsLUDialog::QgsLUDialog(QWidget *parent, Qt::WFlags fl)
: QDialog(parent, fl)
{
setupUi(this);
connect(mOkButton, SIGNAL(clicked()), this, SLOT(accept()));
Expand Down
3 changes: 2 additions & 1 deletion src/gui/qgsludialog.h
Expand Up @@ -20,13 +20,14 @@
#define QGSLUDIALOG_H

#include "ui_qgsludialogbase.h"
#include "qgisgui.h"


class QgsLUDialog: public QDialog, private Ui::QgsLUDialogBase
{
Q_OBJECT
public:
QgsLUDialog(QWidget *parent=0, const char *name=0, bool modal=true);
QgsLUDialog(QWidget *parent = 0, Qt::WFlags fl = QgisGui::ModalDialogFlags);
~QgsLUDialog();
QString lowerValue() const;
void setLowerValue(QString val);
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsmapserverexport.cpp
Expand Up @@ -32,8 +32,8 @@ email : sherman at mrcc.com
#include <fstream>

// constructor
QgsMapserverExport::QgsMapserverExport(QgsMapCanvas * _map, QWidget * parent, const char *name, bool modal, Qt::WFlags fl)
:QDialog(parent, name, modal, fl), map(_map)
QgsMapserverExport::QgsMapserverExport(QgsMapCanvas * _map, QWidget * parent, Qt::WFlags fl)
: QDialog(parent, fl), map(_map)
{
setupUi(this);
connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsmapserverexport.h
Expand Up @@ -20,7 +20,7 @@
#ifndef QGSMAPSERVEREXPORT_H
#define QGSMAPSERVEREXPORT_H
#include "ui_qgsmapserverexportbase.h"
#include <QDialog>
#include "qgisgui.h"
class QgsMapCanvas;

/*! \class QgsMapServerExport
Expand All @@ -31,7 +31,7 @@ class QgsMapserverExport:public QDialog, private Ui::QgsMapserverExportBase
Q_OBJECT
public:
QgsMapserverExport(QgsMapCanvas *map=0, QWidget* parent = 0,
const char* name = 0, bool modal = FALSE, Qt::WFlags fl = 0 );
Qt::WFlags fl = QgisGui::ModalDialogFlags);
~QgsMapserverExport();
//! Read the file and create the map
bool read();
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsmessageviewer.cpp
Expand Up @@ -19,8 +19,8 @@
#include "qgsmessageviewer.h"


QgsMessageViewer::QgsMessageViewer(QWidget *parent, const char *name, bool modal, Qt::WFlags f)
: QDialog(parent, name, modal, f)
QgsMessageViewer::QgsMessageViewer(QWidget *parent, Qt::WFlags fl)
: QDialog(parent, fl)
{
setupUi(this);
}
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsmessageviewer.h
Expand Up @@ -19,12 +19,12 @@
#define QGSMESSAGEVIEWER_H

#include "ui_qgsmessageviewer.h"
#include <QDialog>
#include "qgisgui.h"

class QgsMessageViewer: public QDialog, private Ui::QgsMessageViewer
{
public:
QgsMessageViewer(QWidget *parent, const char *name = 0, bool modal = false, Qt::WFlags f = 0);
QgsMessageViewer(QWidget *parent = 0, Qt::WFlags fl = QgisGui::ModalDialogFlags);
~QgsMessageViewer();
void setTextFormat(Qt::TextFormat f);
void setMessage(const QString& msg);
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsnewconnection.cpp
Expand Up @@ -26,8 +26,8 @@ extern "C"
{
#include <libpq-fe.h>
}
QgsNewConnection::QgsNewConnection(QWidget *parent, const QString& connName, bool modal)
: QgsNewConnectionBase()
QgsNewConnection::QgsNewConnection(QWidget *parent, const QString& connName, Qt::WFlags fl)
: QDialog(parent, fl)
{
setupUi(this);
if (!connName.isEmpty())
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsnewconnection.h
Expand Up @@ -18,7 +18,7 @@
#ifndef QGSNEWCONNECTION_H
#define QGSNEWCONNECTION_H
#include "ui_qgsnewconnectionbase.h"
#include <QDialog>
#include "qgisgui.h"
/*! \class QgsNewConnection
* \brief Dialog to allow the user to configure and save connection
* information for a PostgresQl database
Expand All @@ -28,7 +28,7 @@ class QgsNewConnection : public QDialog, private Ui::QgsNewConnectionBase
Q_OBJECT
public:
//! Constructor
QgsNewConnection(QWidget *parent = 0, const QString& connName = QString::null, bool modal = true);
QgsNewConnection(QWidget *parent = 0, const QString& connName = QString::null, Qt::WFlags fl = QgisGui::ModalDialogFlags);
//! Destructor
~QgsNewConnection();
//! Tests the connection using the parameters supplied
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsnewhttpconnection.cpp
Expand Up @@ -18,8 +18,8 @@
#include "qgsnewhttpconnection.h"
#include <QSettings>

QgsNewHttpConnection::QgsNewHttpConnection(QString connName)
: QDialog()
QgsNewHttpConnection::QgsNewHttpConnection(QWidget *parent, const QString& connName, Qt::WFlags fl)
: QDialog(parent, fl)
{
setupUi(this);
connect(btnHelp, SIGNAL(clicked()), this, SLOT(helpInfo()));
Expand Down

0 comments on commit c585f30

Please sign in to comment.