• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegraphics API Reference
  • KDE Home
  • Contact Us
 

okular

  • sources
  • kde-4.12
  • kdegraphics
  • okular
  • core
textdocumentsettings.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2013 by Azat Khuzhin <a3at.mail@gmail.com> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  ***************************************************************************/
9 
10 
11 #include "textdocumentsettings.h"
12 #include "textdocumentsettings_p.h"
13 #include "ui_textdocumentsettings.h"
14 
15 #include <KFontRequester>
16 #include <KLocale>
17 
18 #include <QLabel>
19 
20 
21 using namespace Okular;
22 
27 TextDocumentSettingsWidget::TextDocumentSettingsWidget( QWidget *parent )
28  : QWidget( parent )
29  , d_ptr( new TextDocumentSettingsWidgetPrivate( new Ui_TextDocumentSettings() ) )
30 {
31  Q_D( TextDocumentSettingsWidget );
32 
33  d->mUi->setupUi( this );
34 
35  // @notice I think this will be useful in future.
36 #define ADD_WIDGET( property, widget, objectName, labelName ) \
37  d->property = new widget( this ); \
38  d->property->setObjectName( QString::fromUtf8( objectName ) ); \
39  addRow( labelName, d->property );
40 
41  ADD_WIDGET( mFont, KFontRequester, "kcfg_Font", i18n("&Default Font:") );
42 #undef ADD_WIDGET
43 }
44 
45 TextDocumentSettingsWidget::~TextDocumentSettingsWidget()
46 {
47  Q_D( TextDocumentSettingsWidget );
48 
49  delete d->mUi;
50 }
51 
52 void TextDocumentSettingsWidget::addRow( const QString& labelText, QWidget *widget )
53 {
54  Q_D( TextDocumentSettingsWidget );
55 
56  d->mUi->formLayout->addRow( labelText, widget );
57 }
58 
59 
64 TextDocumentSettings::TextDocumentSettings( const QString& config, QObject *parent )
65  : KConfigSkeleton( config, parent )
66  , d_ptr( new TextDocumentSettingsPrivate() )
67 {
68  Q_D( TextDocumentSettings );
69 
70  addItemFont( "Font", d->mFont );
71 }
72 
73 QFont TextDocumentSettings::font() const
74 {
75  Q_D( const TextDocumentSettings );
76  return d->mFont;
77 }
Okular::TextDocumentSettings::font
QFont font() const
Definition: textdocumentsettings.cpp:73
Okular::TextDocumentSettingsWidget::TextDocumentSettingsWidget
TextDocumentSettingsWidget(QWidget *parent=0)
TextDocumentSettingsWidget.
Definition: textdocumentsettings.cpp:27
Okular::TextDocumentSettingsPrivate
Definition: textdocumentsettings_p.h:34
QWidget
Okular::TextDocumentSettingsWidget
Here is example of how you can add custom settings per-backend:
Definition: textdocumentsettings.h:82
Okular::TextDocumentSettingsWidget::~TextDocumentSettingsWidget
virtual ~TextDocumentSettingsWidget()
Definition: textdocumentsettings.cpp:45
KConfigSkeleton
QObject
Okular::TextDocumentSettingsWidget::addRow
void addRow(const QString &labelText, QWidget *widget)
Definition: textdocumentsettings.cpp:52
Okular::TextDocumentSettingsWidgetPrivate
Definition: textdocumentsettings_p.h:19
textdocumentsettings.h
textdocumentsettings_p.h
Okular::TextDocumentSettings
TextDocumentSettings.
Definition: textdocumentsettings.h:106
ADD_WIDGET
#define ADD_WIDGET(property, widget, objectName, labelName)
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okular

Skip menu "okular"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegraphics API Reference

Skip menu "kdegraphics API Reference"
  •     libkdcraw
  •     libkexiv2
  •     libkipi
  •     libksane
  • okular

Search



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