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

Interfaces

main.cc
Go to the documentation of this file.
00001 #include "main.h"
00002 
00003 #include <QtCore/QDir>
00004 
00005 #include <kde_terminal_interface.h>
00006 #include <KParts/Part>
00007 #include <KService>
00008 #include <KAboutData>
00009 #include <KCmdLineArgs>
00010 #include <KApplication>
00011 
00012 Window::Window()
00013 {
00014     this->resize(800,600);
00015 
00016     KService::Ptr service = KService::serviceByDesktopName("konsolepart");
00017     Q_ASSERT(service);
00018 
00019     KParts::ReadOnlyPart* part = service->createInstance<KParts::ReadOnlyPart>(this, this, QVariantList());
00020     Q_ASSERT(part);
00021 
00022     setCentralWidget( part->widget() );
00023 
00024     TerminalInterface* interface = qobject_cast<TerminalInterface*>(part);
00025     interface->showShellInDir(QDir::home().path());
00026 
00027     connect(part, SIGNAL(destroyed()), this, SLOT(deleteLater()));
00028 }
00029 
00030 int main( int argc, char** argv )
00031 {
00032     KAboutData* about = new KAboutData( "tetest", 0, ki18n("TETest"), "0.1" );
00033     KCmdLineArgs::init( argc, argv, about );
00034     KApplication app;
00035     Window* window = new Window();
00036     window->show();
00037     return app.exec();
00038 };
00039 
This file is part of the KDE documentation.
Documentation copyright © 1996-2019 The KDE developers.
Generated on Mon Jan 21 2019 12:39:56 by doxygen 1.7.5.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.9.5 API Reference

Skip menu "kdelibs-4.9.5 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