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

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • printing
loggingform.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  loggingform.cpp - K Desktop Planetarium
3  -------------------
4  begin : Wed Jul 20 2011
5  copyright : (C) 2011 by Rafał Kułaga
6  email : rl.kulaga@gmail.com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "loggingform.h"
19 
20 #include "QTextDocument"
21 #include "QTextTable"
22 #include "QPrinter"
23 #include "kstars.h"
24 
25 LoggingForm::LoggingForm()
26 {}
27 
28 void LoggingForm::createFinderChartLogger()
29 {
30  QTextCursor cursor(m_Document);
31  cursor.movePosition(QTextCursor::Start);
32 
33  QTextTableFormat tableFormat;
34  tableFormat.setAlignment(Qt::AlignHCenter);
35  tableFormat.setBorder(2);
36  tableFormat.setCellPadding(2);
37  tableFormat.setCellSpacing(4);
38 
39  QTextCharFormat fieldCharFmt;
40  QFont font("Times", 10);
41  fieldCharFmt.setFont(font);
42 
43  QVector<QTextLength> constraints;
44  constraints << QTextLength(QTextLength::PercentageLength, 25)
45  << QTextLength(QTextLength::PercentageLength, 25)
46  << QTextLength(QTextLength::PercentageLength, 25)
47  << QTextLength(QTextLength::PercentageLength, 25);
48  tableFormat.setColumnWidthConstraints(constraints);
49 
50  QTextTable *table = cursor.insertTable(5, 4, tableFormat);
51  table->mergeCells(0, 0, 1, 4);
52  table->cellAt(0, 0).firstCursorPosition().insertText(i18n("Observer:"), fieldCharFmt);
53 
54  table->mergeCells(1, 0, 1, 2);
55  table->cellAt(1, 0).firstCursorPosition().insertText(i18n("Date:"), fieldCharFmt);
56  table->mergeCells(1, 2, 1, 2);
57  table->cellAt(1, 2).firstCursorPosition().insertText(i18n("Time:"), fieldCharFmt);
58 
59  table->mergeCells(2, 0, 1, 2);
60  table->cellAt(2, 0).firstCursorPosition().insertText(i18n("Site:"), fieldCharFmt);
61  table->cellAt(2, 2).firstCursorPosition().insertText(i18n("Seeing:"), fieldCharFmt);
62  table->cellAt(2, 3).firstCursorPosition().insertText(i18n("Trans:"), fieldCharFmt);
63 
64  table->mergeCells(3, 0, 1, 4);
65  table->cellAt(3, 0).firstCursorPosition().insertText(i18n("Telescope:"), fieldCharFmt);
66 
67  table->mergeCells(4, 0, 1, 3);
68  table->cellAt(4, 0).firstCursorPosition().insertText(i18n("Eyepiece:"), fieldCharFmt);
69  table->cellAt(4, 3).firstCursorPosition().insertText(i18n("Power:"), fieldCharFmt);
70 }
71 
72 QTextDocument* LoggingForm::getDocument()
73 {
74  return m_Document;
75 }
LoggingForm::getDocument
QTextDocument * getDocument()
Get logging form internal QTextDocument.
Definition: loggingform.cpp:72
LoggingForm::LoggingForm
LoggingForm()
Constructor.
Definition: loggingform.cpp:25
loggingform.h
KStarsDocument::m_Document
QTextDocument * m_Document
Definition: kstarsdocument.h:73
LoggingForm::createFinderChartLogger
void createFinderChartLogger()
Create simple logging form for finder charts.
Definition: loggingform.cpp:28
kstars.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

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