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

Interfaces

  • 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 
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Apr 20 2013 06:06:51 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Interfaces

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

kdelibs-4.10.2 API Reference

Skip menu "kdelibs-4.10.2 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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