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
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.