Skip to content

Commit

Permalink
Qt5: 'QString::null' is deprecated: use QString() [-Wdeprecated-decla…
Browse files Browse the repository at this point in the history
…rations]
  • Loading branch information
wwmayer committed Jun 12, 2020
1 parent 8510924 commit c814eb1
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/Gui/Command.cpp
Expand Up @@ -119,7 +119,7 @@ using namespace Gui::DockWnd;
* void activated(int)
* {
* QString filter ... // make a filter of all supported file formats
* QStringList FileList = QFileDialog::getOpenFileNames( filter,QString::null, getMainWindow() );
* QStringList FileList = QFileDialog::getOpenFileNames( filter,QString(), getMainWindow() );
* for ( QStringList::Iterator it = FileList.begin(); it != FileList.end(); ++it ) {
* getGuiApplication()->open((*it).latin1());
* }
Expand Down
8 changes: 4 additions & 4 deletions src/Gui/DlgActionsImp.cpp
Expand Up @@ -216,7 +216,7 @@ void DlgCustomActionsImp::on_actionListWidget_itemActivated(QTreeWidgetItem *ite
ui->actionStatus -> setText(QString::fromUtf8(pScript->getStatusTip()));
ui->actionAccel -> setText(QString::fromLatin1(pScript->getAccel()));
ui->pixmapLabel->clear();
m_sPixmap = QString::null;
m_sPixmap.clear();
const char* name = pScript->getPixmap();
if (name && std::strlen(name) > 2)
{
Expand Down Expand Up @@ -278,7 +278,7 @@ void DlgCustomActionsImp::on_buttonAddAction_clicked()
if (!m_sPixmap.isEmpty())
macro->setPixmap(m_sPixmap.toLatin1());
ui->pixmapLabel->clear();
m_sPixmap = QString::null;
m_sPixmap.clear();

if (!ui->actionAccel->text().isEmpty()) {
macro->setAccel(ui->actionAccel->text().toLatin1());
Expand Down Expand Up @@ -335,7 +335,7 @@ void DlgCustomActionsImp::on_buttonReplaceAction_clicked()
if (!m_sPixmap.isEmpty())
macro->setPixmap(m_sPixmap.toLatin1());
ui->pixmapLabel->clear();
m_sPixmap = QString::null;
m_sPixmap.clear();

if (!ui->actionAccel->text().isEmpty()) {
macro->setAccel(ui->actionAccel->text().toLatin1());
Expand Down Expand Up @@ -501,7 +501,7 @@ void DlgCustomActionsImp::on_buttonChoosePixmap_clicked()
dlg.exec();

ui->pixmapLabel->clear();
m_sPixmap = QString::null;
m_sPixmap.clear();
if (dlg.result() == QDialog::Accepted) {
QListWidgetItem* item = dlg.currentItem();
if (item) {
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/DlgMacroExecuteImp.cpp
Expand Up @@ -350,7 +350,7 @@ void DlgMacroExecuteImp::on_createButton_clicked()
{
// query file name
QString fn = QInputDialog::getText(this, tr("Macro file"), tr("Enter a file name, please:"),
QLineEdit::Normal, QString::null, 0);
QLineEdit::Normal, QString(), 0);
if (!fn.isEmpty())
{
QString suffix = QFileInfo(fn).suffix().toLower();
Expand Down
18 changes: 9 additions & 9 deletions src/Gui/DlgParameterImp.cpp
Expand Up @@ -550,7 +550,7 @@ void ParameterGroup::onCreateSubgroup()
{
bool ok;
QString name = QInputDialog::getText(this, QObject::tr("New sub-group"), QObject::tr("Enter the name:"),
QLineEdit::Normal, QString::null, &ok );
QLineEdit::Normal, QString(), &ok );

if (ok && Gui::validateInput(this, name))
{
Expand All @@ -577,7 +577,7 @@ void ParameterGroup::onCreateSubgroup()
void ParameterGroup::onExportToFile()
{
QString file = FileDialog::getSaveFileName( this, tr("Export parameter to file"),
QString::null, QString::fromLatin1("XML (*.FCParam)"));
QString(), QString::fromLatin1("XML (*.FCParam)"));
if ( !file.isEmpty() )
{
QTreeWidgetItem* item = currentItem();
Expand All @@ -593,7 +593,7 @@ void ParameterGroup::onExportToFile()
void ParameterGroup::onImportFromFile()
{
QString file = FileDialog::getOpenFileName( this, tr("Import parameter from file"),
QString::null, QString::fromLatin1("XML (*.FCParam)"));
QString(), QString::fromLatin1("XML (*.FCParam)"));
if ( !file.isEmpty() )
{
QTreeWidgetItem* item = currentItem();
Expand Down Expand Up @@ -771,7 +771,7 @@ void ParameterValue::onCreateTextItem()
{
bool ok;
QString name = QInputDialog::getText(this, QObject::tr("New text item"), QObject::tr("Enter the name:"),
QLineEdit::Normal, QString::null, &ok);
QLineEdit::Normal, QString(), &ok);

if (!ok || !Gui::validateInput(this, name))
return;
Expand All @@ -787,7 +787,7 @@ void ParameterValue::onCreateTextItem()
}

QString val = QInputDialog::getText(this, QObject::tr("New text item"), QObject::tr("Enter your text:"),
QLineEdit::Normal, QString::null, &ok);
QLineEdit::Normal, QString(), &ok);
if ( ok && !val.isEmpty() )
{
ParameterValueItem *pcItem;
Expand All @@ -800,7 +800,7 @@ void ParameterValue::onCreateIntItem()
{
bool ok;
QString name = QInputDialog::getText(this, QObject::tr("New integer item"), QObject::tr("Enter the name:"),
QLineEdit::Normal, QString::null, &ok);
QLineEdit::Normal, QString(), &ok);

if (!ok || !Gui::validateInput(this, name))
return;
Expand Down Expand Up @@ -830,7 +830,7 @@ void ParameterValue::onCreateUIntItem()
{
bool ok;
QString name = QInputDialog::getText(this, QObject::tr("New unsigned item"), QObject::tr("Enter the name:"),
QLineEdit::Normal, QString::null, &ok);
QLineEdit::Normal, QString(), &ok);

if (!ok || !Gui::validateInput(this, name))
return;
Expand Down Expand Up @@ -866,7 +866,7 @@ void ParameterValue::onCreateFloatItem()
{
bool ok;
QString name = QInputDialog::getText(this, QObject::tr("New float item"), QObject::tr("Enter the name:"),
QLineEdit::Normal, QString::null, &ok);
QLineEdit::Normal, QString(), &ok);

if (!ok || !Gui::validateInput(this, name))
return;
Expand Down Expand Up @@ -895,7 +895,7 @@ void ParameterValue::onCreateBoolItem()
{
bool ok;
QString name = QInputDialog::getText(this, QObject::tr("New Boolean item"), QObject::tr("Enter the name:"),
QLineEdit::Normal, QString::null, &ok);
QLineEdit::Normal, QString(), &ok);

if (!ok || !Gui::validateInput(this, name))
return;
Expand Down
4 changes: 2 additions & 2 deletions src/Gui/DlgSettingsImageImp.cpp
Expand Up @@ -134,12 +134,12 @@ int DlgSettingsImageImp::imageHeight() const

/**
* Returns the comment of the picture. If for the currently selected image format no comments are supported
* QString::null is returned.
* QString() is returned.
*/
QString DlgSettingsImageImp::comment() const
{
if ( !ui->textEditComment->isEnabled() )
return QString::null;
return QString();
else
return ui->textEditComment->toPlainText();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/EditorView.cpp
Expand Up @@ -328,7 +328,7 @@ void EditorView::setDisplayName(EditorView::DisplayName type)
bool EditorView::saveAs(void)
{
QString fn = FileDialog::getSaveFileName(this, QObject::tr("Save Macro"),
QString::null, QString::fromLatin1("%1 (*.FCMacro);;Python (*.py)").arg(tr("FreeCAD macro")));
QString(), QString::fromLatin1("%1 (*.FCMacro);;Python (*.py)").arg(tr("FreeCAD macro")));
if (fn.isEmpty())
return false;
setCurrentFileName(fn);
Expand Down
6 changes: 3 additions & 3 deletions src/Gui/FileDialog.cpp
Expand Up @@ -221,7 +221,7 @@ QString FileDialog::getSaveFileName (QWidget * parent, const QString & caption,
setWorkingDirectory(file);
return file;
} else {
return QString::null;
return QString();
}
}

Expand Down Expand Up @@ -316,7 +316,7 @@ QString FileDialog::getOpenFileName(QWidget * parent, const QString & caption, c
setWorkingDirectory(file);
return file;
} else {
return QString::null;
return QString();
}
}

Expand Down Expand Up @@ -622,7 +622,7 @@ FileChooser::FileChooser ( QWidget * parent )
: QWidget(parent)
, md( File )
, accMode( AcceptOpen )
, _filter( QString::null )
, _filter( QString() )
{
QHBoxLayout *layout = new QHBoxLayout( this );
layout->setMargin( 0 );
Expand Down
4 changes: 2 additions & 2 deletions src/Gui/NetworkRetriever.cpp
Expand Up @@ -460,8 +460,8 @@ void StdCmdDownloadOnlineHelp::activated(int iMsg)
bool bAuthor = hGrp->GetBool ("Authorize", false);

if (bUseProxy) {
QString username = QString::null;
QString password = QString::null;
QString username;
QString password;

if (bAuthor) {
QDialog dlg(getMainWindow());
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/NetworkRetriever.h
Expand Up @@ -48,7 +48,7 @@ class NetworkRetriever : public QObject
void setNumberOfTries( int );
void setOutputFile( const QString& );
void setEnableTimestamp(bool);
void setProxy( const QString&, const QString& = QString::null, const QString& = QString::null );
void setProxy( const QString&, const QString& = QString(), const QString& = QString() );
void setEnableRecursive( bool, int = 0 );
void setFollowRelative( bool );
void setEnableConvert( bool );
Expand Down
6 changes: 3 additions & 3 deletions src/Gui/PythonConsole.cpp
Expand Up @@ -720,13 +720,13 @@ void PythonConsole::printPrompt(PythonConsole::Prompt mode)
// write normal messages
if (!d->output.isEmpty()) {
appendOutput(d->output, (int)PythonConsoleP::Message);
d->output = QString::null;
d->output.clear();
}

// write error messages
if (!d->error.isEmpty()) {
appendOutput(d->error, (int)PythonConsoleP::Error);
d->error = QString::null;
d->error.clear();
}

// Append the prompt string
Expand Down Expand Up @@ -1326,7 +1326,7 @@ void PythonConsole::onSaveHistoryAs()

void PythonConsole::onInsertFileName()
{
QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), tr("Insert file name"), QString::null,
QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), tr("Insert file name"), QString(),
QString::fromLatin1("%1 (*.*)").arg(tr("All Files")));
if ( fn.isEmpty() )
return;
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Drawing/Gui/Command.cpp
Expand Up @@ -69,7 +69,7 @@ void CmdDrawingOpen::activated(int iMsg)
{
Q_UNUSED(iMsg);
// Reading an image
QString filename = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QObject::tr("Choose an SVG file to open"), QString::null,
QString filename = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QObject::tr("Choose an SVG file to open"), QString(),
QString::fromLatin1("%1 (*.svg *.svgz)").arg(QObject::tr("Scalable Vector Graphic")));
if (!filename.isEmpty())
{
Expand Down Expand Up @@ -592,7 +592,7 @@ void CmdDrawingSymbol::activated(int iMsg)
}
}
// Reading an image
QString filename = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QObject::tr("Choose an SVG file to open"), QString::null,
QString filename = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QObject::tr("Choose an SVG file to open"), QString(),
QString::fromLatin1("%1 (*.svg *.svgz)").arg(QObject::tr("Scalable Vector Graphic")));
if (!filename.isEmpty())
{
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Image/Gui/Command.cpp
Expand Up @@ -74,7 +74,7 @@ void CmdImageOpen::activated(int iMsg)
str << ");;" << QObject::tr("All files") << " (*.*)";
// Reading an image
QString s = QFileDialog::getOpenFileName(Gui::getMainWindow(), QObject::tr("Choose an image file to open"),
QString::null, formats);
QString(), formats);
if (!s.isEmpty()) {
try {
s = Base::Tools::escapeEncodeFilename(s);
Expand Down Expand Up @@ -122,7 +122,7 @@ void CmdCreateImagePlane::activated(int iMsg)
str << ");;" << QObject::tr("All files") << " (*.*)";
// Reading an image
QString s = QFileDialog::getOpenFileName(Gui::getMainWindow(), QObject::tr("Choose an image file to open"),
QString::null, formats);
QString(), formats);
if (!s.isEmpty()) {

QImage impQ(s);
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Part/Gui/DlgPartImportIgesImp.cpp
Expand Up @@ -68,7 +68,7 @@ void DlgPartImportIgesImp::OnApply()

void DlgPartImportIgesImp::onChooseFileName()
{
QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QString::null, QString::null,
QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QString(), QString(),
QString::fromLatin1("%1 (*.igs *.iges);;%2 (*.*)"))
.arg(tr("IGES"),
tr("All Files"));
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Part/Gui/DlgPartImportStepImp.cpp
Expand Up @@ -67,7 +67,7 @@ void DlgPartImportStepImp::OnApply()

void DlgPartImportStepImp::onChooseFileName()
{
QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QString::null, QString::null,
QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(), QString(), QString(),
QString::fromLatin1("%1 (*.stp *.step);;%2 (*.*)"))
.arg(tr("STEP"),
tr("All Files"));
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Points/Gui/Command.cpp
Expand Up @@ -77,7 +77,7 @@ void CmdPointsImport::activated(int iMsg)
Q_UNUSED(iMsg);

QString fn = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(),
QString::null, QString(), QString::fromLatin1("%1 (*.asc *.pcd *.ply);;%2 (*.*)")
QString(), QString(), QString::fromLatin1("%1 (*.asc *.pcd *.ply);;%2 (*.*)")
.arg(QObject::tr("Point formats"), QObject::tr("All Files")));
if (fn.isEmpty())
return;
Expand Down Expand Up @@ -125,7 +125,7 @@ void CmdPointsExport::activated(int iMsg)
std::vector<App::DocumentObject*> points = getSelection().getObjectsOfType(Points::Feature::getClassTypeId());
for (std::vector<App::DocumentObject*>::const_iterator it = points.begin(); it != points.end(); ++it) {
QString fn = Gui::FileDialog::getSaveFileName(Gui::getMainWindow(),
QString::null, QString(), QString::fromLatin1("%1 (*.asc *.pcd *.ply);;%2 (*.*)")
QString(), QString(), QString::fromLatin1("%1 (*.asc *.pcd *.ply);;%2 (*.*)")
.arg(QObject::tr("Point formats"), QObject::tr("All Files")));
if (fn.isEmpty())
break;
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Spreadsheet/Gui/qtcolorpicker.cpp
Expand Up @@ -168,7 +168,7 @@ class ColorPickerItem : public QFrame
Q_OBJECT

public:
ColorPickerItem(const QColor &color = Qt::white, const QString &text = QString::null,
ColorPickerItem(const QColor &color = Qt::white, const QString &text = QString(),
QWidget *parent = 0);
~ColorPickerItem();

Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Spreadsheet/Gui/qtcolorpicker.h
Expand Up @@ -84,7 +84,7 @@ class QT_QTCOLORPICKER_EXPORT QtColorPicker : public QPushButton

~QtColorPicker();

void insertColor(const QColor &color, const QString &text = QString::null, int index = -1);
void insertColor(const QColor &color, const QString &text = QString(), int index = -1);

QColor currentColor() const;

Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/Gui/Command.cpp
Expand Up @@ -1020,7 +1020,7 @@ void CmdTechDrawSymbol::activated(int iMsg)

// Reading an image
QString filename = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(),
QObject::tr("Choose an SVG file to open"), QString::null,
QObject::tr("Choose an SVG file to open"), QString(),
QString::fromLatin1("%1 (*.svg *.svgz);;%2 (*.*)").
arg(QObject::tr("Scalable Vector Graphic")).
arg(QObject::tr("All Files")));
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/TechDraw/Gui/CommandDecorate.cpp
Expand Up @@ -412,7 +412,7 @@ void CmdTechDrawImage::activated(int iMsg)
// Reading an image
QString fileName = Gui::FileDialog::getOpenFileName(Gui::getMainWindow(),
QString::fromUtf8(QT_TR_NOOP("Select an Image File")),
QString::null,
QString(),
QString::fromUtf8(QT_TR_NOOP("Image (*.png *.jpg *.jpeg)")));

if (!fileName.isEmpty())
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/Test/Gui/UnitTestImp.h
Expand Up @@ -45,7 +45,7 @@ class UnitTestDialog : public QDialog
void clearUnitTests();
QString getUnitTest() const;
void setStatusText(const QString& text);
void setProgressFraction(float fraction, const QString& = QString::null);
void setProgressFraction(float fraction, const QString& = QString());
void clearErrorList();
void insertError(const QString& failure, const QString& details);
void setRunCount(int);
Expand Down

0 comments on commit c814eb1

Please sign in to comment.