VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIDragAndDropEditor.h

Last change on this file was 104313, checked in by vboxsync, 7 weeks ago

FE/Qt. bugref:10622. Using new UITranslationEventListener in the settings related GUI classes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/* $Id: UIDragAndDropEditor.h 104313 2024-04-12 13:10:30Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - UIDragAndDropEditor class declaration.
4 */
5
6/*
7 * Copyright (C) 2019-2023 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * SPDX-License-Identifier: GPL-3.0-only
26 */
27
28#ifndef FEQT_INCLUDED_SRC_settings_editors_UIDragAndDropEditor_h
29#define FEQT_INCLUDED_SRC_settings_editors_UIDragAndDropEditor_h
30#ifndef RT_WITHOUT_PRAGMA_ONCE
31# pragma once
32#endif
33
34/* GUI includes: */
35#include "UIEditor.h"
36
37/* COM includes: */
38#include "KDnDMode.h"
39
40/* Forward declarations: */
41class QComboBox;
42class QGridLayout;
43class QLabel;
44
45/** UIEditor sub-class used as a drag&drop editor. */
46class SHARED_LIBRARY_STUFF UIDragAndDropEditor : public UIEditor
47{
48 Q_OBJECT;
49
50public:
51
52 /** Constructs editor passing @a pParent to the base-class. */
53 UIDragAndDropEditor(QWidget *pParent = 0);
54
55 /** Defines editor @a enmValue. */
56 void setValue(KDnDMode enmValue);
57 /** Returns editor value. */
58 KDnDMode value() const;
59
60 /** Returns the vector of supported values. */
61 QVector<KDnDMode> supportedValues() const { return m_supportedValues; }
62
63 /** Returns minimum layout hint. */
64 int minimumLabelHorizontalHint() const;
65 /** Defines minimum layout @a iIndent. */
66 void setMinimumLayoutIndent(int iIndent);
67
68private slots:
69
70 /** Handles translation event. */
71 virtual void sltRetranslateUI() RT_OVERRIDE RT_FINAL;
72
73private:
74
75 /** Prepares all. */
76 void prepare();
77 /** Populates combo. */
78 void populateCombo();
79
80 /** Holds the value to be selected. */
81 KDnDMode m_enmValue;
82
83 /** Holds the vector of supported values. */
84 QVector<KDnDMode> m_supportedValues;
85
86 /** Holds the main layout instance. */
87 QGridLayout *m_pLayout;
88 /** Holds the label instance. */
89 QLabel *m_pLabel;
90 /** Holds the combo instance. */
91 QComboBox *m_pCombo;
92};
93
94#endif /* !FEQT_INCLUDED_SRC_settings_editors_UIDragAndDropEditor_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use