VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxUtils.h@ 76553

Last change on this file since 76553 was 76553, checked in by vboxsync, 6 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1/* $Id: VBoxUtils.h 76553 2019-01-01 01:45:53Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - Declarations of utility classes and functions.
4 */
5
6/*
7 * Copyright (C) 2006-2019 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 */
17
18#ifndef ___VBoxUtils_h___
19#define ___VBoxUtils_h___
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24/* Qt includes: */
25#include <QMouseEvent>
26#include <QWidget>
27#include <QTextBrowser>
28
29/* GUI includes: */
30#include "UILibraryDefs.h"
31#ifdef VBOX_WS_MAC
32# include "VBoxUtils-darwin.h"
33#endif
34
35/* Other VBox includes: */
36#include <iprt/types.h>
37
38
39/** QObject subclass,
40 * allowing to apply string-property value for a certain QObject. */
41class SHARED_LIBRARY_STUFF QObjectPropertySetter : public QObject
42{
43 Q_OBJECT;
44
45public:
46
47 /** Constructs setter for a property with certain @a strName, passing @a pParent to the base-class. */
48 QObjectPropertySetter(QObject *pParent, const QString &strName)
49 : QObject(pParent), m_strName(strName)
50 {}
51
52public slots:
53
54 /** Assigns string property @a strValue. */
55 void sltAssignProperty(const QString &strValue)
56 {
57 parent()->setProperty(m_strName.toLatin1().constData(), strValue);
58 }
59
60private:
61
62 /** Holds the property name. */
63 const QString m_strName;
64};
65
66
67#endif /* !___VBoxUtils_h___ */
68
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette