VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/extensions/QILineEdit.h@ 85150

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

FE/Qt: bugref:9515. Marking more widgets.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.0 KB
Line 
1/* $Id: QILineEdit.h 85150 2020-07-09 12:56:45Z vboxsync $ */
2/** @file
3 * VBox Qt GUI - Qt extensions: QILineEdit class declaration.
4 */
5
6/*
7 * Copyright (C) 2008-2020 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_QILineEdit_h
19#define FEQT_INCLUDED_SRC_extensions_QILineEdit_h
20#ifndef RT_WITHOUT_PRAGMA_ONCE
21# pragma once
22#endif
23
24/* Qt includes */
25#include <QLineEdit>
26
27/* GUI includes: */
28#include "UILibraryDefs.h"
29
30/** QLineEdit extension with advanced functionality. */
31class SHARED_LIBRARY_STUFF QILineEdit : public QLineEdit
32{
33 Q_OBJECT;
34
35public:
36
37 /** Constructs label-separator passing @a pParent to the base-class. */
38 QILineEdit(QWidget *pParent = 0);
39
40 /** Constructs label-separator passing @a pParent to the base-class.
41 * @param strContents Brings the line-edit text. */
42 QILineEdit(const QString &strContents, QWidget *pParent = 0)
43 : QLineEdit(strContents, pParent) {}
44
45 /** Forces line-edit to adjust minimum width acording to passed @a strText. */
46 void setMinimumWidthByText(const QString &strText);
47 /** Forces line-edit to adjust fixed width acording to passed @a strText. */
48 void setFixedWidthByText(const QString &strText);
49
50 /** Sets the color to some reddish color when @p fError is true. Usually used to indicate some error. */
51 void mark(bool fError);
52
53private:
54
55 /** Calculates suitable @a strText size. */
56 QSize featTextWidth(const QString &strText) const;
57 /** The original background base color. Used when marking/unmarking the combo box. */
58 QColor m_originalBaseColor;
59};
60
61#endif /* !FEQT_INCLUDED_SRC_extensions_QILineEdit_h */
Note: See TracBrowser for help on using the repository browser.

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