dialogs/qdialog.cpp

Source codeSwitch to Preprocessed file
LineSource CodeCoverage
1/**************************************************************************** -
2** -
3** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -
4** Contact: http://www.qt-project.org/legal -
5** -
6** This file is part of the QtGui module of the Qt Toolkit. -
7** -
8** $QT_BEGIN_LICENSE:LGPL$ -
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 Digia. For licensing terms and -
14** conditions see http://qt.digia.com/licensing. For further information -
15** use the contact form at http://qt.digia.com/contact-us. -
16** -
17** GNU Lesser General Public License Usage -
18** Alternatively, this file may be used under the terms of the GNU Lesser -
19** General Public License version 2.1 as published by the Free Software -
20** Foundation and appearing in the file LICENSE.LGPL included in the -
21** packaging of this file. Please review the following information to -
22** ensure the GNU Lesser General Public License version 2.1 requirements -
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -
24** -
25** In addition, as a special exception, Digia gives you certain additional -
26** rights. These rights are described in the Digia Qt LGPL Exception -
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -
28** -
29** GNU General Public License Usage -
30** Alternatively, this file may be used under the terms of the GNU -
31** General Public License version 3.0 as published by the Free Software -
32** Foundation and appearing in the file LICENSE.GPL included in the -
33** packaging of this file. Please review the following information to -
34** ensure the GNU General Public License version 3.0 requirements will be -
35** met: http://www.gnu.org/copyleft/gpl.html. -
36** -
37** -
38** $QT_END_LICENSE$ -
39** -
40****************************************************************************/ -
41 -
42#include "qcolordialog.h" -
43#include "qfontdialog.h" -
44#include "qfiledialog.h" -
45 -
46#include "qevent.h" -
47#include "qdesktopwidget.h" -
48#include "qpushbutton.h" -
49#include "qapplication.h" -
50#include "qlayout.h" -
51#include "qsizegrip.h" -
52#include "qwhatsthis.h" -
53#include "qmenu.h" -
54#include "qcursor.h" -
55#include <qpa/qplatformtheme.h> -
56#include "private/qdialog_p.h" -
57#include "private/qguiapplication_p.h" -
58#ifndef QT_NO_ACCESSIBILITY -
59#include "qaccessible.h" -
60#endif -
61 -
62QT_BEGIN_NAMESPACE -
63 -
64static inline int themeDialogType(const QDialog *dialog) -
65{ -
66#ifndef QT_NO_FILEDIALOG -
67 if (qobject_cast<const QFileDialog *>(dialog))
evaluated: qobject_cast<const QFileDialog *>(dialog)
TRUEFALSE
yes
Evaluation Count:119
yes
Evaluation Count:5
5-119
68 return QPlatformTheme::FileDialog;
executed: return QPlatformTheme::FileDialog;
Execution Count:119
119
69#endif -
70#ifndef QT_NO_COLORDIALOG -
71 if (qobject_cast<const QColorDialog *>(dialog))
evaluated: qobject_cast<const QColorDialog *>(dialog)
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:2
2-3
72 return QPlatformTheme::ColorDialog;
executed: return QPlatformTheme::ColorDialog;
Execution Count:3
3
73#endif -
74#ifndef QT_NO_FONTDIALOG -
75 if (qobject_cast<const QFontDialog *>(dialog))
partially evaluated: qobject_cast<const QFontDialog *>(dialog)
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
76 return QPlatformTheme::FontDialog;
executed: return QPlatformTheme::FontDialog;
Execution Count:2
2
77#endif -
78 return -1;
never executed: return -1;
0
79} -
80 -
81QPlatformDialogHelper *QDialogPrivate::platformHelper() const -
82{ -
83 // Delayed creation of the platform, ensuring that -
84 // that qobject_cast<> on the dialog works in the plugin. -
85 if (!m_platformHelperCreated) {
evaluated: !m_platformHelperCreated
TRUEFALSE
yes
Evaluation Count:124
yes
Evaluation Count:10
10-124
86 m_platformHelperCreated = true;
executed (the execution status of this line is deduced): m_platformHelperCreated = true;
-
87 QDialogPrivate *ncThis = const_cast<QDialogPrivate *>(this);
executed (the execution status of this line is deduced): QDialogPrivate *ncThis = const_cast<QDialogPrivate *>(this);
-
88 QDialog *dialog = ncThis->q_func();
executed (the execution status of this line is deduced): QDialog *dialog = ncThis->q_func();
-
89 const int type = themeDialogType(dialog);
executed (the execution status of this line is deduced): const int type = themeDialogType(dialog);
-
90 if (type >= 0) {
partially evaluated: type >= 0
TRUEFALSE
yes
Evaluation Count:124
no
Evaluation Count:0
0-124
91 m_platformHelper = QGuiApplicationPrivate::platformTheme()
executed (the execution status of this line is deduced): m_platformHelper = QGuiApplicationPrivate::platformTheme()
-
92 ->createPlatformDialogHelper(static_cast<QPlatformTheme::DialogType>(type));
executed (the execution status of this line is deduced): ->createPlatformDialogHelper(static_cast<QPlatformTheme::DialogType>(type));
-
93 if (m_platformHelper) {
partially evaluated: m_platformHelper
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:124
0-124
94 QObject::connect(m_platformHelper, SIGNAL(accept()), dialog, SLOT(accept()));
never executed (the execution status of this line is deduced): QObject::connect(m_platformHelper, "2""accept()", dialog, "1""accept()");
-
95 QObject::connect(m_platformHelper, SIGNAL(reject()), dialog, SLOT(reject()));
never executed (the execution status of this line is deduced): QObject::connect(m_platformHelper, "2""reject()", dialog, "1""reject()");
-
96 ncThis->initHelper(m_platformHelper);
never executed (the execution status of this line is deduced): ncThis->initHelper(m_platformHelper);
-
97 }
never executed: }
0
98 }
executed: }
Execution Count:124
124
99 }
executed: }
Execution Count:124
124
100 return m_platformHelper;
executed: return m_platformHelper;
Execution Count:134
134
101} -
102 -
103QWindow *QDialogPrivate::parentWindow() const -
104{ -
105 if (const QWidget *parent = q_func()->nativeParentWidget())
never evaluated: const QWidget *parent = q_func()->nativeParentWidget()
0
106 return parent->windowHandle();
never executed: return parent->windowHandle();
0
107 return 0;
never executed: return 0;
0
108} -
109 -
110bool QDialogPrivate::setNativeDialogVisible(bool visible) -
111{ -
112 if (QPlatformDialogHelper *helper = platformHelper()) {
partially evaluated: QPlatformDialogHelper *helper = platformHelper()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8
0-8
113 if (visible) {
never evaluated: visible
0
114 Q_Q(QDialog);
never executed (the execution status of this line is deduced): QDialog * const q = q_func();
-
115 helperPrepareShow(helper);
never executed (the execution status of this line is deduced): helperPrepareShow(helper);
-
116 nativeDialogInUse = helper->show(q->windowFlags(), q->windowModality(), parentWindow());
never executed (the execution status of this line is deduced): nativeDialogInUse = helper->show(q->windowFlags(), q->windowModality(), parentWindow());
-
117 } else {
never executed: }
0
118 helper->hide();
never executed (the execution status of this line is deduced): helper->hide();
-
119 }
never executed: }
0
120 } -
121 return nativeDialogInUse;
executed: return nativeDialogInUse;
Execution Count:8
8
122} -
123 -
124QVariant QDialogPrivate::styleHint(QPlatformDialogHelper::StyleHint hint) const -
125{ -
126 if (const QPlatformDialogHelper *helper = platformHelper())
never evaluated: const QPlatformDialogHelper *helper = platformHelper()
0
127 return helper->styleHint(hint);
never executed: return helper->styleHint(hint);
0
128 return QPlatformDialogHelper::defaultStyleHint(hint);
never executed: return QPlatformDialogHelper::defaultStyleHint(hint);
0
129} -
130 -
131void QDialogPrivate::deletePlatformHelper() -
132{ -
133 delete m_platformHelper;
executed (the execution status of this line is deduced): delete m_platformHelper;
-
134 m_platformHelper = 0;
executed (the execution status of this line is deduced): m_platformHelper = 0;
-
135 m_platformHelperCreated = false;
executed (the execution status of this line is deduced): m_platformHelperCreated = false;
-
136 nativeDialogInUse = false;
executed (the execution status of this line is deduced): nativeDialogInUse = false;
-
137}
executed: }
Execution Count:133
133
138 -
139/*! -
140 \class QDialog -
141 \brief The QDialog class is the base class of dialog windows. -
142 -
143 \ingroup dialog-classes -
144 \ingroup abstractwidgets -
145 \inmodule QtWidgets -
146 -
147 A dialog window is a top-level window mostly used for short-term -
148 tasks and brief communications with the user. QDialogs may be -
149 modal or modeless. QDialogs can -
150 provide a \l{#return}{return value}, and they can have \l{#default}{default buttons}. QDialogs can also have a QSizeGrip in their -
151 lower-right corner, using setSizeGripEnabled(). -
152 -
153 Note that QDialog (an any other widget that has type Qt::Dialog) uses -
154 the parent widget slightly differently from other classes in Qt. A -
155 dialog is always a top-level widget, but if it has a parent, its -
156 default location is centered on top of the parent's top-level widget -
157 (if it is not top-level itself). It will also share the parent's -
158 taskbar entry. -
159 -
160 Use the overload of the QWidget::setParent() function to change -
161 the ownership of a QDialog widget. This function allows you to -
162 explicitly set the window flags of the reparented widget; using -
163 the overloaded function will clear the window flags specifying the -
164 window-system properties for the widget (in particular it will -
165 reset the Qt::Dialog flag). -
166 -
167 \section1 Modal Dialogs -
168 -
169 A \b{modal} dialog is a dialog that blocks input to other -
170 visible windows in the same application. Dialogs that are used to -
171 request a file name from the user or that are used to set -
172 application preferences are usually modal. Dialogs can be -
173 \l{Qt::ApplicationModal}{application modal} (the default) or -
174 \l{Qt::WindowModal}{window modal}. -
175 -
176 When an application modal dialog is opened, the user must finish -
177 interacting with the dialog and close it before they can access -
178 any other window in the application. Window modal dialogs only -
179 block access to the window associated with the dialog, allowing -
180 the user to continue to use other windows in an application. -
181 -
182 The most common way to display a modal dialog is to call its -
183 exec() function. When the user closes the dialog, exec() will -
184 provide a useful \l{#return}{return value}. Typically, -
185 to get the dialog to close and return the appropriate value, we -
186 connect a default button, e.g. \uicontrol OK, to the accept() slot and a -
187 \uicontrol Cancel button to the reject() slot. -
188 Alternatively you can call the done() slot with \c Accepted or -
189 \c Rejected. -
190 -
191 An alternative is to call setModal(true) or setWindowModality(), -
192 then show(). Unlike exec(), show() returns control to the caller -
193 immediately. Calling setModal(true) is especially useful for -
194 progress dialogs, where the user must have the ability to interact -
195 with the dialog, e.g. to cancel a long running operation. If you -
196 use show() and setModal(true) together to perform a long operation, -
197 you must call QApplication::processEvents() periodically during -
198 processing to enable the user to interact with the dialog. (See -
199 QProgressDialog.) -
200 -
201 \section1 Modeless Dialogs -
202 -
203 A \b{modeless} dialog is a dialog that operates -
204 independently of other windows in the same application. Find and -
205 replace dialogs in word-processors are often modeless to allow the -
206 user to interact with both the application's main window and with -
207 the dialog. -
208 -
209 Modeless dialogs are displayed using show(), which returns control -
210 to the caller immediately. -
211 -
212 If you invoke the \l{QWidget::show()}{show()} function after hiding -
213 a dialog, the dialog will be displayed in its original position. This is -
214 because the window manager decides the position for windows that -
215 have not been explicitly placed by the programmer. To preserve the -
216 position of a dialog that has been moved by the user, save its position -
217 in your \l{QWidget::closeEvent()}{closeEvent()} handler and then -
218 move the dialog to that position, before showing it again. -
219 -
220 \target default -
221 \section1 Default Button -
222 -
223 A dialog's \e default button is the button that's pressed when the -
224 user presses Enter (Return). This button is used to signify that -
225 the user accepts the dialog's settings and wants to close the -
226 dialog. Use QPushButton::setDefault(), QPushButton::isDefault() -
227 and QPushButton::autoDefault() to set and control the dialog's -
228 default button. -
229 -
230 \target escapekey -
231 \section1 Escape Key -
232 -
233 If the user presses the Esc key in a dialog, QDialog::reject() -
234 will be called. This will cause the window to close: The \l{QCloseEvent}{close event} cannot be \l{QCloseEvent::ignore()}{ignored}. -
235 -
236 \section1 Extensibility -
237 -
238 Extensibility is the ability to show the dialog in two ways: a -
239 partial dialog that shows the most commonly used options, and a -
240 full dialog that shows all the options. Typically an extensible -
241 dialog will initially appear as a partial dialog, but with a -
242 \uicontrol More toggle button. If the user presses the \uicontrol More button down, -
243 the dialog is expanded. The \l{Extension Example} shows how to achieve -
244 extensible dialogs using Qt. -
245 -
246 \target return -
247 \section1 Return Value (Modal Dialogs) -
248 -
249 Modal dialogs are often used in situations where a return value is -
250 required, e.g. to indicate whether the user pressed \uicontrol OK or -
251 \uicontrol Cancel. A dialog can be closed by calling the accept() or the -
252 reject() slots, and exec() will return \c Accepted or \c Rejected -
253 as appropriate. The exec() call returns the result of the dialog. -
254 The result is also available from result() if the dialog has not -
255 been destroyed. -
256 -
257 In order to modify your dialog's close behavior, you can reimplement -
258 the functions accept(), reject() or done(). The -
259 \l{QWidget::closeEvent()}{closeEvent()} function should only be -
260 reimplemented to preserve the dialog's position or to override the -
261 standard close or reject behavior. -
262 -
263 \target examples -
264 \section1 Code Examples -
265 -
266 A modal dialog: -
267 -
268 \snippet dialogs/dialogs.cpp 1 -
269 -
270 A modeless dialog: -
271 -
272 \snippet dialogs/dialogs.cpp 0 -
273 -
274 \sa QDialogButtonBox, QTabWidget, QWidget, QProgressDialog, -
275 {fowler}{GUI Design Handbook: Dialogs, Standard}, {Extension Example}, -
276 {Standard Dialogs Example} -
277*/ -
278 -
279/*! \enum QDialog::DialogCode -
280 -
281 The value returned by a modal dialog. -
282 -
283 \value Accepted -
284 \value Rejected -
285*/ -
286 -
287/*! -
288 \property QDialog::sizeGripEnabled -
289 \brief whether the size grip is enabled -
290 -
291 A QSizeGrip is placed in the bottom-right corner of the dialog when this -
292 property is enabled. By default, the size grip is disabled. -
293*/ -
294 -
295 -
296/*! -
297 Constructs a dialog with parent \a parent. -
298 -
299 A dialog is always a top-level widget, but if it has a parent, its -
300 default location is centered on top of the parent. It will also -
301 share the parent's taskbar entry. -
302 -
303 The widget flags \a f are passed on to the QWidget constructor. -
304 If, for example, you don't want a What's This button in the title bar -
305 of the dialog, pass Qt::WindowTitleHint | Qt::WindowSystemMenuHint in \a f. -
306 -
307 \sa QWidget::setWindowFlags() -
308*/ -
309 -
310QDialog::QDialog(QWidget *parent, Qt::WindowFlags f) -
311 : QWidget(*new QDialogPrivate, parent, -
312 f | ((f & Qt::WindowType_Mask) == 0 ? Qt::Dialog : Qt::WindowType(0))) -
313{ -
314}
executed: }
Execution Count:41
41
315 -
316/*! -
317 \overload -
318 \internal -
319*/ -
320QDialog::QDialog(QDialogPrivate &dd, QWidget *parent, Qt::WindowFlags f) -
321 : QWidget(dd, parent, f | ((f & Qt::WindowType_Mask) == 0 ? Qt::Dialog : Qt::WindowType(0))) -
322{ -
323}
executed: }
Execution Count:266
266
324 -
325/*! -
326 Destroys the QDialog, deleting all its children. -
327*/ -
328 -
329QDialog::~QDialog() -
330{ -
331 QT_TRY {
partially evaluated: true
TRUEFALSE
yes
Evaluation Count:304
no
Evaluation Count:0
0-304
332 // Need to hide() here, as our (to-be) overridden hide() -
333 // will not be called in ~QWidget. -
334 hide();
executed (the execution status of this line is deduced): hide();
-
335 } QT_CATCH(...) {
executed: }
Execution Count:304
304
336 // we're in the destructor - just swallow the exception -
337 }
never executed: }
0
338} -
339 -
340/*! -
341 \internal -
342 This function is called by the push button \a pushButton when it -
343 becomes the default button. If \a pushButton is 0, the dialogs -
344 default default button becomes the default button. This is what a -
345 push button calls when it loses focus. -
346*/ -
347void QDialogPrivate::setDefault(QPushButton *pushButton) -
348{ -
349 Q_Q(QDialog);
executed (the execution status of this line is deduced): QDialog * const q = q_func();
-
350 bool hasMain = false;
executed (the execution status of this line is deduced): bool hasMain = false;
-
351 QList<QPushButton*> list = q->findChildren<QPushButton*>();
executed (the execution status of this line is deduced): QList<QPushButton*> list = q->findChildren<QPushButton*>();
-
352 for (int i=0; i<list.size(); ++i) {
evaluated: i<list.size()
TRUEFALSE
yes
Evaluation Count:1960
yes
Evaluation Count:501
501-1960
353 QPushButton *pb = list.at(i);
executed (the execution status of this line is deduced): QPushButton *pb = list.at(i);
-
354 if (pb->window() == q) {
partially evaluated: pb->window() == q
TRUEFALSE
yes
Evaluation Count:1960
no
Evaluation Count:0
0-1960
355 if (pb == mainDef)
evaluated: pb == mainDef
TRUEFALSE
yes
Evaluation Count:84
yes
Evaluation Count:1876
84-1876
356 hasMain = true;
executed: hasMain = true;
Execution Count:84
84
357 if (pb != pushButton)
evaluated: pb != pushButton
TRUEFALSE
yes
Evaluation Count:1533
yes
Evaluation Count:427
427-1533
358 pb->setDefault(false);
executed: pb->setDefault(false);
Execution Count:1533
1533
359 }
executed: }
Execution Count:1960
1960
360 }
executed: }
Execution Count:1960
1960
361 if (!pushButton && hasMain)
evaluated: !pushButton
TRUEFALSE
yes
Evaluation Count:74
yes
Evaluation Count:427
partially evaluated: hasMain
TRUEFALSE
yes
Evaluation Count:74
no
Evaluation Count:0
0-427
362 mainDef->setDefault(true);
executed: mainDef->setDefault(true);
Execution Count:74
74
363 if (!hasMain)
evaluated: !hasMain
TRUEFALSE
yes
Evaluation Count:417
yes
Evaluation Count:84
84-417
364 mainDef = pushButton;
executed: mainDef = pushButton;
Execution Count:417
417
365}
executed: }
Execution Count:501
501
366 -
367/*! -
368 \internal -
369 This function sets the default default push button to \a pushButton. -
370 This function is called by QPushButton::setDefault(). -
371*/ -
372void QDialogPrivate::setMainDefault(QPushButton *pushButton) -
373{ -
374 mainDef = 0;
executed (the execution status of this line is deduced): mainDef = 0;
-
375 setDefault(pushButton);
executed (the execution status of this line is deduced): setDefault(pushButton);
-
376}
executed: }
Execution Count:415
415
377 -
378/*! -
379 \internal -
380 Hides the default button indicator. Called when non auto-default -
381 push button get focus. -
382 */ -
383void QDialogPrivate::hideDefault() -
384{ -
385 Q_Q(QDialog);
never executed (the execution status of this line is deduced): QDialog * const q = q_func();
-
386 QList<QPushButton*> list = q->findChildren<QPushButton*>();
never executed (the execution status of this line is deduced): QList<QPushButton*> list = q->findChildren<QPushButton*>();
-
387 for (int i=0; i<list.size(); ++i) {
never evaluated: i<list.size()
0
388 list.at(i)->setDefault(false);
never executed (the execution status of this line is deduced): list.at(i)->setDefault(false);
-
389 }
never executed: }
0
390}
never executed: }
0
391 -
392void QDialogPrivate::resetModalitySetByOpen() -
393{ -
394 Q_Q(QDialog);
executed (the execution status of this line is deduced): QDialog * const q = q_func();
-
395 if (resetModalityTo != -1 && !q->testAttribute(Qt::WA_SetWindowModality)) {
partially evaluated: resetModalityTo != -1
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:201
never evaluated: !q->testAttribute(Qt::WA_SetWindowModality)
0-201
396 // open() changed the window modality and the user didn't touch it afterwards; restore it -
397 q->setWindowModality(Qt::WindowModality(resetModalityTo));
never executed (the execution status of this line is deduced): q->setWindowModality(Qt::WindowModality(resetModalityTo));
-
398 q->setAttribute(Qt::WA_SetWindowModality, wasModalitySet);
never executed (the execution status of this line is deduced): q->setAttribute(Qt::WA_SetWindowModality, wasModalitySet);
-
399#ifdef Q_OS_MAC -
400 Q_ASSERT(resetModalityTo != Qt::WindowModal); -
401 q->setParent(q->parentWidget(), Qt::Dialog); -
402#endif -
403 }
never executed: }
0
404 resetModalityTo = -1;
executed (the execution status of this line is deduced): resetModalityTo = -1;
-
405}
executed: }
Execution Count:201
201
406 -
407#if defined(Q_OS_WINCE) -
408#ifdef Q_OS_WINCE_WM -
409void QDialogPrivate::_q_doneAction() -
410{ -
411 //Done... -
412 QApplication::postEvent(q_func(), new QEvent(QEvent::OkRequest)); -
413} -
414#endif -
415 -
416/*! -
417 \reimp -
418*/ -
419bool QDialog::event(QEvent *e) -
420{ -
421 bool result = QWidget::event(e); -
422#ifdef Q_OS_WINCE -
423 if (e->type() == QEvent::OkRequest) { -
424 accept(); -
425 result = true; -
426 } -
427#endif -
428 return result; -
429} -
430#endif -
431 -
432/*! -
433 In general returns the modal dialog's result code, \c Accepted or -
434 \c Rejected. -
435 -
436 \note When called on a QMessageBox instance, the returned value is a -
437 value of the \l QMessageBox::StandardButton enum. -
438 -
439 Do not call this function if the dialog was constructed with the -
440 Qt::WA_DeleteOnClose attribute. -
441*/ -
442int QDialog::result() const -
443{ -
444 Q_D(const QDialog);
executed (the execution status of this line is deduced): const QDialogPrivate * const d = d_func();
-
445 return d->rescode;
executed: return d->rescode;
Execution Count:96
96
446} -
447 -
448/*! -
449 \fn void QDialog::setResult(int i) -
450 -
451 Sets the modal dialog's result code to \a i. -
452 -
453 \note We recommend that you use one of the values defined by -
454 QDialog::DialogCode. -
455*/ -
456void QDialog::setResult(int r) -
457{ -
458 Q_D(QDialog);
executed (the execution status of this line is deduced): QDialogPrivate * const d = d_func();
-
459 d->rescode = r;
executed (the execution status of this line is deduced): d->rescode = r;
-
460}
executed: }
Execution Count:218
218
461 -
462/*! -
463 \since 4.5 -
464 -
465 Shows the dialog as a \l{QDialog#Modal Dialogs}{window modal dialog}, -
466 returning immediately. -
467 -
468 \sa exec(), show(), result(), setWindowModality() -
469*/ -
470void QDialog::open() -
471{ -
472 Q_D(QDialog);
executed (the execution status of this line is deduced): QDialogPrivate * const d = d_func();
-
473 -
474 Qt::WindowModality modality = windowModality();
executed (the execution status of this line is deduced): Qt::WindowModality modality = windowModality();
-
475 if (modality != Qt::WindowModal) {
partially evaluated: modality != Qt::WindowModal
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
476 d->resetModalityTo = modality;
executed (the execution status of this line is deduced): d->resetModalityTo = modality;
-
477 d->wasModalitySet = testAttribute(Qt::WA_SetWindowModality);
executed (the execution status of this line is deduced): d->wasModalitySet = testAttribute(Qt::WA_SetWindowModality);
-
478 setWindowModality(Qt::WindowModal);
executed (the execution status of this line is deduced): setWindowModality(Qt::WindowModal);
-
479 setAttribute(Qt::WA_SetWindowModality, false);
executed (the execution status of this line is deduced): setAttribute(Qt::WA_SetWindowModality, false);
-
480#ifdef Q_OS_MAC -
481 setParent(parentWidget(), Qt::Sheet); -
482#endif -
483 }
executed: }
Execution Count:1
1
484 -
485 setResult(0);
executed (the execution status of this line is deduced): setResult(0);
-
486 show();
executed (the execution status of this line is deduced): show();
-
487}
executed: }
Execution Count:1
1
488 -
489/*! -
490 Shows the dialog as a \l{QDialog#Modal Dialogs}{modal dialog}, -
491 blocking until the user closes it. The function returns a \l -
492 DialogCode result. -
493 -
494 If the dialog is \l{Qt::ApplicationModal}{application modal}, users cannot -
495 interact with any other window in the same application until they close -
496 the dialog. If the dialog is \l{Qt::ApplicationModal}{window modal}, only -
497 interaction with the parent window is blocked while the dialog is open. -
498 By default, the dialog is application modal. -
499 -
500 \sa open(), show(), result(), setWindowModality() -
501*/ -
502 -
503int QDialog::exec() -
504{ -
505 Q_D(QDialog);
executed (the execution status of this line is deduced): QDialogPrivate * const d = d_func();
-
506 -
507 if (d->eventLoop) {
partially evaluated: d->eventLoop
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:94
0-94
508 qWarning("QDialog::exec: Recursive call detected");
never executed (the execution status of this line is deduced): QMessageLogger("dialogs/qdialog.cpp", 508, __PRETTY_FUNCTION__).warning("QDialog::exec: Recursive call detected");
-
509 return -1;
never executed: return -1;
0
510 } -
511 -
512 bool deleteOnClose = testAttribute(Qt::WA_DeleteOnClose);
executed (the execution status of this line is deduced): bool deleteOnClose = testAttribute(Qt::WA_DeleteOnClose);
-
513 setAttribute(Qt::WA_DeleteOnClose, false);
executed (the execution status of this line is deduced): setAttribute(Qt::WA_DeleteOnClose, false);
-
514 -
515 d->resetModalitySetByOpen();
executed (the execution status of this line is deduced): d->resetModalitySetByOpen();
-
516 -
517 bool wasShowModal = testAttribute(Qt::WA_ShowModal);
executed (the execution status of this line is deduced): bool wasShowModal = testAttribute(Qt::WA_ShowModal);
-
518 setAttribute(Qt::WA_ShowModal, true);
executed (the execution status of this line is deduced): setAttribute(Qt::WA_ShowModal, true);
-
519 setResult(0);
executed (the execution status of this line is deduced): setResult(0);
-
520 -
521 show();
executed (the execution status of this line is deduced): show();
-
522 -
523 QPointer<QDialog> guard = this;
executed (the execution status of this line is deduced): QPointer<QDialog> guard = this;
-
524 if (d->nativeDialogInUse) {
partially evaluated: d->nativeDialogInUse
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:94
0-94
525 d->platformHelper()->exec();
never executed (the execution status of this line is deduced): d->platformHelper()->exec();
-
526 } else {
never executed: }
0
527 QEventLoop eventLoop;
executed (the execution status of this line is deduced): QEventLoop eventLoop;
-
528 d->eventLoop = &eventLoop;
executed (the execution status of this line is deduced): d->eventLoop = &eventLoop;
-
529 (void) eventLoop.exec(QEventLoop::DialogExec);
executed (the execution status of this line is deduced): (void) eventLoop.exec(QEventLoop::DialogExec);
-
530 }
executed: }
Execution Count:94
94
531 if (guard.isNull())
evaluated: guard.isNull()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:93
1-93
532 return QDialog::Rejected;
executed: return QDialog::Rejected;
Execution Count:1
1
533 d->eventLoop = 0;
executed (the execution status of this line is deduced): d->eventLoop = 0;
-
534 -
535 setAttribute(Qt::WA_ShowModal, wasShowModal);
executed (the execution status of this line is deduced): setAttribute(Qt::WA_ShowModal, wasShowModal);
-
536 -
537 int res = result();
executed (the execution status of this line is deduced): int res = result();
-
538 if (d->nativeDialogInUse)
partially evaluated: d->nativeDialogInUse
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:93
0-93
539 d->helperDone(static_cast<QDialog::DialogCode>(res), d->platformHelper());
never executed: d->helperDone(static_cast<QDialog::DialogCode>(res), d->platformHelper());
0
540 if (deleteOnClose)
evaluated: deleteOnClose
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:91
2-91
541 delete this;
executed: delete this;
Execution Count:2
2
542 return res;
executed: return res;
Execution Count:93
93
543} -
544 -
545/*! -
546 Closes the dialog and sets its result code to \a r. If this dialog -
547 is shown with exec(), done() causes the local event loop to finish, -
548 and exec() to return \a r. -
549 -
550 As with QWidget::close(), done() deletes the dialog if the -
551 Qt::WA_DeleteOnClose flag is set. If the dialog is the application's -
552 main widget, the application terminates. If the dialog is the -
553 last window closed, the QApplication::lastWindowClosed() signal is -
554 emitted. -
555 -
556 \sa accept(), reject(), QApplication::activeWindow(), QApplication::quit() -
557*/ -
558 -
559void QDialog::done(int r) -
560{ -
561 Q_D(QDialog);
executed (the execution status of this line is deduced): QDialogPrivate * const d = d_func();
-
562 hide();
executed (the execution status of this line is deduced): hide();
-
563 setResult(r);
executed (the execution status of this line is deduced): setResult(r);
-
564 -
565 d->close_helper(QWidgetPrivate::CloseNoEvent);
executed (the execution status of this line is deduced): d->close_helper(QWidgetPrivate::CloseNoEvent);
-
566 d->resetModalitySetByOpen();
executed (the execution status of this line is deduced): d->resetModalitySetByOpen();
-
567 -
568 emit finished(r);
executed (the execution status of this line is deduced): finished(r);
-
569 if (r == Accepted)
evaluated: r == Accepted
TRUEFALSE
yes
Evaluation Count:50
yes
Evaluation Count:57
50-57
570 emit accepted();
executed: accepted();
Execution Count:50
50
571 else if (r == Rejected)
evaluated: r == Rejected
TRUEFALSE
yes
Evaluation Count:28
yes
Evaluation Count:29
28-29
572 emit rejected();
executed: rejected();
Execution Count:28
28
573} -
574 -
575/*! -
576 Hides the modal dialog and sets the result code to \c Accepted. -
577 -
578 \sa reject(), done() -
579*/ -
580 -
581void QDialog::accept() -
582{ -
583 done(Accepted);
executed (the execution status of this line is deduced): done(Accepted);
-
584}
executed: }
Execution Count:18
18
585 -
586/*! -
587 Hides the modal dialog and sets the result code to \c Rejected. -
588 -
589 \sa accept(), done() -
590*/ -
591 -
592void QDialog::reject() -
593{ -
594 done(Rejected);
executed (the execution status of this line is deduced): done(Rejected);
-
595}
executed: }
Execution Count:26
26
596 -
597/*! \reimp */ -
598bool QDialog::eventFilter(QObject *o, QEvent *e) -
599{ -
600 return QWidget::eventFilter(o, e);
executed: return QWidget::eventFilter(o, e);
Execution Count:153
153
601} -
602 -
603/***************************************************************************** -
604 Event handlers -
605 *****************************************************************************/ -
606 -
607#ifndef QT_NO_CONTEXTMENU -
608/*! \reimp */ -
609void QDialog::contextMenuEvent(QContextMenuEvent *e) -
610{ -
611#if defined(QT_NO_WHATSTHIS) || defined(QT_NO_MENU) -
612 Q_UNUSED(e); -
613#else -
614 QWidget *w = childAt(e->pos());
never executed (the execution status of this line is deduced): QWidget *w = childAt(e->pos());
-
615 if (!w) {
never evaluated: !w
0
616 w = rect().contains(e->pos()) ? this : 0;
never evaluated: rect().contains(e->pos())
0
617 if (!w)
never evaluated: !w
0
618 return;
never executed: return;
0
619 }
never executed: }
0
620 while (w && w->whatsThis().size() == 0 && !w->testAttribute(Qt::WA_CustomWhatsThis))
never evaluated: w
never evaluated: w->whatsThis().size() == 0
never evaluated: !w->testAttribute(Qt::WA_CustomWhatsThis)
0
621 w = w->isWindow() ? 0 : w->parentWidget();
never executed: w = w->isWindow() ? 0 : w->parentWidget();
never evaluated: w->isWindow()
0
622 if (w) {
never evaluated: w
0
623 QPointer<QMenu> p = new QMenu(this);
never executed (the execution status of this line is deduced): QPointer<QMenu> p = new QMenu(this);
-
624 QAction *wt = p.data()->addAction(tr("What's This?"));
never executed (the execution status of this line is deduced): QAction *wt = p.data()->addAction(tr("What's This?"));
-
625 if (p.data()->exec(e->globalPos()) == wt) {
never evaluated: p.data()->exec(e->globalPos()) == wt
0
626 QHelpEvent e(QEvent::WhatsThis, w->rect().center(),
never executed (the execution status of this line is deduced): QHelpEvent e(QEvent::WhatsThis, w->rect().center(),
-
627 w->mapToGlobal(w->rect().center()));
never executed (the execution status of this line is deduced): w->mapToGlobal(w->rect().center()));
-
628 QApplication::sendEvent(w, &e);
never executed (the execution status of this line is deduced): QApplication::sendEvent(w, &e);
-
629 }
never executed: }
0
630 delete p.data();
never executed (the execution status of this line is deduced): delete p.data();
-
631 }
never executed: }
0
632#endif -
633}
never executed: }
0
634#endif // QT_NO_CONTEXTMENU -
635 -
636/*! \reimp */ -
637void QDialog::keyPressEvent(QKeyEvent *e) -
638{ -
639 // Calls reject() if Escape is pressed. Simulates a button -
640 // click for the default button if Enter is pressed. Move focus -
641 // for the arrow keys. Ignore the rest. -
642#ifdef Q_OS_MAC -
643 if(e->modifiers() == Qt::ControlModifier && e->key() == Qt::Key_Period) { -
644 reject(); -
645 } else -
646#endif -
647 if (!e->modifiers() || (e->modifiers() & Qt::KeypadModifier && e->key() == Qt::Key_Enter)) {
partially evaluated: !e->modifiers()
TRUEFALSE
yes
Evaluation Count:33
no
Evaluation Count:0
never evaluated: e->modifiers() & Qt::KeypadModifier
never evaluated: e->key() == Qt::Key_Enter
0-33
648 switch (e->key()) { -
649 case Qt::Key_Enter: -
650 case Qt::Key_Return: { -
651 QList<QPushButton*> list = findChildren<QPushButton*>();
executed (the execution status of this line is deduced): QList<QPushButton*> list = findChildren<QPushButton*>();
-
652 for (int i=0; i<list.size(); ++i) {
partially evaluated: i<list.size()
TRUEFALSE
yes
Evaluation Count:43
no
Evaluation Count:0
0-43
653 QPushButton *pb = list.at(i);
executed (the execution status of this line is deduced): QPushButton *pb = list.at(i);
-
654 if (pb->isDefault() && pb->isVisible()) {
evaluated: pb->isDefault()
TRUEFALSE
yes
Evaluation Count:28
yes
Evaluation Count:15
partially evaluated: pb->isVisible()
TRUEFALSE
yes
Evaluation Count:28
no
Evaluation Count:0
0-28
655 if (pb->isEnabled())
partially evaluated: pb->isEnabled()
TRUEFALSE
yes
Evaluation Count:28
no
Evaluation Count:0
0-28
656 pb->click();
executed: pb->click();
Execution Count:28
28
657 return;
executed: return;
Execution Count:28
28
658 } -
659 }
executed: }
Execution Count:15
15
660 } -
661 break;
never executed: break;
0
662 case Qt::Key_Escape: -
663 reject();
never executed (the execution status of this line is deduced): reject();
-
664 break;
never executed: break;
0
665 default: -
666 e->ignore();
executed (the execution status of this line is deduced): e->ignore();
-
667 return;
executed: return;
Execution Count:5
5
668 } -
669 } else {
never executed: }
0
670 e->ignore();
never executed (the execution status of this line is deduced): e->ignore();
-
671 }
never executed: }
0
672} -
673 -
674/*! \reimp */ -
675void QDialog::closeEvent(QCloseEvent *e) -
676{ -
677#ifndef QT_NO_WHATSTHIS -
678 if (isModal() && QWhatsThis::inWhatsThisMode())
evaluated: isModal()
TRUEFALSE
yes
Evaluation Count:15
yes
Evaluation Count:10
partially evaluated: QWhatsThis::inWhatsThisMode()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:15
0-15
679 QWhatsThis::leaveWhatsThisMode();
never executed: QWhatsThis::leaveWhatsThisMode();
0
680#endif -
681 if (isVisible()) {
partially evaluated: isVisible()
TRUEFALSE
yes
Evaluation Count:25
no
Evaluation Count:0
0-25
682 QPointer<QObject> that = this;
executed (the execution status of this line is deduced): QPointer<QObject> that = this;
-
683 reject();
executed (the execution status of this line is deduced): reject();
-
684 if (that && isVisible())
partially evaluated: that
TRUEFALSE
yes
Evaluation Count:25
no
Evaluation Count:0
evaluated: isVisible()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:24
0-25
685 e->ignore();
executed: e->ignore();
Execution Count:1
1
686 } else {
executed: }
Execution Count:25
25
687 e->accept();
never executed (the execution status of this line is deduced): e->accept();
-
688 }
never executed: }
0
689} -
690 -
691/***************************************************************************** -
692 Geometry management. -
693 *****************************************************************************/ -
694 -
695/*! \reimp -
696*/ -
697 -
698void QDialog::setVisible(bool visible) -
699{ -
700 Q_D(QDialog);
executed (the execution status of this line is deduced): QDialogPrivate * const d = d_func();
-
701 if (visible) {
evaluated: visible
TRUEFALSE
yes
Evaluation Count:219
yes
Evaluation Count:431
219-431
702 if (testAttribute(Qt::WA_WState_ExplicitShowHide) && !testAttribute(Qt::WA_WState_Hidden))
evaluated: testAttribute(Qt::WA_WState_ExplicitShowHide)
TRUEFALSE
yes
Evaluation Count:38
yes
Evaluation Count:181
evaluated: !testAttribute(Qt::WA_WState_Hidden)
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:30
8-181
703 return;
executed: return;
Execution Count:8
8
704 -
705 if (!testAttribute(Qt::WA_Moved)) {
evaluated: !testAttribute(Qt::WA_Moved)
TRUEFALSE
yes
Evaluation Count:209
yes
Evaluation Count:2
2-209
706 Qt::WindowStates state = windowState();
executed (the execution status of this line is deduced): Qt::WindowStates state = windowState();
-
707 adjustPosition(parentWidget());
executed (the execution status of this line is deduced): adjustPosition(parentWidget());
-
708 setAttribute(Qt::WA_Moved, false); // not really an explicit position
executed (the execution status of this line is deduced): setAttribute(Qt::WA_Moved, false);
-
709 if (state != windowState())
partially evaluated: state != windowState()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:209
0-209
710 setWindowState(state);
never executed: setWindowState(state);
0
711 }
executed: }
Execution Count:209
209
712 QWidget::setVisible(visible);
executed (the execution status of this line is deduced): QWidget::setVisible(visible);
-
713 showExtension(d->doShowExtension);
executed (the execution status of this line is deduced): showExtension(d->doShowExtension);
-
714 QWidget *fw = window()->focusWidget();
executed (the execution status of this line is deduced): QWidget *fw = window()->focusWidget();
-
715 if (!fw)
evaluated: !fw
TRUEFALSE
yes
Evaluation Count:73
yes
Evaluation Count:138
73-138
716 fw = this;
executed: fw = this;
Execution Count:73
73
717 -
718 /* -
719 The following block is to handle a special case, and does not -
720 really follow propper logic in concern of autoDefault and TAB -
721 order. However, it's here to ease usage for the users. If a -
722 dialog has a default QPushButton, and first widget in the TAB -
723 order also is a QPushButton, then we give focus to the main -
724 default QPushButton. This simplifies code for the developers, -
725 and actually catches most cases... If not, then they simply -
726 have to use [widget*]->setFocus() themselves... -
727 */ -
728 if (d->mainDef && fw->focusPolicy() == Qt::NoFocus) {
evaluated: d->mainDef
TRUEFALSE
yes
Evaluation Count:146
yes
Evaluation Count:65
evaluated: fw->focusPolicy() == Qt::NoFocus
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:136
10-146
729 QWidget *first = fw;
executed (the execution status of this line is deduced): QWidget *first = fw;
-
730 while ((first = first->nextInFocusChain()) != fw && first->focusPolicy() == Qt::NoFocus)
partially evaluated: (first = first->nextInFocusChain()) != fw
TRUEFALSE
yes
Evaluation Count:24
no
Evaluation Count:0
evaluated: first->focusPolicy() == Qt::NoFocus
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:10
0-24
731 ;
executed: ;
Execution Count:14
14
732 if (first != d->mainDef && qobject_cast<QPushButton*>(first))
evaluated: first != d->mainDef
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:3
evaluated: qobject_cast<QPushButton*>(first)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:6
1-7
733 d->mainDef->setFocus();
executed: d->mainDef->setFocus();
Execution Count:1
1
734 }
executed: }
Execution Count:10
10
735 if (!d->mainDef && isWindow()) {
evaluated: !d->mainDef
TRUEFALSE
yes
Evaluation Count:65
yes
Evaluation Count:146
evaluated: isWindow()
TRUEFALSE
yes
Evaluation Count:64
yes
Evaluation Count:1
1-146
736 QWidget *w = fw;
executed (the execution status of this line is deduced): QWidget *w = fw;
-
737 while ((w = w->nextInFocusChain()) != fw) {
evaluated: (w = w->nextInFocusChain()) != fw
TRUEFALSE
yes
Evaluation Count:139
yes
Evaluation Count:37
37-139
738 QPushButton *pb = qobject_cast<QPushButton *>(w);
executed (the execution status of this line is deduced): QPushButton *pb = qobject_cast<QPushButton *>(w);
-
739 if (pb && pb->autoDefault() && pb->focusPolicy() != Qt::NoFocus) {
evaluated: pb
TRUEFALSE
yes
Evaluation Count:27
yes
Evaluation Count:112
partially evaluated: pb->autoDefault()
TRUEFALSE
yes
Evaluation Count:27
no
Evaluation Count:0
partially evaluated: pb->focusPolicy() != Qt::NoFocus
TRUEFALSE
yes
Evaluation Count:27
no
Evaluation Count:0
0-112
740 pb->setDefault(true);
executed (the execution status of this line is deduced): pb->setDefault(true);
-
741 break;
executed: break;
Execution Count:27
27
742 } -
743 }
executed: }
Execution Count:112
112
744 }
executed: }
Execution Count:64
64
745 if (fw && !fw->hasFocus()) {
partially evaluated: fw
TRUEFALSE
yes
Evaluation Count:211
no
Evaluation Count:0
partially evaluated: !fw->hasFocus()
TRUEFALSE
yes
Evaluation Count:211
no
Evaluation Count:0
0-211
746 QFocusEvent e(QEvent::FocusIn, Qt::TabFocusReason);
executed (the execution status of this line is deduced): QFocusEvent e(QEvent::FocusIn, Qt::TabFocusReason);
-
747 QApplication::sendEvent(fw, &e);
executed (the execution status of this line is deduced): QApplication::sendEvent(fw, &e);
-
748 }
executed: }
Execution Count:211
211
749 -
750#ifndef QT_NO_ACCESSIBILITY -
751 QAccessibleEvent event(this, QAccessible::DialogStart);
executed (the execution status of this line is deduced): QAccessibleEvent event(this, QAccessible::DialogStart);
-
752 QAccessible::updateAccessibility(&event);
executed (the execution status of this line is deduced): QAccessible::updateAccessibility(&event);
-
753#endif -
754 -
755 } else {
executed: }
Execution Count:211
211
756 if (testAttribute(Qt::WA_WState_ExplicitShowHide) && testAttribute(Qt::WA_WState_Hidden))
evaluated: testAttribute(Qt::WA_WState_ExplicitShowHide)
TRUEFALSE
yes
Evaluation Count:305
yes
Evaluation Count:126
evaluated: testAttribute(Qt::WA_WState_Hidden)
TRUEFALSE
yes
Evaluation Count:97
yes
Evaluation Count:208
97-305
757 return;
executed: return;
Execution Count:97
97
758 -
759#ifndef QT_NO_ACCESSIBILITY -
760 if (isVisible()) {
evaluated: isVisible()
TRUEFALSE
yes
Evaluation Count:207
yes
Evaluation Count:127
127-207
761 QAccessibleEvent event(this, QAccessible::DialogEnd);
executed (the execution status of this line is deduced): QAccessibleEvent event(this, QAccessible::DialogEnd);
-
762 QAccessible::updateAccessibility(&event);
executed (the execution status of this line is deduced): QAccessible::updateAccessibility(&event);
-
763 }
executed: }
Execution Count:207
207
764#endif -
765 -
766 // Reimplemented to exit a modal event loop when the dialog is hidden. -
767 QWidget::setVisible(visible);
executed (the execution status of this line is deduced): QWidget::setVisible(visible);
-
768 if (d->eventLoop)
evaluated: d->eventLoop
TRUEFALSE
yes
Evaluation Count:94
yes
Evaluation Count:240
94-240
769 d->eventLoop->exit();
executed: d->eventLoop->exit();
Execution Count:94
94
770 }
executed: }
Execution Count:334
334
771 if (d->mainDef && isActiveWindow()
evaluated: d->mainDef
TRUEFALSE
yes
Evaluation Count:362
yes
Evaluation Count:183
partially evaluated: isActiveWindow()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:362
0-362
772 && d->styleHint(QPlatformDialogHelper::SnapToDefaultButton).toBool())
never evaluated: d->styleHint(QPlatformDialogHelper::SnapToDefaultButton).toBool()
0
773 QCursor::setPos(d->mainDef->mapToGlobal(d->mainDef->rect().center()));
never executed: QCursor::setPos(d->mainDef->mapToGlobal(d->mainDef->rect().center()));
0
774}
executed: }
Execution Count:545
545
775 -
776/*!\reimp */ -
777void QDialog::showEvent(QShowEvent *event) -
778{ -
779 if (!event->spontaneous() && !testAttribute(Qt::WA_Moved)) {
partially evaluated: !event->spontaneous()
TRUEFALSE
yes
Evaluation Count:207
no
Evaluation Count:0
evaluated: !testAttribute(Qt::WA_Moved)
TRUEFALSE
yes
Evaluation Count:205
yes
Evaluation Count:2
0-207
780 Qt::WindowStates state = windowState();
executed (the execution status of this line is deduced): Qt::WindowStates state = windowState();
-
781 adjustPosition(parentWidget());
executed (the execution status of this line is deduced): adjustPosition(parentWidget());
-
782 setAttribute(Qt::WA_Moved, false); // not really an explicit position
executed (the execution status of this line is deduced): setAttribute(Qt::WA_Moved, false);
-
783 if (state != windowState())
partially evaluated: state != windowState()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:205
0-205
784 setWindowState(state);
never executed: setWindowState(state);
0
785 }
executed: }
Execution Count:205
205
786}
executed: }
Execution Count:207
207
787 -
788/*! \internal */ -
789void QDialog::adjustPosition(QWidget* w) -
790{ -
791 -
792 if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme())
partially evaluated: const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()
TRUEFALSE
yes
Evaluation Count:414
no
Evaluation Count:0
0-414
793 if (theme->themeHint(QPlatformTheme::WindowAutoPlacement).toBool())
partially evaluated: theme->themeHint(QPlatformTheme::WindowAutoPlacement).toBool()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:414
0-414
794 return;
never executed: return;
0
795 QPoint p(0, 0);
executed (the execution status of this line is deduced): QPoint p(0, 0);
-
796 int extraw = 0, extrah = 0, scrn = 0;
executed (the execution status of this line is deduced): int extraw = 0, extrah = 0, scrn = 0;
-
797 if (w)
evaluated: w
TRUEFALSE
yes
Evaluation Count:78
yes
Evaluation Count:336
78-336
798 w = w->window();
executed: w = w->window();
Execution Count:78
78
799 QRect desk;
executed (the execution status of this line is deduced): QRect desk;
-
800 if (w) {
evaluated: w
TRUEFALSE
yes
Evaluation Count:78
yes
Evaluation Count:336
78-336
801 scrn = QApplication::desktop()->screenNumber(w);
executed (the execution status of this line is deduced): scrn = QApplication::desktop()->screenNumber(w);
-
802 } else if (QApplication::desktop()->isVirtualDesktop()) {
executed: }
Execution Count:78
partially evaluated: QApplication::desktop()->isVirtualDesktop()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:336
0-336
803 scrn = QApplication::desktop()->screenNumber(QCursor::pos());
never executed (the execution status of this line is deduced): scrn = QApplication::desktop()->screenNumber(QCursor::pos());
-
804 } else {
never executed: }
0
805 scrn = QApplication::desktop()->screenNumber(this);
executed (the execution status of this line is deduced): scrn = QApplication::desktop()->screenNumber(this);
-
806 }
executed: }
Execution Count:336
336
807 desk = QApplication::desktop()->availableGeometry(scrn);
executed (the execution status of this line is deduced): desk = QApplication::desktop()->availableGeometry(scrn);
-
808 -
809 QWidgetList list = QApplication::topLevelWidgets();
executed (the execution status of this line is deduced): QWidgetList list = QApplication::topLevelWidgets();
-
810 for (int i = 0; (extraw == 0 || extrah == 0) && i < list.size(); ++i) {
evaluated: extraw == 0
TRUEFALSE
yes
Evaluation Count:990
yes
Evaluation Count:52
partially evaluated: extrah == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:52
evaluated: i < list.size()
TRUEFALSE
yes
Evaluation Count:628
yes
Evaluation Count:362
0-990
811 QWidget * current = list.at(i);
executed (the execution status of this line is deduced): QWidget * current = list.at(i);
-
812 if (current->isVisible()) {
evaluated: current->isVisible()
TRUEFALSE
yes
Evaluation Count:264
yes
Evaluation Count:364
264-364
813 int framew = current->geometry().x() - current->x();
executed (the execution status of this line is deduced): int framew = current->geometry().x() - current->x();
-
814 int frameh = current->geometry().y() - current->y();
executed (the execution status of this line is deduced): int frameh = current->geometry().y() - current->y();
-
815 -
816 extraw = qMax(extraw, framew);
executed (the execution status of this line is deduced): extraw = qMax(extraw, framew);
-
817 extrah = qMax(extrah, frameh);
executed (the execution status of this line is deduced): extrah = qMax(extrah, frameh);
-
818 }
executed: }
Execution Count:264
264
819 }
executed: }
Execution Count:628
628
820 -
821 // sanity check for decoration frames. With embedding, we -
822 // might get extraordinary values -
823 if (extraw == 0 || extrah == 0 || extraw >= 10 || extrah >= 40) {
evaluated: extraw == 0
TRUEFALSE
yes
Evaluation Count:362
yes
Evaluation Count:52
partially evaluated: extrah == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:52
partially evaluated: extraw >= 10
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:52
partially evaluated: extrah >= 40
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:52
0-362
824 extrah = 40;
executed (the execution status of this line is deduced): extrah = 40;
-
825 extraw = 10;
executed (the execution status of this line is deduced): extraw = 10;
-
826 }
executed: }
Execution Count:362
362
827 -
828 -
829 if (w) {
evaluated: w
TRUEFALSE
yes
Evaluation Count:78
yes
Evaluation Count:336
78-336
830 // Use mapToGlobal rather than geometry() in case w might -
831 // be embedded in another application -
832 QPoint pp = w->mapToGlobal(QPoint(0,0));
executed (the execution status of this line is deduced): QPoint pp = w->mapToGlobal(QPoint(0,0));
-
833 p = QPoint(pp.x() + w->width()/2,
executed (the execution status of this line is deduced): p = QPoint(pp.x() + w->width()/2,
-
834 pp.y() + w->height()/ 2);
executed (the execution status of this line is deduced): pp.y() + w->height()/ 2);
-
835 } else {
executed: }
Execution Count:78
78
836 // p = middle of the desktop -
837 p = QPoint(desk.x() + desk.width()/2, desk.y() + desk.height()/2);
executed (the execution status of this line is deduced): p = QPoint(desk.x() + desk.width()/2, desk.y() + desk.height()/2);
-
838 }
executed: }
Execution Count:336
336
839 -
840 // p = origin of this -
841 p = QPoint(p.x()-width()/2 - extraw,
executed (the execution status of this line is deduced): p = QPoint(p.x()-width()/2 - extraw,
-
842 p.y()-height()/2 - extrah);
executed (the execution status of this line is deduced): p.y()-height()/2 - extrah);
-
843 -
844 -
845 if (p.x() + extraw + width() > desk.x() + desk.width())
evaluated: p.x() + extraw + width() > desk.x() + desk.width()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:402
12-402
846 p.setX(desk.x() + desk.width() - width() - extraw);
executed: p.setX(desk.x() + desk.width() - width() - extraw);
Execution Count:12
12
847 if (p.x() < desk.x())
evaluated: p.x() < desk.x()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:402
12-402
848 p.setX(desk.x());
executed: p.setX(desk.x());
Execution Count:12
12
849 -
850 if (p.y() + extrah + height() > desk.y() + desk.height())
evaluated: p.y() + extrah + height() > desk.y() + desk.height()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:402
12-402
851 p.setY(desk.y() + desk.height() - height() - extrah);
executed: p.setY(desk.y() + desk.height() - height() - extrah);
Execution Count:12
12
852 if (p.y() < desk.y())
evaluated: p.y() < desk.y()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:402
12-402
853 p.setY(desk.y());
executed: p.setY(desk.y());
Execution Count:12
12
854 -
855 move(p);
executed (the execution status of this line is deduced): move(p);
-
856}
executed: }
Execution Count:414
414
857 -
858/*! -
859 \obsolete -
860 -
861 If \a orientation is Qt::Horizontal, the extension will be displayed -
862 to the right of the dialog's main area. If \a orientation is -
863 Qt::Vertical, the extension will be displayed below the dialog's main -
864 area. -
865 -
866 Instead of using this functionality, we recommend that you simply call -
867 show() or hide() on the part of the dialog that you want to use as an -
868 extension. See the \l{Extension Example} for details. -
869 -
870 \sa setExtension() -
871*/ -
872void QDialog::setOrientation(Qt::Orientation orientation) -
873{ -
874 Q_D(QDialog);
executed (the execution status of this line is deduced): QDialogPrivate * const d = d_func();
-
875 d->orientation = orientation;
executed (the execution status of this line is deduced): d->orientation = orientation;
-
876}
executed: }
Execution Count:4
4
877 -
878/*! -
879 \obsolete -
880 -
881 Returns the dialog's extension orientation. -
882 -
883 Instead of using this functionality, we recommend that you simply call -
884 show() or hide() on the part of the dialog that you want to use as an -
885 extension. See the \l{Extension Example} for details. -
886 -
887 \sa extension() -
888*/ -
889Qt::Orientation QDialog::orientation() const -
890{ -
891 Q_D(const QDialog);
never executed (the execution status of this line is deduced): const QDialogPrivate * const d = d_func();
-
892 return d->orientation;
never executed: return d->orientation;
0
893} -
894 -
895/*! -
896 \obsolete -
897 -
898 Sets the widget, \a extension, to be the dialog's extension, -
899 deleting any previous extension. The dialog takes ownership of the -
900 extension. Note that if 0 is passed any existing extension will be -
901 deleted. This function must only be called while the dialog is hidden. -
902 -
903 Instead of using this functionality, we recommend that you simply call -
904 show() or hide() on the part of the dialog that you want to use as an -
905 extension. See the \l{Extension Example} for details. -
906 -
907 \sa showExtension(), setOrientation() -
908*/ -
909void QDialog::setExtension(QWidget* extension) -
910{ -
911 Q_D(QDialog);
executed (the execution status of this line is deduced): QDialogPrivate * const d = d_func();
-
912 delete d->extension;
executed (the execution status of this line is deduced): delete d->extension;
-
913 d->extension = extension;
executed (the execution status of this line is deduced): d->extension = extension;
-
914 -
915 if (!extension)
evaluated: !extension
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:6
5-6
916 return;
executed: return;
Execution Count:5
5
917 -
918 if (extension->parentWidget() != this)
evaluated: extension->parentWidget() != this
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:5
1-5
919 extension->setParent(this);
executed: extension->setParent(this);
Execution Count:1
1
920 extension->hide();
executed (the execution status of this line is deduced): extension->hide();
-
921}
executed: }
Execution Count:6
6
922 -
923/*! -
924 \obsolete -
925 -
926 Returns the dialog's extension or 0 if no extension has been -
927 defined. -
928 -
929 Instead of using this functionality, we recommend that you simply call -
930 show() or hide() on the part of the dialog that you want to use as an -
931 extension. See the \l{Extension Example} for details. -
932 -
933 \sa showExtension(), setOrientation() -
934*/ -
935QWidget* QDialog::extension() const -
936{ -
937 Q_D(const QDialog);
executed (the execution status of this line is deduced): const QDialogPrivate * const d = d_func();
-
938 return d->extension;
executed: return d->extension;
Execution Count:13
13
939} -
940 -
941 -
942/*! -
943 \obsolete -
944 -
945 If \a showIt is true, the dialog's extension is shown; otherwise the -
946 extension is hidden. -
947 -
948 Instead of using this functionality, we recommend that you simply call -
949 show() or hide() on the part of the dialog that you want to use as an -
950 extension. See the \l{Extension Example} for details. -
951 -
952 \sa show(), setExtension(), setOrientation() -
953*/ -
954void QDialog::showExtension(bool showIt) -
955{ -
956 Q_D(QDialog);
executed (the execution status of this line is deduced): QDialogPrivate * const d = d_func();
-
957 d->doShowExtension = showIt;
executed (the execution status of this line is deduced): d->doShowExtension = showIt;
-
958 if (!d->extension)
evaluated: !d->extension
TRUEFALSE
yes
Evaluation Count:210
yes
Evaluation Count:13
13-210
959 return;
executed: return;
Execution Count:210
210
960 if (!testAttribute(Qt::WA_WState_Visible))
partially evaluated: !testAttribute(Qt::WA_WState_Visible)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:13
0-13
961 return;
never executed: return;
0
962 if (d->extension->isVisible() == showIt)
evaluated: d->extension->isVisible() == showIt
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:12
1-12
963 return;
executed: return;
Execution Count:1
1
964 -
965 if (showIt) {
evaluated: showIt
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:6
6
966 d->size = size();
executed (the execution status of this line is deduced): d->size = size();
-
967 d->min = minimumSize();
executed (the execution status of this line is deduced): d->min = minimumSize();
-
968 d->max = maximumSize();
executed (the execution status of this line is deduced): d->max = maximumSize();
-
969 if (layout())
partially evaluated: layout()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
970 layout()->setEnabled(false);
never executed: layout()->setEnabled(false);
0
971 QSize s(d->extension->sizeHint()
executed (the execution status of this line is deduced): QSize s(d->extension->sizeHint()
-
972 .expandedTo(d->extension->minimumSize())
executed (the execution status of this line is deduced): .expandedTo(d->extension->minimumSize())
-
973 .boundedTo(d->extension->maximumSize()));
executed (the execution status of this line is deduced): .boundedTo(d->extension->maximumSize()));
-
974 if (d->orientation == Qt::Horizontal) {
evaluated: d->orientation == Qt::Horizontal
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:2
2-4
975 int h = qMax(height(), s.height());
executed (the execution status of this line is deduced): int h = qMax(height(), s.height());
-
976 d->extension->setGeometry(width(), 0, s.width(), h);
executed (the execution status of this line is deduced): d->extension->setGeometry(width(), 0, s.width(), h);
-
977 setFixedSize(width() + s.width(), h);
executed (the execution status of this line is deduced): setFixedSize(width() + s.width(), h);
-
978 } else {
executed: }
Execution Count:4
4
979 int w = qMax(width(), s.width());
executed (the execution status of this line is deduced): int w = qMax(width(), s.width());
-
980 d->extension->setGeometry(0, height(), w, s.height());
executed (the execution status of this line is deduced): d->extension->setGeometry(0, height(), w, s.height());
-
981 setFixedSize(w, height() + s.height());
executed (the execution status of this line is deduced): setFixedSize(w, height() + s.height());
-
982 }
executed: }
Execution Count:2
2
983 d->extension->show();
executed (the execution status of this line is deduced): d->extension->show();
-
984#ifndef QT_NO_SIZEGRIP -
985 const bool sizeGripEnabled = isSizeGripEnabled();
executed (the execution status of this line is deduced): const bool sizeGripEnabled = isSizeGripEnabled();
-
986 setSizeGripEnabled(false);
executed (the execution status of this line is deduced): setSizeGripEnabled(false);
-
987 d->sizeGripEnabled = sizeGripEnabled;
executed (the execution status of this line is deduced): d->sizeGripEnabled = sizeGripEnabled;
-
988#endif -
989 } else {
executed: }
Execution Count:6
6
990 d->extension->hide();
executed (the execution status of this line is deduced): d->extension->hide();
-
991 // workaround for CDE window manager that won't shrink with (-1,-1) -
992 setMinimumSize(d->min.expandedTo(QSize(1, 1)));
executed (the execution status of this line is deduced): setMinimumSize(d->min.expandedTo(QSize(1, 1)));
-
993 setMaximumSize(d->max);
executed (the execution status of this line is deduced): setMaximumSize(d->max);
-
994 resize(d->size);
executed (the execution status of this line is deduced): resize(d->size);
-
995 if (layout())
partially evaluated: layout()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
996 layout()->setEnabled(true);
never executed: layout()->setEnabled(true);
0
997#ifndef QT_NO_SIZEGRIP -
998 setSizeGripEnabled(d->sizeGripEnabled);
executed (the execution status of this line is deduced): setSizeGripEnabled(d->sizeGripEnabled);
-
999#endif -
1000 }
executed: }
Execution Count:6
6
1001} -
1002 -
1003 -
1004/*! \reimp */ -
1005QSize QDialog::sizeHint() const -
1006{ -
1007 Q_D(const QDialog);
executed (the execution status of this line is deduced): const QDialogPrivate * const d = d_func();
-
1008 if (d->extension) {
partially evaluated: d->extension
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:243
0-243
1009 if (d->orientation == Qt::Horizontal)
never evaluated: d->orientation == Qt::Horizontal
0
1010 return QSize(QWidget::sizeHint().width(),
never executed: return QSize(QWidget::sizeHint().width(), qMax(QWidget::sizeHint().height(),d->extension->sizeHint().height()));
0
1011 qMax(QWidget::sizeHint().height(),d->extension->sizeHint().height()));
never executed: return QSize(QWidget::sizeHint().width(), qMax(QWidget::sizeHint().height(),d->extension->sizeHint().height()));
0
1012 else -
1013 return QSize(qMax(QWidget::sizeHint().width(), d->extension->sizeHint().width()),
never executed: return QSize(qMax(QWidget::sizeHint().width(), d->extension->sizeHint().width()), QWidget::sizeHint().height());
0
1014 QWidget::sizeHint().height());
never executed: return QSize(qMax(QWidget::sizeHint().width(), d->extension->sizeHint().width()), QWidget::sizeHint().height());
0
1015 } -
1016 return QWidget::sizeHint();
executed: return QWidget::sizeHint();
Execution Count:243
243
1017} -
1018 -
1019 -
1020/*! \reimp */ -
1021QSize QDialog::minimumSizeHint() const -
1022{ -
1023 Q_D(const QDialog);
executed (the execution status of this line is deduced): const QDialogPrivate * const d = d_func();
-
1024 if (d->extension) {
partially evaluated: d->extension
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
1025 if (d->orientation == Qt::Horizontal)
never evaluated: d->orientation == Qt::Horizontal
0
1026 return QSize(QWidget::minimumSizeHint().width(),
never executed: return QSize(QWidget::minimumSizeHint().width(), qMax(QWidget::minimumSizeHint().height(), d->extension->minimumSizeHint().height()));
0
1027 qMax(QWidget::minimumSizeHint().height(), d->extension->minimumSizeHint().height()));
never executed: return QSize(QWidget::minimumSizeHint().width(), qMax(QWidget::minimumSizeHint().height(), d->extension->minimumSizeHint().height()));
0
1028 else -
1029 return QSize(qMax(QWidget::minimumSizeHint().width(), d->extension->minimumSizeHint().width()),
never executed: return QSize(qMax(QWidget::minimumSizeHint().width(), d->extension->minimumSizeHint().width()), QWidget::minimumSizeHint().height());
0
1030 QWidget::minimumSizeHint().height());
never executed: return QSize(qMax(QWidget::minimumSizeHint().width(), d->extension->minimumSizeHint().width()), QWidget::minimumSizeHint().height());
0
1031 } -
1032 -
1033 return QWidget::minimumSizeHint();
executed: return QWidget::minimumSizeHint();
Execution Count:7
7
1034} -
1035 -
1036/*! -
1037 \property QDialog::modal -
1038 \brief whether show() should pop up the dialog as modal or modeless -
1039 -
1040 By default, this property is false and show() pops up the dialog -
1041 as modeless. Setting his property to true is equivalent to setting -
1042 QWidget::windowModality to Qt::ApplicationModal. -
1043 -
1044 exec() ignores the value of this property and always pops up the -
1045 dialog as modal. -
1046 -
1047 \sa QWidget::windowModality, show(), exec() -
1048*/ -
1049 -
1050void QDialog::setModal(bool modal) -
1051{ -
1052 setAttribute(Qt::WA_ShowModal, modal);
executed (the execution status of this line is deduced): setAttribute(Qt::WA_ShowModal, modal);
-
1053}
executed: }
Execution Count:41
41
1054 -
1055 -
1056bool QDialog::isSizeGripEnabled() const -
1057{ -
1058#ifndef QT_NO_SIZEGRIP -
1059 Q_D(const QDialog);
executed (the execution status of this line is deduced): const QDialogPrivate * const d = d_func();
-
1060 return !!d->resizer;
executed: return !!d->resizer;
Execution Count:14
14
1061#else -
1062 return false; -
1063#endif -
1064} -
1065 -
1066 -
1067void QDialog::setSizeGripEnabled(bool enabled) -
1068{ -
1069#ifdef QT_NO_SIZEGRIP -
1070 Q_UNUSED(enabled); -
1071#else -
1072 Q_D(QDialog);
executed (the execution status of this line is deduced): QDialogPrivate * const d = d_func();
-
1073#ifndef QT_NO_SIZEGRIP -
1074 d->sizeGripEnabled = enabled;
executed (the execution status of this line is deduced): d->sizeGripEnabled = enabled;
-
1075 if (enabled && d->doShowExtension)
evaluated: enabled
TRUEFALSE
yes
Evaluation Count:127
yes
Evaluation Count:15
partially evaluated: d->doShowExtension
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:127
0-127
1076 return;
never executed: return;
0
1077#endif -
1078 if (!enabled != !d->resizer) {
evaluated: !enabled != !d->resizer
TRUEFALSE
yes
Evaluation Count:129
yes
Evaluation Count:13
13-129
1079 if (enabled) {
evaluated: enabled
TRUEFALSE
yes
Evaluation Count:127
yes
Evaluation Count:2
2-127
1080 d->resizer = new QSizeGrip(this);
executed (the execution status of this line is deduced): d->resizer = new QSizeGrip(this);
-
1081 // adjustSize() processes all events, which is suboptimal -
1082 d->resizer->resize(d->resizer->sizeHint());
executed (the execution status of this line is deduced): d->resizer->resize(d->resizer->sizeHint());
-
1083 if (isRightToLeft())
partially evaluated: isRightToLeft()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:127
0-127
1084 d->resizer->move(rect().bottomLeft() -d->resizer->rect().bottomLeft());
never executed: d->resizer->move(rect().bottomLeft() -d->resizer->rect().bottomLeft());
0
1085 else -
1086 d->resizer->move(rect().bottomRight() -d->resizer->rect().bottomRight());
executed: d->resizer->move(rect().bottomRight() -d->resizer->rect().bottomRight());
Execution Count:127
127
1087 d->resizer->raise();
executed (the execution status of this line is deduced): d->resizer->raise();
-
1088 d->resizer->show();
executed (the execution status of this line is deduced): d->resizer->show();
-
1089 } else {
executed: }
Execution Count:127
127
1090 delete d->resizer;
executed (the execution status of this line is deduced): delete d->resizer;
-
1091 d->resizer = 0;
executed (the execution status of this line is deduced): d->resizer = 0;
-
1092 }
executed: }
Execution Count:2
2
1093 } -
1094#endif //QT_NO_SIZEGRIP -
1095}
executed: }
Execution Count:142
142
1096 -
1097 -
1098 -
1099/*! \reimp */ -
1100void QDialog::resizeEvent(QResizeEvent *) -
1101{ -
1102#ifndef QT_NO_SIZEGRIP -
1103 Q_D(QDialog);
executed (the execution status of this line is deduced): QDialogPrivate * const d = d_func();
-
1104 if (d->resizer) {
evaluated: d->resizer
TRUEFALSE
yes
Evaluation Count:45
yes
Evaluation Count:250
45-250
1105 if (isRightToLeft())
partially evaluated: isRightToLeft()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:45
0-45
1106 d->resizer->move(rect().bottomLeft() -d->resizer->rect().bottomLeft());
never executed: d->resizer->move(rect().bottomLeft() -d->resizer->rect().bottomLeft());
0
1107 else -
1108 d->resizer->move(rect().bottomRight() -d->resizer->rect().bottomRight());
executed: d->resizer->move(rect().bottomRight() -d->resizer->rect().bottomRight());
Execution Count:45
45
1109 d->resizer->raise();
executed (the execution status of this line is deduced): d->resizer->raise();
-
1110 }
executed: }
Execution Count:45
45
1111#endif -
1112}
executed: }
Execution Count:295
295
1113 -
1114/*! \fn void QDialog::finished(int result) -
1115 \since 4.1 -
1116 -
1117 This signal is emitted when the dialog's \a result code has been -
1118 set, either by the user or by calling done(), accept(), or -
1119 reject(). -
1120 -
1121 Note that this signal is \e not emitted when hiding the dialog -
1122 with hide() or setVisible(false). This includes deleting the -
1123 dialog while it is visible. -
1124 -
1125 \sa accepted(), rejected() -
1126*/ -
1127 -
1128/*! \fn void QDialog::accepted() -
1129 \since 4.1 -
1130 -
1131 This signal is emitted when the dialog has been accepted either by -
1132 the user or by calling accept() or done() with the -
1133 QDialog::Accepted argument. -
1134 -
1135 Note that this signal is \e not emitted when hiding the dialog -
1136 with hide() or setVisible(false). This includes deleting the -
1137 dialog while it is visible. -
1138 -
1139 \sa finished(), rejected() -
1140*/ -
1141 -
1142/*! \fn void QDialog::rejected() -
1143 \since 4.1 -
1144 -
1145 This signal is emitted when the dialog has been rejected either by -
1146 the user or by calling reject() or done() with the -
1147 QDialog::Rejected argument. -
1148 -
1149 Note that this signal is \e not emitted when hiding the dialog -
1150 with hide() or setVisible(false). This includes deleting the -
1151 dialog while it is visible. -
1152 -
1153 \sa finished(), accepted() -
1154*/ -
1155 -
1156QT_END_NAMESPACE -
1157#include "moc_qdialog.cpp" -
1158 -
Source codeSwitch to Preprocessed file

Generated by Squish Coco Non-Commercial