File: ksaneviewertest.cpp

package info (click to toggle)
libkf5sane 22.12.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,608 kB
  • sloc: cpp: 6,980; sh: 11; makefile: 3
file content (39 lines) | stat: -rw-r--r-- 928 bytes parent folder | download | duplicates (2)
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
/* ============================================================
*
* This file is part of the KDE project
*
* Date        : 2010-03-17
* Description : Preview image viewer that can handle a selection.
*
* SPDX-FileCopyrightText: 2010 Kare Sars <kare dot sars at iki dot fi>
* SPDX-FileCopyrightText: 2014 Gregor Mitsch : port to KDE5 frameworks
*
* SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*
* ============================================================ */

#include "ksaneviewer.h"

#include <QDebug>
#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    if (argc != 2) {
        qDebug() << "An image filename is needed.";
        return 1;
    }
    QImage img(QString::fromUtf8(argv[1]));

    KSaneIface::KSaneViewer viewer(&img);

    viewer.findSelections();

    viewer.show();

    viewer.zoom2Fit();

    return app.exec();
}