diff options
Diffstat (limited to 'qmidiplayer-desktop')
-rw-r--r-- | qmidiplayer-desktop/main.cpp | 2 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpchannelswindow.cpp | 13 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpchannelswindow.hpp | 3 | ||||
-rw-r--r-- | qmidiplayer-desktop/qmpmainwindow.cpp | 7 |
4 files changed, 23 insertions, 2 deletions
diff --git a/qmidiplayer-desktop/main.cpp b/qmidiplayer-desktop/main.cpp index a2375ca..f62429c 100644 --- a/qmidiplayer-desktop/main.cpp +++ b/qmidiplayer-desktop/main.cpp @@ -24,6 +24,8 @@ int main(int argc,char **argv) { QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); + if(!qgetenv("QT_SCALE_FACTOR").length()&&!qgetenv("QT_SCREEN_SCALE_FACTORS").length()) + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QApplication a(argc,argv); QTranslator qtTranslator; qtTranslator.load("qt_"+QLocale::system().name(), diff --git a/qmidiplayer-desktop/qmpchannelswindow.cpp b/qmidiplayer-desktop/qmpchannelswindow.cpp index 6b1b8b4..3b54069 100644 --- a/qmidiplayer-desktop/qmpchannelswindow.cpp +++ b/qmidiplayer-desktop/qmpchannelswindow.cpp @@ -71,6 +71,7 @@ qmpChannelsWindow::qmpChannelsWindow(QWidget *parent) : ui->twChannels->setColumnWidth(3,192); ui->twChannels->setColumnWidth(4,208); ui->twChannels->setColumnWidth(5,32); + ui->twChannels->installEventFilter(this); qmpMainWindow::getInstance()->registerFunctionality( chnlf=new qmpChannelFunc(this), std::string("Channel"), @@ -224,6 +225,18 @@ void qmpChannelsWindow::changeMidiMapping(int chid,int idx) qmpMainWindow::getInstance()->getPlayer()->setChannelOutput(chid,idx); } +bool qmpChannelsWindow::eventFilter(QObject *o,QEvent *e) +{ + if(e->type()==QEvent::KeyPress&&ui->twChannels->currentColumn()==4) + { + QKeyEvent *ke=static_cast<QKeyEvent*>(e); + if(ke->key()!=Qt::Key_Enter&&ke->key()!=Qt::Key_Return)return false; + showPresetWindow(ui->twChannels->currentRow(),4); + return true; + } + return false; +} + qmpChannelFunc::qmpChannelFunc(qmpChannelsWindow *par) {p=par;} void qmpChannelFunc::show() diff --git a/qmidiplayer-desktop/qmpchannelswindow.hpp b/qmidiplayer-desktop/qmpchannelswindow.hpp index 9ff0cd0..cb7b791 100644 --- a/qmidiplayer-desktop/qmpchannelswindow.hpp +++ b/qmidiplayer-desktop/qmpchannelswindow.hpp @@ -90,6 +90,9 @@ class qmpChannelsWindow:public QWidget void on_pbUnmute_clicked(); void on_pbUnsolo_clicked(); + protected: + bool eventFilter(QObject *o,QEvent *e); + private: Ui::qmpChannelsWindow *ui; qmpPresetSelector *pselectw; diff --git a/qmidiplayer-desktop/qmpmainwindow.cpp b/qmidiplayer-desktop/qmpmainwindow.cpp index 335a3c5..baebe4f 100644 --- a/qmidiplayer-desktop/qmpmainwindow.cpp +++ b/qmidiplayer-desktop/qmpmainwindow.cpp @@ -177,8 +177,11 @@ void qmpMainWindow::closeEvent(QCloseEvent *event) } on_pbStop_clicked();fin=true; for(auto i=mfunc.begin();i!=mfunc.end();++i) - i->second.setAssignedControl((QReflectiveAction*)NULL), - i->second.setAssignedControl((QReflectivePushButton*)NULL); + { + i->second.i()->close(); + i->second.setAssignedControl((QReflectiveAction*)NULL), + i->second.setAssignedControl((QReflectivePushButton*)NULL); + } efxw->close();chnlw->close(); plistw->close();infow->close(); settingsw->close(); |