qxcbintegration.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/plugins/platforms/xcb/qxcbintegration.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5-
6-
7-
8-
9-
10-
11-
12-
13-
14-
15-
16-
17-
18-
19-
20-
21-
22-
23-
24-
25-
26-
27-
28-
29-
30static bool runningUnderDebugger()-
31{-
32-
33 const QString parentProc = QLatin1String("/proc/") + QString::number(getppid());-
34 const QFileInfo parentProcExe(parentProc + QLatin1String("/exe"));-
35 if (parentProcExe.isSymLink())-
36 return parentProcExe.symLinkTarget().endsWith(QLatin1String("/gdb"));-
37 QFile f(parentProc + QLatin1String("/cmdline"));-
38 if (!f.open(QIODevice::ReadOnly))-
39 return false;-
40 QByteArray s;-
41 char c;-
42 while (f.getChar(&c) && c) {-
43 if (c == '/')-
44 s.clear();-
45 else-
46 s += c;-
47 }-
48 return s == "gdb";-
49-
50-
51-
52}-
53-
54QXcbIntegration *QXcbIntegration::m_instance = nullptr;-
55-
56QXcbIntegration::QXcbIntegration(const QStringList &parameters, int &argc, char **argv)-
57 : m_services(new QGenericUnixServices)-
58 , m_instanceName(0)-
59 , m_canGrab(true)-
60 , m_defaultVisualId((2147483647 * 2U + 1U))-
61{-
62 m_instance = this;-
63 (static_cast<QGuiApplication *>(QCoreApplication::instance()))->setAttribute(Qt::AA_CompressHighFrequencyEvents, true);-
64-
65 qRegisterMetaType<QXcbWindow*>();-
66-
67 XInitThreads();-
68-
69 m_nativeInterface.reset(new QXcbNativeInterface);-
70-
71-
72 const char *displayName = 0;-
73 bool noGrabArg = false;-
74 bool doGrabArg = false;-
75 if (argc
argcDescription
TRUEevaluated 63 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
FALSEevaluated 72 times by 2 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
) {
63-72
76 int j = 1;-
77 for (int i = 1; i < argc
i < argcDescription
TRUEevaluated 74 times by 3 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_selftests - unknown status
FALSEevaluated 63 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
; i++) {
63-74
78 QByteArray arg(argv[i]);-
79 if (arg.startsWith("--")
arg.startsWith("--")Description
TRUEnever evaluated
FALSEevaluated 74 times by 3 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_selftests - unknown status
)
0-74
80 arg.remove(0, 1);
never executed: arg.remove(0, 1);
0
81 if (arg == "-display"
arg == "-display"Description
TRUEnever evaluated
FALSEevaluated 74 times by 3 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_selftests - unknown status
&& i < argc - 1
i < argc - 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0-74
82 displayName = argv[++i];
never executed: displayName = argv[++i];
0
83 else if (arg == "-name"
arg == "-name"Description
TRUEnever evaluated
FALSEevaluated 74 times by 3 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_selftests - unknown status
&& i < argc - 1
i < argc - 1Description
TRUEnever evaluated
FALSEnever evaluated
)
0-74
84 m_instanceName = argv[++i];
never executed: m_instanceName = argv[++i];
0
85 else if (arg == "-nograb"
arg == "-nograb"Description
TRUEnever evaluated
FALSEevaluated 74 times by 3 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_selftests - unknown status
)
0-74
86 noGrabArg = true;
never executed: noGrabArg = true;
0
87 else if (arg == "-dograb"
arg == "-dograb"Description
TRUEnever evaluated
FALSEevaluated 74 times by 3 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_selftests - unknown status
)
0-74
88 doGrabArg = true;
never executed: doGrabArg = true;
0
89 else if (arg == "-visual"
arg == "-visual"Description
TRUEnever evaluated
FALSEevaluated 74 times by 3 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_selftests - unknown status
&& i < argc - 1
i < argc - 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0-74
90 bool ok = false;-
91 m_defaultVisualId = QByteArray(argv[++i]).toUInt(&ok, 0);-
92 if (!ok
!okDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
93 m_defaultVisualId = (2147483647 * 2U + 1U);
never executed: m_defaultVisualId = (2147483647 * 2U + 1U);
0
94 }
never executed: end of block
0
95 else-
96 argv[j++] = argv[i];
executed 74 times by 3 tests: argv[j++] = argv[i];
Executed by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_selftests - unknown status
74
97 }-
98 argc = j;-
99 }
executed 63 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
63
100-
101 bool underDebugger = runningUnderDebugger();-
102 if (noGrabArg
noGrabArgDescription
TRUEnever evaluated
FALSEevaluated 135 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
&& doGrabArg
doGrabArgDescription
TRUEnever evaluated
FALSEnever evaluated
&& underDebugger
underDebuggerDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0-135
103 QMessageLogger(__FILE__, 161168, __PRETTY_FUNCTION__).warning() << ("Both -nograb and -dograb command line arguments specified. Please pick one. -nograb takes prcedence";);-
104 doGrabArg = false;-
105 }
never executed: end of block
0
106-
107-
108 if (!noGrabArg
!noGrabArgDescription
TRUEevaluated 135 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
FALSEnever evaluated
&& !doGrabArg
!doGrabArgDescription
TRUEevaluated 135 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
FALSEnever evaluated
&& underDebugger
underDebuggerDescription
TRUEnever evaluated
FALSEevaluated 135 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
) {
0-135
109 QMessageLogger(__FILE__, 167174, __PRETTY_FUNCTION__).debug("Qt: gdb: -nograb added to command-line options.\n"-
110 "\t Use the -dograb option to enforce grabbing.");-
111 }
never executed: end of block
0
112-
113 m_canGrab = (!underDebugger
!underDebuggerDescription
TRUEevaluated 135 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
FALSEnever evaluated
&& !noGrabArg
!noGrabArgDescription
TRUEevaluated 135 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
FALSEnever evaluated
) || (underDebugger
underDebuggerDescription
TRUEnever evaluated
FALSEnever evaluated
&& doGrabArg
doGrabArgDescription
TRUEnever evaluated
FALSEnever evaluated
);
0-135
114-
115 static bool canNotGrabEnv = qEnvironmentVariableIsSet("QT_XCB_NO_GRAB_SERVER");-
116 if (canNotGrabEnv
canNotGrabEnvDescription
TRUEnever evaluated
FALSEevaluated 135 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
)
0-135
117 m_canGrab = false;
never executed: m_canGrab = false;
0
118-
119 const int numParameters = parameters.size();-
120 m_connections.reserve(1 + numParameters / 2);-
121 m_connections << new QXcbConnection(m_nativeInterface.data(), m_canGrab, m_defaultVisualId, displayName);-
122-
123 for (int i = 0; i < numParameters - 1
i < numParameters - 1Description
TRUEnever evaluated
FALSEevaluated 135 times by 5 tests
Evaluated by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
; i += 2) {
0-135
124 for (bool qt_category_enabled = lcQpaScreen().isDebugEnabled(); qt_category_enabled
qt_category_enabledDescription
TRUEnever evaluated
FALSEnever evaluated
; qt_category_enabled = false) QMessageLogger(__FILE__, 182189, __PRETTY_FUNCTION__, lcQpaScreen().categoryName()).debug() << "connecting to additional display: " << parameters.at(i) << parameters.at(i+1);
never executed: QMessageLogger(__FILE__, 189, __PRETTY_FUNCTION__, lcQpaScreen().categoryName()).debug() << "connecting to additional display: " << parameters.at(i) << parameters.at(i+1);
0
125 QString display = parameters.at(i) + QLatin1Char(':') + parameters.at(i+1);-
126 m_connections << new QXcbConnection(m_nativeInterface.data(), m_canGrab, m_defaultVisualId, display.toLatin1().constData());-
127 }
never executed: end of block
0
128-
129 m_fontDatabase.reset(new QGenericUnixFontDatabase());-
130}
executed 135 times by 5 tests: end of block
Executed by:
  • tst_QApplication
  • tst_QGuiApplication
  • tst_qapplication - unknown status
  • tst_qprocess - unknown status
  • tst_selftests - unknown status
135
131-
132QXcbIntegration::~QXcbIntegration()-
133{-
134 qDeleteAll(m_connections);-
135 m_instance = nullptr;-
136}-
137-
138QPlatformWindow *QXcbIntegration::createPlatformWindow(QWindow *window) const-
139{-
140 QXcbScreen *screen = static_cast<QXcbScreen *>(window->screen()->handle());-
141 QXcbGlIntegration *glIntegration = screen->connection()->glIntegration();-
142 if (window->type() != Qt::Desktop
window->type() != Qt::DesktopDescription
TRUEevaluated 4107 times by 125 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
FALSEevaluated 298 times by 117 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
)&& window->supportsOpenGL()
window->supportsOpenGL()Description
TRUEevaluated 3974 times by 118 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
FALSEevaluated 133 times by 12 tests
Evaluated by:
  • tst_QAccessibility
  • tst_QApplication
  • tst_QBackingStore
  • tst_QGuiApplication
  • tst_QKeyEvent
  • tst_QLineEdit
  • tst_QMouseEvent
  • tst_QRasterWindow
  • tst_QTouchEvent
  • tst_QWindow
  • tst_QWindowContainer
  • tst_qinputmethod
)
{
133-4107
143 if (glIntegration
glIntegrationDescription
TRUEevaluated 3974 times by 118 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
FALSEnever evaluated
) {
0-3974
144 QXcbWindow *xcbWindow = glIntegration->createWindow(window);-
145 xcbWindow->create();-
146 return
executed 3974 times by 118 tests: return xcbWindow;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
xcbWindow;
executed 3974 times by 118 tests: return xcbWindow;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
3974
147 }-
148 }
never executed: end of block
0
149-
150 ((!(window->type() == Qt::Desktop || !window->supportsOpenGL() || (!glIntegration && window->surfaceType() == QSurface::RasterGLSurface))) ? qt_assert("window->type() == Qt::Desktop || !window->supportsOpenGL() || (!glIntegration && window->surfaceType() == QSurface::RasterGLSurface)",-
151 __FILE__-
152 ,-
153 209216-
154 ) : qt_noop())-
155 ;-
156 QXcbWindow *xcbWindow = new QXcbWindow(window);-
157 xcbWindow->create();-
158 return
executed 431 times by 124 tests: return xcbWindow;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
xcbWindow;
executed 431 times by 124 tests: return xcbWindow;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
431
159}-
160-
161-
162QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const-
163{-
164 QXcbScreen *screen = static_cast<QXcbScreen *>(context->screen()->handle());-
165 QXcbGlIntegration *glIntegration = screen->connection()->glIntegration();-
166 if (!glIntegration) {-
167 QMessageLogger(__FILE__, 221228, __PRETTY_FUNCTION__).warning("QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled");-
168 return nullptr;-
169 }-
170 return glIntegration->createPlatformOpenGLContext(context);-
171}-
172-
173-
174QPlatformBackingStore *QXcbIntegration::createPlatformBackingStore(QWindow *window) const-
175{-
176 return new QXcbBackingStore(window);-
177}-
178-
179QPlatformOffscreenSurface *QXcbIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const-
180{-
181 QXcbScreen *screen = static_cast<QXcbScreen *>(surface->screen()->handle());-
182 QXcbGlIntegration *glIntegration = screen->connection()->glIntegration();-
183 if (!glIntegration) {-
184 QMessageLogger(__FILE__, 238245, __PRETTY_FUNCTION__).warning("QXcbIntegration: Cannot create platform offscreen surface, neither GLX nor EGL are enabled");-
185 return nullptr;-
186 }-
187 return glIntegration->createPlatformOffscreenSurface(surface);-
188}-
189-
190bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const-
191{-
192 switch (cap) {-
193 case ThreadedPixmaps: return true;case
executed 131 times by 125 tests: case OpenGL:
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
OpenGL:
executed 131 times by 125 tests: case OpenGL:
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
131
194 return m_connections.first()->glIntegration();case
executed 8 times by 2 tests: case ThreadedOpenGL:
Executed by:
  • tst_QGLThreads
  • tst_QOpenGlConfig
ThreadedOpenGL:
executed 8 times by 2 tests: case ThreadedOpenGL:
Executed by:
  • tst_QGLThreads
  • tst_QOpenGlConfig
8
195 return m_connections.at{-
196 const auto *connection = qAsConst(0)->threadedEventHandling()-
&&m_connections.at).first();
197 if (0)->const
const auto *in...lIntegration()Description
TRUEevaluated 139 times by 126 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
FALSEnever evaluated
const auto *in...lIntegration()Description
TRUEevaluated 139 times by 126 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
FALSEnever evaluated
auto *integration = connection->glIntegration()
const auto *in...lIntegration()Description
TRUEevaluated 139 times by 126 tests
Evaluated by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
FALSEnever evaluated
)
0-139
198 return
executed 139 times by 126 tests: return cap != ThreadedOpenGL || (connection->threadedEventHandling() && integration->supportsThreadedOpenGL());
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
cap != ThreadedOpenGL
executed 139 times by 126 tests: return cap != ThreadedOpenGL || (connection->threadedEventHandling() && integration->supportsThreadedOpenGL());
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
139
199 || (connection->threadedEventHandling
executed 139 times by 126 tests: return cap != ThreadedOpenGL || (connection->threadedEventHandling() && integration->supportsThreadedOpenGL());
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
executed 139 times by 126 tests: return cap != ThreadedOpenGL || (connection->threadedEventHandling() && integration->supportsThreadedOpenGL());
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
() && m_connections.at(0)->glIntegration()->integration->supportsThreadedOpenGL();());
executed 139 times by 126 tests: return cap != ThreadedOpenGL || (connection->threadedEventHandling() && integration->supportsThreadedOpenGL());
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
139
200 return
never executed: return false;
false;
never executed: return false;
0
201 }-
202-
203 case
executed 2 times by 2 tests: case ThreadedPixmaps:
Executed by:
  • tst_QOpenGlConfig
  • tst_QPixmap
ThreadedPixmaps:
executed 2 times by 2 tests: case ThreadedPixmaps:
Executed by:
  • tst_QOpenGlConfig
  • tst_QPixmap
2
204 case
executed 2 times by 2 tests: case WindowMasks:
Executed by:
  • tst_QOpenGlConfig
  • tst_QWidget
WindowMasks:
executed 2 times by 2 tests: case WindowMasks:
Executed by:
  • tst_QOpenGlConfig
  • tst_QWidget
2
205 return true;case
executed 2 times by 1 test: case MultipleWindows:
Executed by:
  • tst_QWidget
MultipleWindows:
executed 2 times by 1 test: case MultipleWindows:
Executed by:
  • tst_QWidget
2
206 return true;case
never executed: case ForeignWindows:
ForeignWindows:
never executed: case ForeignWindows:
0
207 return true;case
executed 9 times by 3 tests: case SyncState:
Executed by:
  • tst_QWidget
  • tst_QWidget_window
  • tst_QWindow
SyncState:
executed 9 times by 3 tests: case SyncState:
Executed by:
  • tst_QWidget
  • tst_QWidget_window
  • tst_QWindow
9
208 return true;case
executed 4277 times by 120 tests: case RasterGLSurface:
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
RasterGLSurface:
executed 4277 times by 120 tests: case RasterGLSurface:
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
4277
209 return
executed 4292 times by 121 tests: return true;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
true;
executed 4292 times by 121 tests: return true;
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • tst_QDialogButtonBox
  • ...
4292
210-
211 case
executed 1 time by 1 test: case SwitchableWidgetComposition:
Executed by:
  • tst_QOpenGLWidget
SwitchableWidgetComposition:
executed 1 time by 1 test: case SwitchableWidgetComposition:
Executed by:
  • tst_QOpenGLWidget
1
212 {-
213 return
executed 1 time by 1 test: return m_connections.at(0)->glIntegration() && m_connections.at(0)->glIntegration()->supportsSwitchableWidgetComposition();
Executed by:
  • tst_QOpenGLWidget
m_connections.at(0)->glIntegration()
executed 1 time by 1 test: return m_connections.at(0)->glIntegration() && m_connections.at(0)->glIntegration()->supportsSwitchableWidgetComposition();
Executed by:
  • tst_QOpenGLWidget
1
214 && m_connections.at(0)->glIntegration()->supportsSwitchableWidgetComposition();
executed 1 time by 1 test: return m_connections.at(0)->glIntegration() && m_connections.at(0)->glIntegration()->supportsSwitchableWidgetComposition();
Executed by:
  • tst_QOpenGLWidget
1
215 }-
216-
217 default
executed 11991 times by 125 tests: default:
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
:
executed 11991 times by 125 tests: default:
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
return
executed 11991 times by 125 tests: return QPlatformIntegration::hasCapability(cap);
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
QPlatformIntegration::hasCapability(cap);
executed 11991 times by 125 tests: return QPlatformIntegration::hasCapability(cap);
Executed by:
  • tst_Gestures
  • tst_QAbstractButton
  • tst_QAbstractItemView
  • tst_QAbstractScrollArea
  • tst_QAbstractSlider
  • tst_QAbstractSpinBox
  • tst_QAccessibility
  • tst_QAction
  • tst_QActionGroup
  • tst_QApplication
  • tst_QBackingStore
  • tst_QBoxLayout
  • tst_QButtonGroup
  • tst_QCalendarWidget
  • tst_QCheckBox
  • tst_QColorDialog
  • tst_QColumnView
  • tst_QComboBox
  • tst_QCommandLinkButton
  • tst_QCompleter
  • tst_QDataWidgetMapper
  • tst_QDateTimeEdit
  • tst_QDesktopWidget
  • tst_QDial
  • tst_QDialog
  • ...
11991
218 }-
219}-
220-
221QAbstractEventDispatcher *QXcbIntegration::createEventDispatcher() const-
222{-
223 QAbstractEventDispatcher *dispatcher = createUnixEventDispatcher();-
224 for (int i = 0; i < m_connections.size(); i++)-
225 m_connections[i]->eventReader()->registerEventDispatcher(dispatcher);-
226 return dispatcher;-
227}-
228-
229void QXcbIntegration::initialize()-
230{-
231-
232-
233 QString icStr = QPlatformInputContextFactory::requested();-
234 if (icStr.isNull())-
235 icStr = QLatin1String("compose");-
236 m_inputContext.reset(QPlatformInputContextFactory::create(icStr));-
237}-
238-
239void QXcbIntegration::moveToScreen(QWindow *window, int screen)-
240{-
241 (void)window;;-
242 (void)screen;;-
243}-
244-
245QPlatformFontDatabase *QXcbIntegration::fontDatabase() const-
246{-
247 return m_fontDatabase.data();-
248}-
249-
250QPlatformNativeInterface * QXcbIntegration::nativeInterface() const-
251{-
252 return m_nativeInterface.data();-
253}-
254-
255-
256QPlatformClipboard *QXcbIntegration::clipboard() const-
257{-
258 return m_connections.at(0)->clipboard();-
259}-
260-
261-
262-
263QPlatformDrag *QXcbIntegration::drag() const-
264{-
265 return m_connections.at(0)->drag();-
266}-
267-
268-
269QPlatformInputContext *QXcbIntegration::inputContext() const-
270{-
271 return m_inputContext.data();-
272}-
273-
274-
275QPlatformAccessibility *QXcbIntegration::accessibility() const-
276{-
277-
278 if (!m_accessibility) {-
279 ((!(QCoreApplication::eventDispatcher())) ? qt_assert_x("QXcbIntegration", "Initializing accessibility without event-dispatcher!",-
280 __FILE__-
281 ,-
282 322341-
283 ) : qt_noop())-
284 ;-
285 m_accessibility.reset(new QSpiAccessibleBridge());-
286 }-
287-
288-
289 return m_accessibility.data();-
290}-
291-
292-
293QPlatformServices *QXcbIntegration::services() const-
294{-
295 return m_services.data();-
296}-
297-
298Qt::KeyboardModifiers QXcbIntegration::queryKeyboardModifiers() const-
299{-
300 int keybMask = 0;-
301 QXcbConnection *conn = m_connections.at(0);-
302 QXcbCursor::queryPointer(conn, 0, 0, &keybMask);-
303 return conn->keyboard()->translateModifiers(keybMask);-
304}-
305-
306QList<int> QXcbIntegration::possibleKeys(const QKeyEvent *e) const-
307{-
308 return m_connections.at(0)->keyboard()->possibleKeys(e);-
309}-
310-
311QStringList QXcbIntegration::themeNames() const-
312{-
313 return QGenericUnixTheme::themeNames();-
314}-
315-
316QPlatformTheme *QXcbIntegration::createPlatformTheme(const QString &name) const-
317{-
318 return QGenericUnixTheme::createUnixTheme(name);-
319}-
320-
321QVariant QXcbIntegration::styleHint(QPlatformIntegration::StyleHint hint) const-
322{-
323 switch (hint) {-
324 case QPlatformIntegration::CursorFlashTime:-
325 case QPlatformIntegration::KeyboardInputInterval:-
326 case QPlatformIntegration::MouseDoubleClickInterval:-
327 case QPlatformIntegration::StartDragTime:-
328 case QPlatformIntegration::KeyboardAutoRepeatRate:-
329 case QPlatformIntegration::PasswordMaskDelay:-
330 case QPlatformIntegration::StartDragVelocity:-
331 case QPlatformIntegration::UseRtlExtensions:-
332 case QPlatformIntegration::PasswordMaskCharacter:-
333-
334 break;-
335 case QPlatformIntegration::FontSmoothingGamma:-
336-
337 return qreal(1.0);-
338 case QPlatformIntegration::StartDragDistance: {-
339-
340-
341 qreal dpi = 100.0;-
342 if (const QXcbScreen *screen = defaultConnection()->primaryScreen()) {-
343 if (screen->logicalDpi().first > dpi)-
344 dpi = screen->logicalDpi().first;-
345 if (screen->logicalDpi().second > dpi)-
346 dpi = screen->logicalDpi().second;-
347 }-
348 return 10.0 * dpi / 100.0;-
349 }-
350 case QPlatformIntegration::ShowIsFullScreen:-
351-
352-
353 return false;-
354 case QPlatformIntegration::ReplayMousePressOutsidePopup:-
355 return false;-
356 default:-
357 break;-
358 }-
359 return QPlatformIntegration::styleHint(hint);-
360}-
361-
362static QString argv0BaseName()-
363{-
364 QString result;-
365 const QStringList arguments = QCoreApplication::arguments();-
366 if (!arguments.isEmpty() && !arguments.front().isEmpty()) {-
367 result = arguments.front();-
368 const int lastSlashPos = result.lastIndexOf(QLatin1Char('/'));-
369 if (lastSlashPos != -1)-
370 result.remove(0, lastSlashPos + 1);-
371 }-
372 return result;-
373}-
374-
375static const char resourceNameVar[] = "RESOURCE_NAME";-
376-
377QByteArray QXcbIntegration::wmClass() const-
378{-
379 if (m_wmClass.isEmpty()) {-
380-
381 QString name;-
382 if (m_instanceName)-
383 name = QString::fromLocal8Bit(m_instanceName);-
384 if (name.isEmpty() && qEnvironmentVariableIsSet(resourceNameVar))-
385 name = QString::fromLocal8Bit(qgetenv(resourceNameVar));-
386 if (name.isEmpty())-
387 name = argv0BaseName();-
388-
389-
390-
391 QString className = QCoreApplication::applicationName();-
392 if (className.isEmpty()) {-
393 className = argv0BaseName();-
394 if (!className.isEmpty() && className.at(0).isLower())-
395 className[0] = className.at(0).toUpper();-
396 }-
397-
398 if (!name.isEmpty() && !className.isEmpty()) {-
399 m_wmClass = name.toLocal8Bit();-
400 m_wmClass.append('\0');-
401 m_wmClass.append(className.toLocal8Bit());-
402 m_wmClass.append('\0');-
403 }-
404 }-
405 return m_wmClass;-
406}-
407-
408-
409QPlatformSessionManager *QXcbIntegration::createPlatformSessionManager(const QString &id, const QString &key) const-
410{-
411 return new QXcbSessionManager(id, key);-
412}-
413-
414-
415void QXcbIntegration::sync()-
416{-
417 for (int i = 0; i < m_connections.size(); i++) {-
418 m_connections.at(i)->sync();-
419 }-
420}-
421-
422-
423void QXcbIntegration::beep() const-
424{-
425 QScreen *priScreen = QGuiApplication::primaryScreen();-
426 if (!priScreen
!priScreenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
427 return;
never executed: return;
0
428 QPlatformScreen *screen = priScreen->handle();-
429 if (!screen
!screenDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
430 return;
never executed: return;
0
431 xcb_connection_t *connection = static_cast<QXcbScreen *>(screen)->xcb_connection();-
432 xcb_bell(connection, 0);-
433}
never executed: end of block
0
434-
435-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9