+ fix reported Qt warning

This commit is contained in:
wmayer 2016-04-13 17:16:32 +02:00
parent 08df5cbc59
commit df6eb69f56
2 changed files with 12 additions and 13 deletions

View File

@ -48,16 +48,15 @@ namespace Gui {
namespace Dialog { namespace Dialog {
QByteArray toParamEntry(QString name) QByteArray toParamEntry(QString name)
{ {
QString tmp = QString::fromLatin1(name.toLatin1()); name.replace(QString::fromLatin1(" "), QString::fromLatin1("_"));
name.replace(QString::fromLatin1(" "),QString::fromLatin1("_"));
return name.toLatin1(); return name.toLatin1();
} }
void DlgCheckableMessageBox::showMessage(QString header, QString message, bool check,QString checkText ) void DlgCheckableMessageBox::showMessage(const QString& header, const QString& message, bool check, const QString& checkText)
{ {
bool checked = App::GetApplication().GetParameterGroupByPath( QByteArray("User parameter:BaseApp/CheckMessages"))->GetBool(toParamEntry(header)); bool checked = App::GetApplication().GetParameterGroupByPath( QByteArray("User parameter:BaseApp/CheckMessages"))->GetBool(toParamEntry(header));
if(!checked){ if (!checked) {
DlgCheckableMessageBox *mb = new DlgCheckableMessageBox(Gui::getMainWindow()); DlgCheckableMessageBox *mb = new DlgCheckableMessageBox(Gui::getMainWindow());
mb->setWindowTitle(header); mb->setWindowTitle(header);
mb->setIconPixmap(QMessageBox::standardIcon(QMessageBox::Warning)); mb->setIconPixmap(QMessageBox::standardIcon(QMessageBox::Warning));
@ -97,11 +96,11 @@ DlgCheckableMessageBox::~DlgCheckableMessageBox()
delete m_d; delete m_d;
} }
void DlgCheckableMessageBox::setPrefEntry( const QString& entry ) void DlgCheckableMessageBox::setPrefEntry(const QString& entry)
{ {
paramEntry = toParamEntry(entry); paramEntry = toParamEntry(entry);
bool checked = App::GetApplication().GetParameterGroupByPath( QByteArray("User parameter:BaseApp/CheckMessages"))->GetBool(paramEntry); bool checked = App::GetApplication().GetParameterGroupByPath(QByteArray("User parameter:BaseApp/CheckMessages"))->GetBool(paramEntry);
setChecked(checked); setChecked(checked);
} }
@ -236,4 +235,4 @@ QMessageBox::StandardButton DlgCheckableMessageBox::dialogButtonBoxToMessageBoxB
} // namespace Dialog } // namespace Dialog
} // namespace Gui } // namespace Gui
#include "moc_DlgCheckableMessageBox.cpp" #include "moc_DlgCheckableMessageBox.cpp"

View File

@ -51,7 +51,7 @@ class GuiExport DlgCheckableMessageBox : public QDialog
Q_PROPERTY(QString text READ text WRITE setText) Q_PROPERTY(QString text READ text WRITE setText)
Q_PROPERTY(QPixmap iconPixmap READ iconPixmap WRITE setIconPixmap) Q_PROPERTY(QPixmap iconPixmap READ iconPixmap WRITE setIconPixmap)
Q_PROPERTY(bool isChecked READ isChecked WRITE setChecked) Q_PROPERTY(bool isChecked READ isChecked WRITE setChecked)
Q_PROPERTY(QString prefEntry WRITE setPrefEntry) //Q_PROPERTY(QString prefEntry WRITE setPrefEntry) // Must have a READ accessor!
Q_PROPERTY(QString checkBoxText READ checkBoxText WRITE setCheckBoxText) Q_PROPERTY(QString checkBoxText READ checkBoxText WRITE setCheckBoxText)
Q_PROPERTY(QDialogButtonBox::StandardButtons buttons READ standardButtons WRITE setStandardButtons) Q_PROPERTY(QDialogButtonBox::StandardButtons buttons READ standardButtons WRITE setStandardButtons)
Q_PROPERTY(QDialogButtonBox::StandardButton defaultButton READ defaultButton WRITE setDefaultButton) Q_PROPERTY(QDialogButtonBox::StandardButton defaultButton READ defaultButton WRITE setDefaultButton)
@ -71,7 +71,7 @@ public:
QString text() const; QString text() const;
void setText(const QString &); void setText(const QString &);
void setPrefEntry( const QString& entry ); void setPrefEntry(const QString& entry);
virtual void accept(); virtual void accept();
virtual void reject(); virtual void reject();
@ -99,8 +99,8 @@ public:
// Conversion convenience // Conversion convenience
static QMessageBox::StandardButton dialogButtonBoxToMessageBoxButton(QDialogButtonBox::StandardButton); static QMessageBox::StandardButton dialogButtonBoxToMessageBoxButton(QDialogButtonBox::StandardButton);
// conviniant show method // convenient show method
static void showMessage(QString haeder, QString message, bool check=false,QString checkText = QString::fromLatin1("Don't show me again")); static void showMessage(const QString& haeder, const QString& message, bool check=false, const QString& checkText = QString::fromLatin1("Don't show me again"));
private Q_SLOTS: private Q_SLOTS:
void slotClicked(QAbstractButton *b); void slotClicked(QAbstractButton *b);