summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2016-03-30 13:59:30 +0200
committerMontel Laurent <[email protected]>2016-03-30 13:59:30 +0200
commit0e5aa5500a80bee1b7c1bb98a6e17ee6524c05e1 (patch)
tree39d4202cbf6e74afafc67e475f19dc3e69881d6d
parent222aaa6987dcd7827dac28877ead9e989680d11b (diff)
Start to reimplement bold support
-rw-r--r--composereditorwebengine/src/composerwebengine.h1
-rw-r--r--composereditorwebengine/src/private/composerwebengine_p.cpp9
-rw-r--r--composereditorwebengine/src/private/composerwebengine_p.h1
3 files changed, 10 insertions, 1 deletions
diff --git a/composereditorwebengine/src/composerwebengine.h b/composereditorwebengine/src/composerwebengine.h
index aaa3b46..a990d2d 100644
--- a/composereditorwebengine/src/composerwebengine.h
+++ b/composereditorwebengine/src/composerwebengine.h
@@ -157,6 +157,7 @@ private:
Q_PRIVATE_SLOT(d, void _k_slotPasteWithoutFormatting())
Q_PRIVATE_SLOT(d, void _k_slotInsertSpecialChar())
Q_PRIVATE_SLOT(d, void _k_slotInsertAnchor())
+ Q_PRIVATE_SLOT(d, void _k_slotBold(bool))
};
}
#endif // COMPOSERWEBENGINE_H
diff --git a/composereditorwebengine/src/private/composerwebengine_p.cpp b/composereditorwebengine/src/private/composerwebengine_p.cpp
index 216f8e3..c8016a6 100644
--- a/composereditorwebengine/src/private/composerwebengine_p.cpp
+++ b/composereditorwebengine/src/private/composerwebengine_p.cpp
@@ -130,6 +130,7 @@ void ComposerEditorWebEnginePrivate::createAction(ComposerWebEngine::ComposerWeb
action_text_bold->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_B));
//FORWARD_ACTION(action_text_bold, QWebPage::ToggleBold);
htmlEditorActionList.append(action_text_bold);
+ q->connect(action_text_bold, SIGNAL(triggered(bool)), SLOT(_k_slotBold(bool)));
}
break;
}
@@ -677,7 +678,8 @@ void ComposerEditorWebEnginePrivate::_k_slotInsertTable()
void ComposerEditorWebEnginePrivate::_k_slotInsertHorizontalRule()
{
- execCommand(QStringLiteral("insertHTML"), QStringLiteral("<hr>"));
+
+ execCommand(QStringLiteral("insertHorizontalRule"));
}
void ComposerEditorWebEnginePrivate::_k_insertLink()
@@ -711,6 +713,11 @@ void ComposerEditorWebEnginePrivate::_k_slotOpenLink()
#endif
}
+void ComposerEditorWebEnginePrivate::_k_slotBold(bool b)
+{
+ execCommand(QStringLiteral("bold"), b ? QStringLiteral("true") : QStringLiteral("false"));
+}
+
void ComposerEditorWebEnginePrivate::_k_setFontSize(int fontSize)
{
execCommand(QStringLiteral("fontSize"), QString::number(fontSize + 1)); //Verify
diff --git a/composereditorwebengine/src/private/composerwebengine_p.h b/composereditorwebengine/src/private/composerwebengine_p.h
index 55029f5..a4b4902 100644
--- a/composereditorwebengine/src/private/composerwebengine_p.h
+++ b/composereditorwebengine/src/private/composerwebengine_p.h
@@ -91,6 +91,7 @@ public:
void _k_slotInsertSpecialChar();
void _k_slotInsertAnchor();
void _k_slotOpenLink();
+ void _k_slotBold(bool);
QAction *getAction(QWebEnginePage::WebAction action) const;
QVariant evaluateJavascript(const QString &command);