MCPcopy Create free account
hub / github.com/SaschaWillems/VulkanCapsViewer / VulkanCapsViewer

Method VulkanCapsViewer

vulkanCapsViewer.cpp:156–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154#endif
155
156VulkanCapsViewer::VulkanCapsViewer(QWidget *parent)
157 : QMainWindow(parent)
158{
159 // Set current working directory to writable document folder
160#if defined(VK_USE_PLATFROM_IOS_MVK)
161 setWorkingFolderForiOS();
162#endif
163
164 ui.setupUi(this);
165 setWindowTitle("Vulkan Hardware Capability Viewer " + version);
166 // Connect slots
167 connect(ui.comboBoxGPU, SIGNAL(currentIndexChanged(int)), this, SLOT(slotComboBoxGPUIndexChanged(int)), Qt::QueuedConnection);
168 connect(ui.toolButtonUpload, SIGNAL(pressed()), this, SLOT(slotUploadReport()), Qt::QueuedConnection);
169 connect(ui.toolButtonSave, SIGNAL(pressed()), this, SLOT(slotSaveReport()), Qt::QueuedConnection);
170 connect(ui.toolButtonOnlineDevice, SIGNAL(pressed()), this, SLOT(slotDisplayOnlineReport()), Qt::QueuedConnection);
171 connect(ui.toolButtonOnlineDataBase, SIGNAL(pressed()), this, SLOT(slotBrowseDatabase()), Qt::QueuedConnection);
172 connect(ui.toolButtonAbout, SIGNAL(pressed()), this, SLOT(slotAbout()), Qt::QueuedConnection);
173 connect(ui.toolButtonExit, SIGNAL(pressed()), this, SLOT(slotClose()), Qt::QueuedConnection);
174 connect(ui.toolButtonSettings, SIGNAL(pressed()), this, SLOT(slotSettings()), Qt::QueuedConnection);
175 connect(ui.comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(slotComboTabChanged(int)), Qt::QueuedConnection);
176
177 QPalette palette;
178 palette.setColor(QPalette::Highlight, QColor(0, 120, 215));
179 palette.setColor(QPalette::Link, QColor(0, 120, 215));
180 qApp->setPalette(palette);
181 qApp->setStyle(QStyleFactory::create("Fusion"));
182 boldFont.setBold(true);
183
184 ui.label_header_top->setText(ui.label_header_top->text() + " " + version);
185
186
187#ifdef ANDROID
188 // Load Vulkan libraries on Android manually
189 if (!loadVulkanLibrary()) {
190 QMessageBox::warning(this, "Error", "Could not initialize Vulkan!\n\nPlease make sure that this device actually supports the Vulkan API.");
191 exit(EXIT_FAILURE);
192 }
193#endif
194
195#if defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_ANDROID_KHR)
196 // Adjust toolbar to better fit mobile devices
197 foreach (QToolButton *toolButton, findChildren<QToolButton *>()) {
198 toolButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
199 }
200 ui.toolButtonSave->setVisible(false);
201 // Touch scrolling
202 foreach (QTreeView *widget, findChildren<QTreeWidget *>()) {
203 setTouchProps(widget);
204 widget->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
205 widget->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
206 widget->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
207 widget->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
208 widget->setSelectionMode(QAbstractItemView::NoSelection);
209 widget->setFrameStyle(QFrame::NoFrame);
210 }
211
212 foreach (QTreeView *widget, findChildren<QTreeView *>()) {
213 setTouchProps(widget);

Callers

nothing calls this directly

Calls 1

loadVulkanLibraryFunction · 0.85

Tested by

no test coverage detected