Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: Jan Gruuthuse on July 23, 2016, 06:19:48 AM

Title: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: Jan Gruuthuse on July 23, 2016, 06:19:48 AM
On Ubuntu 16.04.1 LTS QT5 avidemux 2.6.12 does not have working/show keyboard short cuts. This becomes an productivity issue.
Ctrl+X or Ctrl+Z or Ctrl+C or Ctrl+V
On Ubuntu 14.04.4 LTS these short cuts are showing and working
Was reported before: QT5 ubuntu 16.04 keyboard shortcuts (http://avidemux.org/smif/index.php/topic,16748.msg74646.html#msg74646)
Could you please look in to this matter?

I suspect a missing library or a condition in source why that code is not build/working?
Is the program detecting the localisation of the keyboard and posing a conflict with the system language?

build on basis of: Compiling Avidemux 2.6.x (http://www.avidemux.org/admWiki/doku.php?id=build:install_2.6)
with added: avidemux 2.6.12 Compiling Avidemux on Ubuntu 16.04.1 LTS (http://avidemux.org/smif/index.php/topic,16750.0.html)

1st screenshot 16.04.1 QT5 and application menu for Qt5
2nd screenshot 1404.4 QT4
3rd screenshot 16.04.1 QT5 application menu for Qt
Title: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x] 1st reply by eumagga0x2a
Post by: Jan Gruuthuse on July 23, 2016, 06:21:10 AM
Quote from: eumagga0x2a on July 22, 2016, 05:09:06 PM
FYI: On Fedora 24, the keyboard shortcuts are displayed in the menus correctly in a Qt5 build from the current git, but only few work correctly. E.g. Ctrl+V after Ctrl+X has no effect except of printing

  [pasteFromClipBoard]  Pasting from clipboard to [...]

in the terminal. "[" and "]" don't work too, but setting the markers work when selected from the menu via keyboard (I should check whether this work in a Qt4 build...).

>8>8 .... >8>8

Ubuntu 16.04.1 includes Qt 5.5.1, Ubuntu 14.04.4 Qt 5.2.1. Fedora 24 packages Qt 5.6.1.
Title: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x] 2nd reply by eumagga0x2a
Post by: Jan Gruuthuse on July 23, 2016, 06:22:06 AM
Quote from: eumagga0x2a on July 22, 2016, 05:50:32 PM
Meanwhile I was testing a qt4 build from the git and found that "[" and "]" work fine there. Pasting seems to be a special item and sort of broken like in the qt5 build.
Title: Re: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: Jan Gruuthuse on July 23, 2016, 06:30:26 AM
going over my install:

System Settings
System Language support:
Keyboard input method system: [IBus]

Title: Re: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: Jan Gruuthuse on July 23, 2016, 07:09:02 AM
by the way in Terminal this comes along:
QuotePaint event:
QWidget::paintEngine: Should no longer be called
Title: Re: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: eumagga0x2a on July 23, 2016, 10:41:30 AM
If I switch the input method to í•Å"ê¸â,¬ (Hangeul) all the keyboard shortcuts that worked with the keyboard set e.g. to German still work. This is with libinput 1.4.0, ibus 1.5.13 and gnome-shell 3.20.3.

I get the same warnings about QWidget::paintEngine too.
Title: Re: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: mean on July 23, 2016, 11:47:05 AM
My Qt5/16.04 versions looks like your Qt4 version
Are you running gnome ?
Title: Re: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: Jan Gruuthuse on July 23, 2016, 12:13:03 PM
no, unity
_____________________________________________
Avidemux v2.6.12 (e9287b0)
_____________________________________________
Compiler: GCC 5.4.0 20160609
cmake: 3.5.1
Build Target: Linux (x86-64)
User Interface: Qt (5.5.1)
_____________________________________________
Kernel: Linux 4.4.0-31-generic (x86_64) (linux-image-4.4.0-31-generic               4.4.0-31.50)
Distribution: Linux Ubuntu 16.04.1 (xenial)
_____________________________________________

Intel Core i7-3770K @ 3.50GHz (4 Cores/8 Threads) with 32 GB ram
_____________________________________________
Desktop: Unity 7.4.0
Display Server: X Server 1.18.3
Display Driver: NVIDIA 361.42
OpenGL: 4.5.0
Compiler: GCC 5.4.0 20160609 + CUDA 7.5
_____________________________________________
OpenGL Vendor: NVIDIA Corporation
OpenGL Renderer: GeForce GTX 960/PCIe/SSE2 2048MB (1227/3600MHz)
OpenGL: 4.5.0 NVIDIA  361.42
_____________________________________________
- vdpauinfo:API version: 1   NVIDIA VDPAU Driver Shared Library  361.42  Tue Mar 22 17:29:16 PDT 2016
_____________________________________________
- x264 --version: x264 0.148.2643 5c65704
(libswscale 3.1.101)
(libavformat 56.40.101)
(ffmpegsource 2.22.0.0)
built on Jan 18 2016, gcc: 5.3.1 20160114
x264 configuration: --bit-depth=8 --chroma-format=all
libx264 configuration: --bit-depth=8 --chroma-format=all
x264 license: GPL version 2 or later
libswscale/libavformat/ffmpegsource license: GPL version 2 or later
_____________________________________________
- x265 --version
x265 [info]: HEVC encoder version 1.9
x265 [info]: build info [Linux][GCC 5.3.1][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
_____________________________________________
Title: Re: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: eumagga0x2a on July 23, 2016, 01:48:08 PM
Do other Qt5 applications like qtcreator (http://packages.ubuntu.com/xenial/qtcreator) show the same problem? Do you have appmenu-qt5 installed? The bug https://bugs.launchpad.net/ubuntu/+source/ipe/+bug/1582329 (https://bugs.launchpad.net/ubuntu/+source/ipe/+bug/1582329) could be related then.
Title: Re: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: Jan Gruuthuse on July 23, 2016, 02:28:23 PM
both are installed:
dpkg -l appmenu-qt*
ii  appmenu-qt:amd64               0.2.7+14.04.20140305 amd64                application menu for Qt
ii  appmenu-qt5                    0.3.0+16.04.20151130 amd64                application menu for Qt5


removing  appmenu-qt5
ii  appmenu-qt:amd64               0.2.7+14.04.20140305 amd64                application menu for Qt
rc  appmenu-qt5                    0.3.0+16.04.20151130 amd64                application menu for Qt5

has partial shortcuts
Working: Ctrl+X or Ctrl+Z or Ctrl+C or Ctrl+V
Not working: [Alt gr] [ [ ] and [Alt gr] [ ] ]

see 3rd screenshot in 1st posting
Title: Re: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: Jan Gruuthuse on July 23, 2016, 02:37:53 PM
Is this of any help:
- Qt 5.7 Qt Widgets Menus Example (http://doc.qt.io/qt-5/qtwidgets-mainwindows-menus-example.html)
- QShortcut Class]=http://doc.qt.io/qt-5/qshortcut.html]QShortcut Class (http://=http://doc.qt.io/qt-5/qshortcut.html)
updated
Title: Re: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: eumagga0x2a on July 23, 2016, 02:49:43 PM
Quote from: Jan Gruuthuse on July 23, 2016, 02:28:23 PM
removing  appmenu-qt5 has partial shortcuts
Working: Ctrl+X or Ctrl+Z or Ctrl+C or Ctrl+V

Fine, the means the buggy appmenu-qt5 was the culprit.

(Off topic: Ctrl+V shortcut works, but the underlying function doesn't work right, IMHO.)

QuoteNot working: [Alt gr] [ [ ] and [Alt gr] [ ] ]

The same on Fedora with avidemux3_qt5. This could be an Avidemux bug then.
Title: Re: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: Jan Gruuthuse on July 23, 2016, 03:18:44 PM
Quote from: eumagga0x2a on July 23, 2016, 02:49:43 PMThe same on Fedora with avidemux3_qt5. This could be an Avidemux bug then.
I would not say a bug, rather some QT implementation change.
Title: Re: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: eumagga0x2a on July 26, 2016, 07:07:26 PM
Quote from: Jan Gruuthuse on July 23, 2016, 02:28:23 PM
Not working: [Alt gr] [ [ ] and [Alt gr] [ ] ]

The following patch fixes not working square brackets as keyboard shortcuts for "Set marker A" and "Set marker B" for me:

diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp
index 4780b20..adddecc 100644
--- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp
+++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp
@@ -689,13 +689,11 @@ bool MainWindow::eventFilter(QObject* watched, QEvent* event)
break;

case Qt::Key_BracketLeft:
-                                                if (keyEvent->modifiers() == Qt::ControlModifier)
-                                                        sendAction(ACT_GotoMarkA);
+ sendAction(ACT_MarkA);
                                                 return true;

case Qt::Key_BracketRight:
- if (keyEvent->modifiers() == Qt::ControlModifier)
- sendAction(ACT_GotoMarkB);
+ sendAction(ACT_MarkB);
return true;
}
}

Title: Re: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: mean on July 26, 2016, 07:48:17 PM
Indeed, the UI does not match the shortcut
Probably will change it to Page UP/Down to go and CTRL+page up/down to Set
The [] are a pain depending on the keyboard
Title: Re: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: eumagga0x2a on July 26, 2016, 08:39:09 PM
Quote from: mean on July 26, 2016, 07:48:17 PM
The [] are a pain depending on the keyboard

Oh, I see. Usually pressing a modifier key switches the layout temporarily back to English(?), so usual keybindings work regardless of the currect keyboard layout, but AltGr seems to be ignored by Qt (http://doc.qt.io/qt-5.6/qt.html#KeyboardModifier-enum), isn't it? Anyway, I should have tested with a non-latin layout...

So,

diff --git a/avidemux/common/ADM_commonUI/myOwnMenu.h b/avidemux/common/ADM_commonUI/myOwnMenu.h
index d8e68ce..5f2b4ba 100644
--- a/avidemux/common/ADM_commonUI/myOwnMenu.h
+++ b/avidemux/common/ADM_commonUI/myOwnMenu.h
@@ -58,8 +58,8 @@ static const MenuEntry _myMenuEdit[] = {
             {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Paste"),       NULL,ACT_Paste      ,NULL,"Ctrl+V"},
             {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Delete"),      NULL,ACT_Delete     ,NULL,"Delete"},
             {MENU_SEPARATOR,"-",NULL,ACT_DUMMY             ,NULL,NULL},
-            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker A"),NULL,ACT_MarkA      ,NULL,"["},
-            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker B"),NULL,ACT_MarkB      ,NULL,"]"},
+            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker A"),NULL,ACT_MarkA      ,NULL,"Ctrl+PgUp"},
+            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker B"),NULL,ACT_MarkB      ,NULL,"Ctrl+PgDown"},
             {MENU_SEPARATOR,"-",NULL,ACT_DUMMY             ,NULL,NULL},
             {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Preferences"), NULL,ACT_PREFERENCES,NULL,NULL},
             {MENU_SEPARATOR,"-",NULL,ACT_DUMMY             ,NULL,NULL},
diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp
index 4780b20..f3d3ac0 100644
--- a/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp
+++ b/avidemux/qt4/ADM_userInterfaces/ADM_gui/Q_gui2.cpp
@@ -688,14 +688,14 @@ bool MainWindow::eventFilter(QObject* watched, QEvent* event)
shiftKeyHeld = 1;
break;

- case Qt::Key_BracketLeft:
+ case Qt::Key_PageUp:
                                                 if (keyEvent->modifiers() == Qt::ControlModifier)
-                                                        sendAction(ACT_GotoMarkA);
+                                                        sendAction(ACT_MarkA);
                                                 return true;

- case Qt::Key_BracketRight:
+ case Qt::Key_PageDown:
if (keyEvent->modifiers() == Qt::ControlModifier)
- sendAction(ACT_GotoMarkB);
+ sendAction(ACT_MarkB);
return true;
}
}


would have done it <-- Sorry, I've missed that labels stem from avidemux/common/ADM_commonUI/myOwnMenu.h:61 Then probably all translations have to be modified ("PgUp" and "PgDown" are displayed not localized in German).

Thanks!
Title: Re: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: eumagga0x2a on July 30, 2016, 02:51:05 PM
Fixed by https://github.com/mean00/avidemux2/commit/98cdf41601c26cbae1b932106acd73f3b57a9c73 (https://github.com/mean00/avidemux2/commit/98cdf41601c26cbae1b932106acd73f3b57a9c73), thanks! Just a minor leftover:

grep -nRI "Set Marker A" . | grep -v i18n
./avidemux/common/ADM_commonUI/myOwnMenu.h:61:            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker A"),NULL,ACT_MarkA      ,NULL,"["},
./avidemux/qt4/common/ADM_commonUI/myOwnMenu.h:61:            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker A"),NULL,ACT_MarkA      ,NULL,"["},


(the "Edit" menu still shows "[" and "]" as shortcuts).
Title: Re: Shortcut ubuntu 16.4.1 QT5 [Ctrl][x]
Post by: eumagga0x2a on July 31, 2016, 08:04:44 AM
I'm sorry, but I need

diff --git a/avidemux/common/ADM_commonUI/myOwnMenu.h b/avidemux/common/ADM_commonUI/myOwnMenu.h
index 4a49ae8..5f2b4ba 100644
--- a/avidemux/common/ADM_commonUI/myOwnMenu.h
+++ b/avidemux/common/ADM_commonUI/myOwnMenu.h
@@ -59,7 +59,7 @@ static const MenuEntry _myMenuEdit[] = {
             {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Delete"),      NULL,ACT_Delete     ,NULL,"Delete"},
             {MENU_SEPARATOR,"-",NULL,ACT_DUMMY             ,NULL,NULL},
             {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker A"),NULL,ACT_MarkA      ,NULL,"Ctrl+PgUp"},
-            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker B"),NULL,ACT_MarkB      ,NULL,"Ctrl+PgDw"},
+            {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Set Marker B"),NULL,ACT_MarkB      ,NULL,"Ctrl+PgDown"},
             {MENU_SEPARATOR,"-",NULL,ACT_DUMMY             ,NULL,NULL},
             {MENU_ACTION,QT_TRANSLATE_NOOP("adm","Preferences"), NULL,ACT_PREFERENCES,NULL,NULL},
             {MENU_SEPARATOR,"-",NULL,ACT_DUMMY             ,NULL,NULL},


to make the keyboard shortcut for "Set Marker B" show in the "Edit" menu in the German locale (the shortcut worked anyway). It may be related to avidemux/qt4/i18n/qt_de.ts:3272 (other qt_*.ts files reference "PgDown" too), but I really don't know.