VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIStyledItemDelegate.h@ 82781

Last change on this file since 82781 was 76581, checked in by vboxsync, 5 years ago

Fe/QT: scm header guard alignment.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1/* $Id: QIStyledItemDelegate.h 76581 2019-01-01 06:24:57Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - Qt extensions: QIStyledItemDelegate class declaration.
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 FEQT_INCLUDED_SRC_extensions_QIStyledItemDelegate_h
19#define FEQT_INCLUDED_SRC_extensions_QIStyledItemDelegate_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24/* Qt includes: */
25#include <QStyledItemDelegate>
26
27/* GUI includes: */
28#include "UILibraryDefs.h"
29
30/** QStyledItemDelegate subclass extending standard functionality. */
31class SHARED_LIBRARY_STUFF QIStyledItemDelegate : public QStyledItemDelegate
32{
33 Q_OBJECT;
34
35signals:
36
37 /** Notifies listeners about @a pEditor created for particular model @a index. */
38 void sigEditorCreated(QWidget *pEditor, const QModelIndex &index) const;
39
40 /** Notifies listeners about editor's Enter key triggering. */
41 void sigEditorEnterKeyTriggered();
42
43public:
44
45 /** Constructs delegate passing @a pParent to the base-class. */
46 QIStyledItemDelegate(QObject *pParent);
47
48 /** Defines whether delegate should watch for the editor's data commits. */
49 void setWatchForEditorDataCommits(bool fWatch);
50 /** Defines whether delegate should watch for the editor's Enter key triggering. */
51 void setWatchForEditorEnterKeyTriggering(bool fWatch);
52
53protected:
54
55 /** Returns the widget used to edit the item specified by @a index.
56 * The @a pParent widget and style @a option are used to control how the editor widget appears. */
57 virtual QWidget *createEditor(QWidget *pParent,
58 const QStyleOptionViewItem &option,
59 const QModelIndex &index) const /* override */;
60
61private:
62
63 /** Holds whether delegate should watch for the editor's data commits. */
64 bool m_fWatchForEditorDataCommits : 1;
65 /** Holds whether delegate should watch for the editor's Enter key triggering. */
66 bool m_fWatchForEditorEnterKeyTriggering : 1;
67};
68
69#endif /* !FEQT_INCLUDED_SRC_extensions_QIStyledItemDelegate_h */
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use