Qt5: 'QString::null' is deprecated: use QString() [-Wdeprecated-declarations]
This commit is contained in:
@@ -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());
|
||||
* }
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
@@ -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());
|
||||
@@ -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());
|
||||
@@ -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) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
@@ -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();
|
||||
@@ -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();
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -221,7 +221,7 @@ QString FileDialog::getSaveFileName (QWidget * parent, const QString & caption,
|
||||
setWorkingDirectory(file);
|
||||
return file;
|
||||
} else {
|
||||
return QString::null;
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,7 +316,7 @@ QString FileDialog::getOpenFileName(QWidget * parent, const QString & caption, c
|
||||
setWorkingDirectory(file);
|
||||
return file;
|
||||
} else {
|
||||
return QString::null;
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
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 );
|
||||
|
||||
@@ -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
|
||||
@@ -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;
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
|
||||
~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;
|
||||
|
||||
|
||||
@@ -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")));
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user