MCPcopy Create free account
hub / github.com/Zalafina/QKeyMapper / initKeyboardDeviceTable

Method initKeyboardDeviceTable

QKeyMapper/qinputdevicelistwindow.cpp:370–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368}
369
370void QInputDeviceListWindow::initKeyboardDeviceTable()
371{
372 ui->keyboardDeviceTable->setFocusPolicy(Qt::NoFocus);
373 ui->keyboardDeviceTable->setColumnCount(KEYBOARD_TABLE_COLUMN_COUNT);
374 ui->keyboardDeviceTable->horizontalHeader()->setStretchLastSection(true);
375 ui->keyboardDeviceTable->horizontalHeader()->setHighlightSections(false);
376 ui->keyboardDeviceTable->verticalHeader()->setVisible(false);
377 ui->keyboardDeviceTable->verticalHeader()->setDefaultSectionSize(25);
378 ui->keyboardDeviceTable->setSelectionBehavior(QAbstractItemView::SelectRows);
379 ui->keyboardDeviceTable->setSelectionMode(QAbstractItemView::NoSelection);
380 ui->keyboardDeviceTable->setEditTriggers(QAbstractItemView::NoEditTriggers);
381
382 int number_width = 26;
383 int devicedesc_width = ui->keyboardDeviceTable->width()/7;
384 int vendorid_width = 60;
385 int productid_width = 60;
386 int vendorstr_width = ui->keyboardDeviceTable->width()/7 - 40;
387 int productstr_width = ui->keyboardDeviceTable->width()/5 - 30;
388 int manufacturer_width = vendorstr_width;
389 int disable_width = 30;
390 int hardwareid_width = ui->keyboardDeviceTable->width() - number_width - devicedesc_width - vendorid_width - productid_width - vendorstr_width - productstr_width - manufacturer_width - disable_width - 12;
391
392 ui->keyboardDeviceTable->setColumnWidth(DEVICE_TABLE_NUMBER_COLUMN, number_width);
393 ui->keyboardDeviceTable->setColumnWidth(DEVICE_TABLE_DEVICEDESC_COLUMN, devicedesc_width);
394 ui->keyboardDeviceTable->setColumnWidth(DEVICE_TABLE_HARDWAREID_COLUMN, hardwareid_width);
395 ui->keyboardDeviceTable->setColumnWidth(DEVICE_TABLE_VENDORID_COLUMN, vendorid_width);
396 ui->keyboardDeviceTable->setColumnWidth(DEVICE_TABLE_PRODUCTID_COLUMN, productid_width);
397 ui->keyboardDeviceTable->setColumnWidth(DEVICE_TABLE_VENDORSTR_COLUMN, vendorstr_width);
398 ui->keyboardDeviceTable->setColumnWidth(DEVICE_TABLE_PRODUCTSTR_COLUMN, productstr_width);
399 ui->keyboardDeviceTable->setColumnWidth(DEVICE_TABLE_MANUFACTURER_COLUMN, manufacturer_width);
400 ui->keyboardDeviceTable->setColumnWidth(DEVICE_TABLE_DISABLE_COLUMN, disable_width);
401}
402
403void QInputDeviceListWindow::initMouseDeviceTable()
404{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected