Fix ActionToolBar/PrivateActionToolButton in combination with QQC2 Action

Authored by ahiemstra on Feb 25 2020, 2:49 PM.

Description

Fix ActionToolBar/PrivateActionToolButton in combination with QQC2 Action

Summary:
This applies a few fixes to ActionToolBar and PrivateActionToolButton when
used in combination with QtQuick Controls 2's Action instead of
Kirigami.Action. It is a more elaborate version of D27638 .

  • Properly check if PrivateActionToolButton should be visible
  • Use hasOwnProperty for checking property exists and write out everything
  • Don't try to use tooltip property that may not be defined

Test Plan:
Kirigami Gallery still shows actions correctly.
A test QML with QQC2 actions shows them correct.

(I have an autotest for ActionToolBar in the works that will include a
tests with QQC2 Action)

Reviewers: Kirigami, mart

Reviewed By: Kirigami, mart

Subscribers: camiloh, ognarb, plasma-devel

Tags: Kirigami

Differential Revision: https://phabricator.kde.org/D27653

Details