summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Montel <[email protected]>2018-02-10 17:06:35 +0100
committerLaurent Montel <[email protected]>2018-02-10 17:06:35 +0100
commit8cd7348794e00a88eba62fbe68118f1b3baaf531 (patch)
treee8b62a4eb189fd4355cc20d1cfaa3d68ed117cdc
parent37eecf08912f6ee634f53bb97e817d95379805a5 (diff)
Fix warnings
-rw-r--r--src/composer-ng/nestedlisthelper.cpp2
-rw-r--r--src/composer-ng/richtextcomposer.cpp4
-rw-r--r--src/composer-ng/richtextcomposercontroler.cpp6
-rw-r--r--src/composer-ng/richtextcomposerimages.cpp2
-rw-r--r--src/composer-ng/richtextexternalcomposer.cpp2
-rw-r--r--src/inserttablewidget.cpp4
-rw-r--r--src/tablecellformatdialog.cpp4
-rw-r--r--src/tableformatdialog.cpp2
8 files changed, 13 insertions, 13 deletions
diff --git a/src/composer-ng/nestedlisthelper.cpp b/src/composer-ng/nestedlisthelper.cpp
index 971ab48..56ef535 100644
--- a/src/composer-ng/nestedlisthelper.cpp
+++ b/src/composer-ng/nestedlisthelper.cpp
@@ -292,7 +292,7 @@ void NestedListHelper::handleOnBulletType(int styleIndex)
{
QTextCursor cursor = textEdit->textCursor();
if (styleIndex != 0) {
- QTextListFormat::Style style = (QTextListFormat::Style)styleIndex;
+ QTextListFormat::Style style = static_cast<QTextListFormat::Style>(styleIndex);
QTextList *currentList = cursor.currentList();
QTextListFormat listFmt;
diff --git a/src/composer-ng/richtextcomposer.cpp b/src/composer-ng/richtextcomposer.cpp
index 839992e..eb9f886 100644
--- a/src/composer-ng/richtextcomposer.cpp
+++ b/src/composer-ng/richtextcomposer.cpp
@@ -44,8 +44,8 @@ class Q_DECL_HIDDEN RichTextComposer::RichTextComposerPrivate
public:
RichTextComposerPrivate(RichTextComposer *qq)
: q(qq)
- , forcePlainTextMarkup(false)
, mode(RichTextComposer::Plain)
+ , forcePlainTextMarkup(false)
{
composerControler = new RichTextComposerControler(q, q);
richTextComposerActions = new RichTextComposerActions(composerControler, q);
@@ -60,8 +60,8 @@ public:
RichTextComposerActions *richTextComposerActions = nullptr;
KPIMTextEdit::RichTextExternalComposer *externalComposer = nullptr;
RichTextComposer *q = nullptr;
- bool forcePlainTextMarkup = false;
RichTextComposer::Mode mode;
+ bool forcePlainTextMarkup = false;
};
RichTextComposer::RichTextComposer(QWidget *parent)
diff --git a/src/composer-ng/richtextcomposercontroler.cpp b/src/composer-ng/richtextcomposercontroler.cpp
index a34c192..e556829 100644
--- a/src/composer-ng/richtextcomposercontroler.cpp
+++ b/src/composer-ng/richtextcomposercontroler.cpp
@@ -46,9 +46,9 @@ class Q_DECL_HIDDEN RichTextComposerControler::RichTextComposerControlerPrivate
{
public:
RichTextComposerControlerPrivate(RichTextComposer *composer, RichTextComposerControler *qq)
- : painterActive(false)
- , richtextComposer(composer)
+ : richtextComposer(composer)
, q(qq)
+ , painterActive(false)
{
nestedListHelper = new NestedListHelper(composer);
richTextImages = new RichTextComposerImages(richtextComposer, q);
@@ -76,11 +76,11 @@ public:
QFont saveFont;
QColor mLinkColor;
QTextCharFormat painterFormat;
- bool painterActive;
NestedListHelper *nestedListHelper = nullptr;
RichTextComposer *richtextComposer = nullptr;
RichTextComposerImages *richTextImages = nullptr;
RichTextComposerControler *q = nullptr;
+ bool painterActive;
};
void RichTextComposerControler::RichTextComposerControlerPrivate::selectLinkText(QTextCursor *cursor) const
diff --git a/src/composer-ng/richtextcomposerimages.cpp b/src/composer-ng/richtextcomposerimages.cpp
index 75d0441..a7ed4e8 100644
--- a/src/composer-ng/richtextcomposerimages.cpp
+++ b/src/composer-ng/richtextcomposerimages.cpp
@@ -105,7 +105,7 @@ void RichTextComposerImages::loadImage(const QImage &image, const QString &match
QUrl(resourceName), QVariant(image));
QTextImageFormat format;
format.setName(resourceName);
- if ((imageFormat.width() != 0) && (imageFormat.height() != 0)) {
+ if ((imageFormat.width() != 0.0) && (imageFormat.height() != 0.0)) {
format.setWidth(imageFormat.width());
format.setHeight(imageFormat.height());
}
diff --git a/src/composer-ng/richtextexternalcomposer.cpp b/src/composer-ng/richtextexternalcomposer.cpp
index 2e8426f..3c7da0b 100644
--- a/src/composer-ng/richtextexternalcomposer.cpp
+++ b/src/composer-ng/richtextexternalcomposer.cpp
@@ -102,7 +102,7 @@ void RichTextExternalComposer::startExternalEditor()
// construct command line...
QHash<QChar, QString> map;
map.insert(QLatin1Char('l'), QString::number(d->richTextComposer->textCursor().blockNumber() + 1));
- map.insert(QLatin1Char('w'), QString::number((qulonglong)d->richTextComposer->winId()));
+ map.insert(QLatin1Char('w'), QString::number(static_cast<qulonglong>(d->richTextComposer->winId())));
map.insert(QLatin1Char('f'), d->extEditorTempFile->fileName());
const QString cmd = KMacroExpander::expandMacrosShellQuote(commandLine, map);
const QStringList arg = KShell::splitArgs(cmd);
diff --git a/src/inserttablewidget.cpp b/src/inserttablewidget.cpp
index b70024b..d21d326 100644
--- a/src/inserttablewidget.cpp
+++ b/src/inserttablewidget.cpp
@@ -114,8 +114,8 @@ void InsertTableWidget::slotTypeOfLengthChanged(int index)
QTextLength::Type InsertTableWidget::typeOfLength() const
{
return
- (QTextLength::Type)d->mTypeOfLength->itemData(
- d->mTypeOfLength->currentIndex()).toInt();
+ static_cast<QTextLength::Type>(d->mTypeOfLength->itemData(
+ d->mTypeOfLength->currentIndex()).toInt());
}
void InsertTableWidget::setTypeOfLength(QTextLength::Type type)
diff --git a/src/tablecellformatdialog.cpp b/src/tablecellformatdialog.cpp
index 494cbd2..988a857 100644
--- a/src/tablecellformatdialog.cpp
+++ b/src/tablecellformatdialog.cpp
@@ -109,8 +109,8 @@ void TableCellFormatDialog::setTableCellBackgroundColor(const QColor &col)
QTextCharFormat::VerticalAlignment TableCellFormatDialog::verticalAlignment() const
{
return
- (QTextCharFormat::VerticalAlignment)d->verticalAlignment->itemData(
- d->verticalAlignment->currentIndex()).toInt();
+ static_cast<QTextCharFormat::VerticalAlignment>(d->verticalAlignment->itemData(
+ d->verticalAlignment->currentIndex()).toInt());
}
void TableCellFormatDialog::setVerticalAlignment(QTextCharFormat::VerticalAlignment vertical)
diff --git a/src/tableformatdialog.cpp b/src/tableformatdialog.cpp
index 4b571b6..ed2710b 100644
--- a/src/tableformatdialog.cpp
+++ b/src/tableformatdialog.cpp
@@ -190,7 +190,7 @@ void TableFormatDialog::setAlignment(Qt::Alignment alignment)
Qt::Alignment TableFormatDialog::alignment() const
{
- return (Qt::Alignment)d->alignment->itemData(d->alignment->currentIndex()).toInt();
+ return static_cast<Qt::Alignment>(d->alignment->itemData(d->alignment->currentIndex()).toInt());
}
QTextLength::Type TableFormatDialog::typeOfLength() const