Okular

printoptionswidget.cpp
1 /*
2  SPDX-FileCopyrightText: 2019 Michael Weghorn <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #include "printoptionswidget.h"
8 
9 #include <QComboBox>
10 #include <QFormLayout>
11 
12 #include <KLocalizedString>
13 
14 namespace Okular
15 {
16 DefaultPrintOptionsWidget::DefaultPrintOptionsWidget(QWidget *parent)
17  : PrintOptionsWidget(parent)
18 {
19  setWindowTitle(i18n("Print Options"));
20  QFormLayout *layout = new QFormLayout(this);
21  m_ignorePrintMargins = new QComboBox;
22  // value indicates whether full page is enabled (i.e. print margins ignored)
23  m_ignorePrintMargins->insertItem(0, i18n("Fit to printable area"), false);
24  m_ignorePrintMargins->insertItem(1, i18n("Fit to full page"), true);
25  layout->addRow(i18n("Scale mode:"), m_ignorePrintMargins);
26 }
27 
28 bool DefaultPrintOptionsWidget::ignorePrintMargins() const
29 {
30  return m_ignorePrintMargins->currentData().value<bool>();
31 }
32 
33 }
global.h
Definition: action.h:16
void insertItem(int index, const QString &text, const QVariant &userData)
void addRow(QWidget *label, QWidget *field)
QString i18n(const char *text, const TYPE &arg...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sun Nov 28 2021 22:32:38 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.