Debian Codegraph @

examples/script/defaultprototypes/prototypes.cpp

raw symbols SCIP
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 examples of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:BSD$
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 ** BSD License Usage
18 ** Alternatively, you may use this file under the terms of the BSD license
19 ** as follows:
20 **
21 ** "Redistribution and use in source and binary forms, with or without
22 ** modification, are permitted provided that the following conditions are
23 ** met:
24 ** * Redistributions of source code must retain the above copyright
25 ** notice, this list of conditions and the following disclaimer.
26 ** * Redistributions in binary form must reproduce the above copyright
27 ** notice, this list of conditions and the following disclaimer in
28 ** the documentation and/or other materials provided with the
29 ** distribution.
30 ** * Neither the name of The Qt Company Ltd nor the names of its
31 ** contributors may be used to endorse or promote products derived
32 ** from this software without specific prior written permission.
33 **
34 **
35 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
36 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
37 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
38 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
39 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
42 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
43 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
44 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
45 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
46 **
47 ** $QT_END_LICENSE$
48 **
49 ****************************************************************************/
50
51 #include "prototypes.h"cxx . . $ `<file>/examples/script/defaultprototypes/prototypes.h`/
52 #include <QtWidgets/QListWidgetItem>
53 #include <QtWidgets/QListWidget>
54 #include <QtScript/QScriptValue>cxx . . $ `<file>/include/QtScript/QScriptValue`/
55 #include <QtScript/QScriptEngine>cxx . . $ `<file>/include/QtScript/QScriptEngine`/
56 #include <QDebug>
57
58 Q_DECLARE_METATYPEcxx . . $ `<external>/17491093664533580526/qmetatype.h:2056:9`!(QListWidgetItem*)
59 Q_DECLARE_METATYPEcxx . . $ `<external>/17491093664533580526/qmetatype.h:2056:9`!(QListWidget*)
60
61 //! [0]
62 ListWidgetItemPrototypecxx . . $ ListWidgetItemPrototype#::ListWidgetItemPrototypecxx . . $ ListWidgetItemPrototype#ListWidgetItemPrototype(749de1b6ae65bddd).(QObjectcxx . . $ QObject# *parent)
63 : QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent)
64 {
65 }
66
67 QStringcxx . . $ QString# ListWidgetItemPrototypecxx . . $ ListWidgetItemPrototype#::textcxx . . $ ListWidgetItemPrototype#text(6ef7b6c27b00b43d).() const
68 {
69 QListWidgetItemcxx . . $ QListWidgetItem# *item = qscriptvalue_castcxx . . $ qscriptvalue_cast(11c954240a7b88c6).<QListWidgetItemcxx . . $ QListWidgetItem#*>(thisObjectcxx . . $ QScriptable#thisObject(73013aefd0020d47).());
70 if (item)
71 return item->textcxx . . $ QListWidgetItem#text(6ef7b6c27b00b43d).();
72 return QStringcxx . . $ QString#QString(ced63f7c635d850d).();
73 }
74
75 void ListWidgetItemPrototypecxx . . $ ListWidgetItemPrototype#::setTextcxx . . $ ListWidgetItemPrototype#setText(3520e46b33348bf6).(const QStringcxx . . $ QString# &text)
76 {
77 QListWidgetItemcxx . . $ QListWidgetItem# *item = qscriptvalue_castcxx . . $ qscriptvalue_cast(11c954240a7b88c6).<QListWidgetItemcxx . . $ QListWidgetItem#*>(thisObjectcxx . . $ QScriptable#thisObject(73013aefd0020d47).());
78 if (item)
79 item->setTextcxx . . $ QListWidgetItem#setText(3520e46b33348bf6).(text);
80 }
81
82 QStringcxx . . $ QString# ListWidgetItemPrototypecxx . . $ ListWidgetItemPrototype#::toStringcxx . . $ ListWidgetItemPrototype#toString(6ef7b6c27b00b43d).() const
83 {
84 return QStringcxx . . $ QString#QString(85c52e162fed56f9).("ListWidgetItem(text = %0)").argcxx . . $ QString#arg(bc823072288cbbb5).(textcxx . . $ ListWidgetItemPrototype#text(6ef7b6c27b00b43d).());
85 }
86 //! [0]
87
88
89
90 //! [1]
91 ListWidgetPrototypecxx . . $ ListWidgetPrototype#::ListWidgetPrototypecxx . . $ ListWidgetPrototype#ListWidgetPrototype(749de1b6ae65bddd).(QObjectcxx . . $ QObject# *parent)
92 : QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(parent)
93 {
94 }
95
96 void ListWidgetPrototypecxx . . $ ListWidgetPrototype#::addItemcxx . . $ ListWidgetPrototype#addItem(3520e46b33348bf6).(const QStringcxx . . $ QString# &text)
97 {
98 QListWidgetcxx . . $ QListWidget# *widget = qscriptvalue_castcxx . . $ qscriptvalue_cast(11c954240a7b88c6).<QListWidgetcxx . . $ QListWidget#*>(thisObjectcxx . . $ QScriptable#thisObject(73013aefd0020d47).());
99 if (widget)
100 widget->addItemcxx . . $ QListWidget#addItem(3520e46b33348bf6).(text);
101 }
102
103 void ListWidgetPrototypecxx . . $ ListWidgetPrototype#::addItemscxx . . $ ListWidgetPrototype#addItems(631c0101495f0328).(const QStringListcxx . . $ QStringList# &texts)
104 {
105 QListWidgetcxx . . $ QListWidget# *widget = qscriptvalue_castcxx . . $ qscriptvalue_cast(11c954240a7b88c6).<QListWidgetcxx . . $ QListWidget#*>(thisObjectcxx . . $ QScriptable#thisObject(73013aefd0020d47).());
106 if (widget)
107 widget->addItemscxx . . $ QListWidget#addItems(631c0101495f0328).(texts);
108 }
109
110 void ListWidgetPrototypecxx . . $ ListWidgetPrototype#::setBackgroundColorcxx . . $ ListWidgetPrototype#setBackgroundColor(3520e46b33348bf6).(const QStringcxx . . $ QString# &colorName)
111 {
112 QListWidgetcxx . . $ QListWidget# *widget = qscriptvalue_castcxx . . $ qscriptvalue_cast(11c954240a7b88c6).<QListWidgetcxx . . $ QListWidget#*>(thisObjectcxx . . $ QScriptable#thisObject(73013aefd0020d47).());
113 if (widget) {
114 #ifdef Q_WS_MAEMO_5
115 QString style = QString("QListWidget::item {background-color: %1;}").arg(colorName);
116 style += "QListWidget::item {selection-color: black;}";
117 widget->setStyleSheet(style);
118 #else
119 QPalettecxx . . $ QPalette# palette = widgetcxx . . $ QPalette#QPalette(f826ed73d5553cd5).->palettecxx . . $ QWidget#palette(a7bd6a16d2c88209).();
120 QColorcxx . . $ QColor# colorcxx . . $ QColor#QColor(3520e46b33348bf6).(colorName);
121 palette.setBrushcxx . . $ QPalette#setBrush(3d16351d4a25c9ef).(QPalettecxx . . $ QPalette#::Basecxx . . $ QPalette#Base., colorcxx . . $ QBrush#QBrush(b50947b0752ea6ac).);
122 widget->setPalettecxx . . $ QWidget#setPalette(f826ed73d5553cd5).(palette);
123 #endif
124 }
125 }
126 //! [1]