summaryrefslogtreecommitdiffstats
path: root/kview/kviewviewer/test/test.cpp
blob: dfcdc9187bd09f5686b16864043c3e294e6d5af0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * Copyright (c) 2001 Matthias Kretz <[email protected]>
 */

#include "test.h"
#include <kimageviewer/viewer.h>

#include <kurl.h>
#include <klibloader.h>
#include <kmessagebox.h>
#include <tdeparts/componentfactory.h>
#include <kapplication.h>

#include <tqimage.h>

Test::Test()
    : KParts::MainWindow( 0, "KView Viewer Test" ),
	m_part( 0 )
{
	m_part = KParts::ComponentFactory::createPartInstanceFromQuery<KParts::ReadWritePart>(
			"image/jpeg", "Name == 'Image Viewer Part'", this, 0, this );
    if( m_part )
	{
		setCentralWidget( m_part->widget() );
		createGUI( m_part );
	}
    else
    {
        KMessageBox::error(this, "Could not find our Part!");
        kapp->quit();
    }
}

Test::~Test()
{
}

void Test::load(const KURL& url)
{
	m_part->openURL( url );
}

#include "test.moc"