SonarQube warnings.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-06-05 19:47:25 +03:00
parent 8e7ea0f45f
commit 3a4871fcd0
5 changed files with 37 additions and 31 deletions

View File

@ -177,7 +177,7 @@ QString DialogMDataBase::ImgTag(const QString &number)
const bool ok = renderer.load(filePath);
if (ok)
{
const QScreen *screen = QApplication::screens().at(0);
const QScreen *screen = QGuiApplication::screens().at(0);
if (screen)
{
const QSize defSize = renderer.defaultSize();
@ -223,30 +223,27 @@ void DialogMDataBase::changeEvent(QEvent *event)
//---------------------------------------------------------------------------------------------------------------------
bool DialogMDataBase::eventFilter(QObject *target, QEvent *event)
{
if (target == ui->treeWidget)
if (target == ui->treeWidget && event->type() == QEvent::KeyPress)
{
if (event->type() == QEvent::KeyPress)
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
switch(keyEvent->key())
{
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
switch(keyEvent->key())
case Qt::Key_Up:
{
case Qt::Key_Up:
{
const QModelIndex model = ui->treeWidget->indexAbove(ui->treeWidget->currentIndex());
QTreeWidgetItem *item = ui->treeWidget->itemAbove(ui->treeWidget->currentItem());
ShowDescription(item, model.column());
break;
}
case Qt::Key_Down:
{
const QModelIndex model = ui->treeWidget->indexBelow(ui->treeWidget->currentIndex());
QTreeWidgetItem *item = ui->treeWidget->itemBelow(ui->treeWidget->currentItem());
ShowDescription(item, model.column());
break;
}
default:
break;
const QModelIndex model = ui->treeWidget->indexAbove(ui->treeWidget->currentIndex());
QTreeWidgetItem *item = ui->treeWidget->itemAbove(ui->treeWidget->currentItem());
ShowDescription(item, model.column());
break;
}
case Qt::Key_Down:
{
const QModelIndex model = ui->treeWidget->indexBelow(ui->treeWidget->currentIndex());
QTreeWidgetItem *item = ui->treeWidget->itemBelow(ui->treeWidget->currentItem());
ShowDescription(item, model.column());
break;
}
default:
break;
}
}
return QDialog::eventFilter(target, event);

View File

@ -143,7 +143,10 @@ QmuParserBase::~QmuParserBase()
*/
QmuParserBase& QmuParserBase::operator=(const QmuParserBase &a_Parser)
{
Assign(a_Parser);
if (this != &a_Parser)
{
Assign(a_Parser);
}
return *this;
}

View File

@ -64,7 +64,10 @@ QmuParserByteCode::QmuParserByteCode(const QmuParserByteCode &a_ByteCode)
*/
QmuParserByteCode& QmuParserByteCode::operator=(const QmuParserByteCode &a_ByteCode)
{
Assign(a_ByteCode);
if (this != &a_ByteCode)
{
Assign(a_ByteCode);
}
return *this;
}

View File

@ -313,13 +313,16 @@ QmuParserCallback::QmuParserCallback (const QmuParserCallback &a_Fun )
//---------------------------------------------------------------------------------------------------------------------
QmuParserCallback &QmuParserCallback::operator=(const QmuParserCallback &a_Fun)
{
m_pFun = a_Fun.m_pFun;
m_iArgc = a_Fun.m_iArgc;
m_bAllowOpti = a_Fun.m_bAllowOpti;
m_iCode = a_Fun.m_iCode;
m_iType = a_Fun.m_iType;
m_iPri = a_Fun.m_iPri;
m_eOprtAsct = a_Fun.m_eOprtAsct;
if (this != &a_Fun)
{
m_pFun = a_Fun.m_pFun;
m_iArgc = a_Fun.m_iArgc;
m_bAllowOpti = a_Fun.m_bAllowOpti;
m_iCode = a_Fun.m_iCode;
m_iType = a_Fun.m_iType;
m_iPri = a_Fun.m_iPri;
m_eOprtAsct = a_Fun.m_eOprtAsct;
}
return *this;
}

View File

@ -8,7 +8,7 @@
include(../../../common.pri)
# Library use widgets
QT += widgets
QT += core widgets
# We don't need gui library.
QT -= gui