as_helpanel.cpp

changeset 3
c1941114ca88
parent 1
d64aaa7d146f
child 12
ceb4ba3d2d00
equal deleted inserted replaced
0:df83caa30359 1:ee0591707259
1 // 1 //
2 // OSSP asgui - Accounting system graphical user interface 2 // OSSP asgui - Accounting system graphical user interface
3 // Copyright (c) 2002-2004 The OSSP Project (http://www.ossp.org/) 3 // Copyright (c) 2002-2008 The OSSP Project (http://www.ossp.org/)
4 // Copyright (c) 2002-2004 Ralf S. Engelschall <rse@engelschall.com> 4 // Copyright (c) 2002-2008 Ralf S. Engelschall <rse@engelschall.com>
5 // Copyright (c) 2002-2004 Michael Schloh von Bennewitz <michael@schloh.com> 5 // Copyright (c) 2002-2008 Michael Schloh von Bennewitz <michael@schloh.com>
6 // Copyright (c) 2002-2004 Cable & Wireless Telecommunications Services GmbH 6 // Copyright (c) 2002-2008 Cable & Wireless Telecommunications Services GmbH
7 // 7 //
8 // This file is part of OSSP asgui, an accounting system graphical user 8 // This file is part of OSSP asgui, an accounting system graphical user
9 // interface which can be found at http://www.ossp.org/pkg/tool/asgui/. 9 // interface which can be found at http://asgui.europalab.com/.
10 // 10 //
11 // Permission to use, copy, modify, and distribute this software for 11 // Permission to use, copy, modify, and distribute this software for
12 // any purpose with or without fee is hereby granted, provided that 12 // any purpose with or without fee is hereby granted, provided that
13 // the above copyright notice and this permission notice appear in all 13 // the above copyright notice and this permission notice appear in all
14 // copies. 14 // copies.
27 // SUCH DAMAGE. 27 // SUCH DAMAGE.
28 // 28 //
29 // as_helpanel.cpp: ISO C++ implementation 29 // as_helpanel.cpp: ISO C++ implementation
30 // 30 //
31 31
32 #define QT3_SUPPORT
33
32 #include <qvariant.h> 34 #include <qvariant.h>
33 #include <qpushbutton.h> 35 #include <qpushbutton.h>
34 #include <qtextbrowser.h> 36 #include <q3textbrowser.h>
35 #include <qlayout.h> 37 #include <qlayout.h>
36 #include <qtooltip.h> 38 #include <qtooltip.h>
37 #include <qwhatsthis.h> 39 #include <q3whatsthis.h>
40
41 //Added by qt3to4:
42 #include <Q3HBoxLayout>
43 #include <Q3VBoxLayout>
38 44
39 #include "as_helpanel.h" 45 #include "as_helpanel.h"
40 46
41 47
42 namespace AS { 48 namespace AS {
46 // name 'kszName' and widget flags set to 'Flags'. 52 // name 'kszName' and widget flags set to 'Flags'.
47 // 53 //
48 // The dialog will by default be modal, unless you set 'bModal' to 54 // The dialog will by default be modal, unless you set 'bModal' to
49 // false to construct a modeless dialog. 55 // false to construct a modeless dialog.
50 // 56 //
51 Helpanel::Helpanel(const QString &kSource, QWidget *pParent, const char *kszName, bool bModal, WFlags Flags) 57 Helpanel::Helpanel(const QString &kSource, QWidget *pParent, const char *kszName, bool bModal, Qt::WFlags Flags)
52 : QDialog(pParent, kszName, bModal, Flags) 58 : QDialog(pParent, kszName, bModal, Flags)
53 { 59 {
54 // Boilerplate code to initialize the panel 60 // Boilerplate code to initialize the panel
55 if (!kszName) 61 if (!kszName)
56 this->setName("Helpanel"); 62 this->setName("Helpanel");
59 this->setSizeGripEnabled(true); 65 this->setSizeGripEnabled(true);
60 this->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5, 66 this->setSizePolicy(QSizePolicy((QSizePolicy::SizeType)5,
61 (QSizePolicy::SizeType)5, 0, 0, this->sizePolicy().hasHeightForWidth())); 67 (QSizePolicy::SizeType)5, 0, 0, this->sizePolicy().hasHeightForWidth()));
62 68
63 // Build panel using already constructed widgets and layouts 69 // Build panel using already constructed widgets and layouts
64 m_pFormlay = new QVBoxLayout(this, 11, 6, "Formlayout"); 70 m_pFormlay = new Q3VBoxLayout(this, 11, 6, "Formlayout");
65 71
66 // Groupbox and its text display 72 // Groupbox and its text display
67 m_pBrowser = new QTextBrowser(this, "Helpbrowser"); 73 m_pBrowser = new Q3TextBrowser(this, "Helpbrowser");
68 m_pBrowser->setSource(QString(TITRAQ_DOCDIR) + QChar('/') + kSource); 74 m_pBrowser->setSource(QString(TITRAQ_DOCDIR) + QChar('/') + kSource);
69 m_pBrowser->setReadOnly(true); 75 m_pBrowser->setReadOnly(true);
70 m_pBrowser->setFocus(); 76 m_pBrowser->setFocus();
71 77
72 // Add a spacer to sideline the otherwise massive dismiss button 78 // Add a spacer to sideline the otherwise massive dismiss button
73 m_pButtlay = new QHBoxLayout(0, 0, 6, "Buttonlayout"); 79 m_pButtlay = new Q3HBoxLayout(0, 0, 6, "Buttonlayout");
74 QSpacerItem *pSpacey = new QSpacerItem(40, 20, QSizePolicy::Minimum, QSizePolicy::Minimum); 80 QSpacerItem *pSpacey = new QSpacerItem(40, 20, QSizePolicy::Minimum, QSizePolicy::Minimum);
75 m_pButtlay->addItem(pSpacey); 81 m_pButtlay->addItem(pSpacey);
76 82
77 // Add dismiss push button 83 // Add dismiss push button
78 m_pDismissbutt = new QPushButton(this, "Dismissbutton"); 84 m_pDismissbutt = new QPushButton(this, "Dismissbutton");
99 this->setCaption(trUtf8("AS Accounting System help contents", "Help contents for the AS GUI application.")); 105 this->setCaption(trUtf8("AS Accounting System help contents", "Help contents for the AS GUI application."));
100 106
101 // Top level push buttons associated with accept and save slots 107 // Top level push buttons associated with accept and save slots
102 m_pDismissbutt->setText(trUtf8("Dismiss", "Comment for Dismissbutton")); 108 m_pDismissbutt->setText(trUtf8("Dismiss", "Comment for Dismissbutton"));
103 QToolTip::add(m_pDismissbutt, trUtf8("Closes the help panel", "Comment for tooltip Dismissbutton")); 109 QToolTip::add(m_pDismissbutt, trUtf8("Closes the help panel", "Comment for tooltip Dismissbutton"));
104 QWhatsThis::add(m_pDismissbutt, trUtf8("The dismiss button dismisses the help panel", "Comment for whatsThis Dismissbutton")); 110 Q3WhatsThis::add(m_pDismissbutt, trUtf8("The dismiss button dismisses the help panel", "Comment for whatsThis Dismissbutton"));
105 111
106 // The main text browser window which presents the HTML help contents 112 // The main text browser window which presents the HTML help contents
107 QWhatsThis::add(m_pBrowser, trUtf8("The text browser window displays the help contents", "Comment for whatsThis Browser")); 113 Q3WhatsThis::add(m_pBrowser, trUtf8("The text browser window displays the help contents", "Comment for whatsThis Browser"));
108 } 114 }
109 } // namespace AS 115 } // namespace AS

mercurial