• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Interfaces

  • sources
  • kde-4.12
  • kdelibs
  • interfaces
  • terminal
  • example
main.cc
Go to the documentation of this file.
1 #include "main.h"
2 
3 #include <QtCore/QDir>
4 
5 #include <kde_terminal_interface.h>
6 #include <KParts/Part>
7 #include <KService>
8 #include <KAboutData>
9 #include <KCmdLineArgs>
10 #include <KApplication>
11 
12 Window::Window()
13 {
14  this->resize(800,600);
15 
16  KService::Ptr service = KService::serviceByDesktopName("konsolepart");
17  Q_ASSERT(service);
18 
19  KParts::ReadOnlyPart* part = service->createInstance<KParts::ReadOnlyPart>(this, this, QVariantList());
20  Q_ASSERT(part);
21 
22  setCentralWidget( part->widget() );
23 
24  TerminalInterface* interface = qobject_cast<TerminalInterface*>(part);
25  interface->showShellInDir(QDir::home().path());
26 
27  connect(part, SIGNAL(destroyed()), this, SLOT(deleteLater()));
28 }
29 
30 int main( int argc, char** argv )
31 {
32  KAboutData* about = new KAboutData( "tetest", 0, ki18n("TETest"), "0.1" );
33  KCmdLineArgs::init( argc, argv, about );
34  KApplication app;
35  Window* window = new Window();
36  window->show();
37  return app.exec();
38 };
39 
KSharedPtr< KService >
KApplication
KService::serviceByDesktopName
static Ptr serviceByDesktopName(const QString &_name)
ki18n
KLocalizedString ki18n(const char *msg)
Window
Definition: main.h:6
TerminalInterface::showShellInDir
virtual void showShellInDir(const QString &dir)=0
KParts::Part::widget
virtual QWidget * widget()
kde_terminal_interface.h
main.h
KAboutData
Window::Window
Window()
Definition: main.cc:12
TerminalInterface
TerminalInterface is an interface implemented by KonsolePart to allow developers access to the Konsol...
Definition: kde_terminal_interface.h:85
main
int main(int argc, char **argv)
Definition: main.cc:30
KCmdLineArgs::init
static void init(int argc, char **argv, const QByteArray &appname, const QByteArray &catalog, const KLocalizedString &programName, const QByteArray &version, const KLocalizedString &description=KLocalizedString(), StdCmdLineArgs stdargs=StdCmdLineArgs(CmdLineArgQt|CmdLineArgKDE))
KService::createInstance
T * createInstance(QObject *parent=0, const QVariantList &args=QVariantList(), QString *error=0) const
KParts::ReadOnlyPart
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:52:10 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Interfaces

Skip menu "Interfaces"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal