Skip to content

Commit 27dddc5

Browse files
committed
packaged init
1 parent 66a12de commit 27dddc5

File tree

4 files changed

+133
-0
lines changed

4 files changed

+133
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/****************************************************************************
2+
**
3+
** Copyright (C) 2017 The Qt Company Ltd.
4+
** Contact: https://www.qt.io/licensing/
5+
**
6+
** This file is part of the FOO module of the Qt Toolkit.
7+
**
8+
** $QT_BEGIN_LICENSE:GPL-EXCEPT$
9+
** Commercial License Usage
10+
** Licensees holding valid commercial Qt licenses may use this file in
11+
** accordance with the commercial license agreement provided with the
12+
** Software or, alternatively, in accordance with the terms contained in
13+
** a written agreement between you and The Qt Company. For licensing terms
14+
** and conditions see https://www.qt.io/terms-conditions. For further
15+
** information use the contact form at https://www.qt.io/contact-us.
16+
**
17+
** GNU General Public License Usage
18+
** Alternatively, this file may be used under the terms of the GNU
19+
** General Public License version 3 as published by the Free Software
20+
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
21+
** included in the packaging of this file. Please review the following
22+
** information to ensure the GNU General Public License requirements will
23+
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
24+
**
25+
** $QT_END_LICENSE$
26+
**
27+
****************************************************************************/
28+
29+
function Component()
30+
{
31+
// constructor
32+
component.loaded.connect(this, Component.prototype.loaded);
33+
if (!installer.addWizardPage(component, "Page", QInstaller.TargetDirectory))
34+
console.log("Could not add the dynamic page.");
35+
}
36+
37+
Component.prototype.isDefault = function()
38+
{
39+
// select the component by default
40+
return true;
41+
}
42+
43+
Component.prototype.createOperations = function()
44+
{
45+
try {
46+
// call the base create operations function
47+
component.createOperations();
48+
} catch (e) {
49+
console.log(e);
50+
}
51+
}
52+
53+
Component.prototype.loaded = function ()
54+
{
55+
var page = gui.pageByObjectName("DynamicPage");
56+
if (page != null) {
57+
console.log("Connecting the dynamic page entered signal.");
58+
page.entered.connect(Component.prototype.dynamicPageEntered);
59+
}
60+
}
61+
62+
Component.prototype.dynamicPageEntered = function ()
63+
{
64+
var pageWidget = gui.pageWidgetByObjectName("DynamicPage");
65+
if (pageWidget != null) {
66+
console.log("Setting the widgets label text.")
67+
pageWidget.m_pageLabel.text = "This is a dynamically created page.";
68+
}
69+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Akshay Raj Gollahalli
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Package>
3+
<DisplayName>DataLogger</DisplayName>
4+
<Description>EEG/EMG data logger</Description>
5+
<Version>0.0.1</Version>
6+
<ReleaseDate>2021-08-18</ReleaseDate>
7+
<Licenses>
8+
<License name="MIT" file="license.txt" />
9+
</Licenses>
10+
<Default>script</Default>
11+
<Script>installscript.qs</Script>
12+
<UserInterfaces>
13+
<UserInterface>page.ui</UserInterface>
14+
</UserInterfaces>
15+
</Package>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>Page</class>
4+
<widget class="QWidget" name="Page">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>400</width>
10+
<height>300</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>Dynamic page example</string>
15+
</property>
16+
<layout class="QVBoxLayout" name="verticalLayout">
17+
<item>
18+
<widget class="QLabel" name="m_pageLabel">
19+
<property name="alignment">
20+
<set>Qt::AlignCenter</set>
21+
</property>
22+
</widget>
23+
</item>
24+
</layout>
25+
</widget>
26+
<resources/>
27+
<connections/>
28+
</ui>

0 commit comments

Comments
 (0)