kapptemplate
Go to the documentation of this file.
3 #include <KPluginFactory>
4 #include <KPluginLoader>
7 #include <KActionCollection>
10 #include <KStandardDirs>
11 #include <KStandardAction>
12 #include <KMessageBox>
13 #include <KActionMenu>
14 #include <KConfigDialog>
15 #include <QGraphicsWidget>
19 static const KAboutData
aboutdata(
"%{APPNAMELC}plugin", 0, ki18n(
"%{APPNAME} Settings") ,
"0.1" );
21 K_PLUGIN_FACTORY(%{APPNAMELC}PluginFactory, registerPlugin<%{APPNAMELC}
Plugin>(); )
22 K_EXPORT_PLUGIN(%{APPNAMELC}PluginFactory(
aboutdata))
30 setComponentData(%{APPNAMELC}PluginFactory::componentData());
32 m_Part =
dynamic_cast<KParts::ReadOnlyPart *
>(parent);
35 kDebug() <<
"Unable to get KHTMLPart" << endl;
39 kDebug() <<
"%{APPNAMELC} created" << endl;
43 QAction *actConfig = actionCollection()->addAction(
"configure_%{APPNAMELC}");
44 actConfig->
setText(i18n(
"&Configure %{APPNAME}"));
47 KActionMenu*menu =
new KActionMenu(
"%{APPNAME}", actionCollection());
48 actionCollection()->addAction(
"tools_%{APPNAMELC}", menu);
49 connect(actConfig, SIGNAL(triggered(
bool)),
this, SLOT(showConfig()));
50 menu->addAction(actConfig);
58 void %{APPNAMELC}Plugin::showConfig()
60 kDebug() <<
"Configure %{APPNAMELC}" << endl;
66 if ( KConfigDialog::showDialog (
"settings" ) )
70 KConfigDialog *dialog =
new KConfigDialog ( NULL,
"settings",
Settings::self() );
72 ui_configdialog.setupUi ( generalSettingsDlg );
73 dialog->addPage ( generalSettingsDlg, i18n (
"General" ),
"package_setting" );
75 dialog->setAttribute ( Qt::WA_DeleteOnClose );
void setText(const QString &text)
class @6 QWidget
This is the main view class for %{APPNAME}.
static const KAboutData aboutdata("%{APPNAMELC}plugin", 0, ki18n("%{APPNAME} Settings"),"0.1")
class @0 Plugin(QObject *parent, const QVariantList &args)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:39:44 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.