Mercurial > hg > syntilista
comparison src/main.cpp @ 178:2155e05bf61c
Use QShortcuts() instead of setShortcut().
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 25 Sep 2017 13:53:36 +0300 |
parents | 636a24c76232 |
children | a2f11e6665d6 |
comparison
equal
deleted
inserted
replaced
177:d119235d3df0 | 178:2155e05bf61c |
---|---|
382 ui->button_LogoImage->setAlignment(Qt::AlignCenter); | 382 ui->button_LogoImage->setAlignment(Qt::AlignCenter); |
383 | 383 |
384 slSetCommonStyleSheet(this); | 384 slSetCommonStyleSheet(this); |
385 | 385 |
386 // Validator for amount input | 386 // Validator for amount input |
387 //ui->edit_Amount->setValidator(new QDoubleValidator(0, 1000, 2, this)); | |
388 QRegExp vregex("\\d{0,4}[,.]\\d{0,2}|\\d{0,4}"); | 387 QRegExp vregex("\\d{0,4}[,.]\\d{0,2}|\\d{0,4}"); |
389 ui->edit_Amount->setValidator(new QRegExpValidator(vregex, this)); | 388 ui->edit_Amount->setValidator(new QRegExpValidator(vregex, this)); |
390 | 389 |
391 // Setup person list filtering and sorting | 390 // Setup person list filtering and sorting |
392 peopleSortIndex = 1; | 391 peopleSortIndex = 1; |
425 ui->tableview_Latest->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); | 424 ui->tableview_Latest->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); |
426 | 425 |
427 setActivePerson(-1); | 426 setActivePerson(-1); |
428 | 427 |
429 // Keyboard shortcuts | 428 // Keyboard shortcuts |
430 ui->button_Quit->setShortcut(QKeySequence(Qt::Key_F10)); | |
431 new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this, SLOT(on_button_Quit_clicked())); | 429 new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this, SLOT(on_button_Quit_clicked())); |
432 | 430 new QShortcut(QKeySequence(Qt::Key_F10), this, SLOT(on_button_Quit_clicked())); |
433 ui->button_AddPerson->setShortcut(QKeySequence(Qt::Key_F5)); | 431 |
434 ui->button_DeletePerson->setShortcut(QKeySequence(Qt::Key_F8)); | 432 new QShortcut(QKeySequence(Qt::Key_F5), this, SLOT(on_button_AddPerson_clicked())); |
435 ui->button_EditPerson->setShortcut(QKeySequence(Qt::Key_F6)); | 433 new QShortcut(QKeySequence(Qt::Key_F6), this, SLOT(on_button_EditPerson_clicked())); |
436 ui->button_ClearFilter->setShortcut(QKeySequence(Qt::Key_Escape)); | 434 new QShortcut(QKeySequence(Qt::Key_F8), this, SLOT(on_button_DeletePerson_clicked())); |
437 ui->button_About->setShortcut(QKeySequence(Qt::Key_F1)); | 435 new QShortcut(QKeySequence(Qt::Key_F1), this, SLOT(on_button_About_clicked())); |
436 new QShortcut(QKeySequence(Qt::Key_Escape), this, SLOT(on_button_ClearFilter_clicked())); | |
438 | 437 |
439 new QShortcut(QKeySequence(QKeySequence::ZoomIn), this, SLOT(changeUIZoomIn())); | 438 new QShortcut(QKeySequence(QKeySequence::ZoomIn), this, SLOT(changeUIZoomIn())); |
440 new QShortcut(QKeySequence(QKeySequence::ZoomOut), this, SLOT(changeUIZoomOut())); | 439 new QShortcut(QKeySequence(QKeySequence::ZoomOut), this, SLOT(changeUIZoomOut())); |
441 new QShortcut(QKeySequence(Qt::CTRL + Qt::KeypadModifier + Qt::Key_Plus), this, SLOT(changeUIZoomIn())); | 440 new QShortcut(QKeySequence(Qt::CTRL + Qt::KeypadModifier + Qt::Key_Plus), this, SLOT(changeUIZoomIn())); |
442 new QShortcut(QKeySequence(Qt::CTRL + Qt::KeypadModifier + Qt::Key_Minus), this, SLOT(changeUIZoomOut())); | 441 new QShortcut(QKeySequence(Qt::CTRL + Qt::KeypadModifier + Qt::Key_Minus), this, SLOT(changeUIZoomOut())); |