| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- /****************************************************************************
- **
- ** Copyright (C) 2021 The Qt Company Ltd.
- ** Contact: https://www.qt.io/licensing/
- **
- ** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
- **
- ** $QT_BEGIN_LICENSE:COMM$
- **
- ** Commercial License Usage
- ** Licensees holding valid commercial Qt licenses may use this file in
- ** accordance with the commercial license agreement provided with the
- ** Software or, alternatively, in accordance with the terms contained in
- ** a written agreement between you and The Qt Company. For licensing terms
- ** and conditions see https://www.qt.io/terms-conditions. For further
- ** information use the contact form at https://www.qt.io/contact-us.
- **
- ** $QT_END_LICENSE$
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- **
- ****************************************************************************/
- import QtQuick 2.12
- import QtQuick.Controls 2.12
- import QtQuick.Controls.impl 2.12
- import QtQuick.Templates 2.12 as T
- T.ToolTip {
- id: control
- x: parent ? (parent.width - implicitWidth) / 2 : 0
- y: -implicitHeight - 3
- implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
- contentWidth + leftPadding + rightPadding)
- implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
- contentHeight + topPadding + bottomPadding)
- margins: 6
- padding: 6
- closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent
- contentItem: Text {
- text: control.text
- font: control.font
- wrapMode: Text.Wrap
- color: control.palette.toolTipText
- }
- background: Rectangle {
- border.color: control.palette.dark
- color: control.palette.toolTipBase
- }
- }
|