KPIMTextedit Library
21 #include "inserthtmldialog.h"
22 #include "htmlhighlighter.h"
24 #include <KLocalizedString>
27 #include <QVBoxLayout>
30 namespace KPIMTextEdit {
32 class InsertHtmlDialogPrivate
35 InsertHtmlDialogPrivate( InsertHtmlDialog *qq )
38 q->setCaption( i18n(
"Insert HTML" ) );
39 q->setButtons( KDialog::Ok|KDialog::Cancel );
40 q->setButtonText( KDialog::Ok, i18n(
"Insert" ) );
42 q->setMainWidget( page );
44 QLabel *label =
new QLabel( i18n(
"Insert HTML tags and texts:" ) );
46 editor =
new KTextEdit;
47 new HtmlHighlighter( editor->document() );
48 editor->setAcceptRichText(
false );
51 label =
new QLabel( i18n(
"Example: <i> Hello word </i>" ) );
57 q->connect( editor, SIGNAL(textChanged()),
58 q, SLOT(_k_slotTextChanged()) );
59 q->enableButtonOk(
false );
60 q->resize( 640, 480 );
63 void _k_slotTextChanged();
69 void InsertHtmlDialogPrivate::_k_slotTextChanged()
71 q->enableButtonOk( !editor->toPlainText().isEmpty() );
74 InsertHtmlDialog::InsertHtmlDialog(
QWidget *parent )
75 : KDialog( parent ), d( new InsertHtmlDialogPrivate( this ) )
79 InsertHtmlDialog::~InsertHtmlDialog()
84 QString InsertHtmlDialog::html()
const
86 return d->editor->toPlainText();
91 #include "moc_inserthtmldialog.cpp"
void setBold(bool enable)
void setTextFormat(Qt::TextFormat)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:37:23 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.