VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox4/include/QILabel.h@ 10701

Last change on this file since 10701 was 9968, checked in by vboxsync, 17 years ago

Fe/Qt4: Slightly extend the QILabel api to let to:

  • get the frame width
  • set the frame shape
  • set the frame shadow
  • make the label adjust it's height if it is fixed and text requires more space.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Revision Author Id
File size: 2.9 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * VirtualBox Qt extensions: QILabel class declaration
5 */
6
7/*
8 * Copyright (C) 2006-2008 Sun Microsystems, Inc.
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
19 * Clara, CA 95054 USA or visit http://www.sun.com if you need
20 * additional information or have any questions.
21 */
22
23/*
24 * This class is based on the original QLabel implementation.
25 */
26
27#ifndef __QILabel_h__
28#define __QILabel_h__
29
30/* Qt includes */
31#include <QFrame>
32
33class QILabelPrivate;
34
35class QILabel: public QWidget
36{
37 Q_OBJECT;
38
39public:
40
41 QILabel (QWidget *aParent = NULL, Qt::WindowFlags aFlags = 0);
42 QILabel (const QString &aText, QWidget *aParent = NULL, Qt::WindowFlags aFlags = 0);
43
44 /* QLabel extensions */
45 bool fullSizeSelection () const;
46 void setFullSizeSelection (bool bOn);
47
48 void updateSizeHint();
49
50 /* Default QLabel methods */
51 Qt::Alignment alignment() const;
52 QWidget * buddy() const;
53 int frameWidth() const;
54 bool hasScaledContents() const;
55 int indent() const;
56 int margin() const;
57 QMovie *movie() const;
58 bool openExternalLinks() const;
59 const QPicture *picture() const;
60 const QPixmap *pixmap() const;
61 void setAlignment (Qt::Alignment aAlignment);
62 void setBuddy (QWidget *aBuddy);
63 void setFrameShadow (QFrame::Shadow aShadow);
64 void setFrameShape (QFrame::Shape aShape);
65 void setIndent (int aIndent);
66 void setMargin (int aMargin);
67 void setOpenExternalLinks (bool aOpen);
68 void setScaledContents (bool aOn);
69 void setTextFormat (Qt::TextFormat aFormat);
70 void setTextInteractionFlags (Qt::TextInteractionFlags aFlags);
71 void setWordWrap (bool aOn);
72 QString text() const;
73 Qt::TextFormat textFormat() const;
74 Qt::TextInteractionFlags textInteractionFlags() const;
75 bool wordWrap() const;
76
77 /* Default QWidget methods */
78 void setSizePolicy (QSizePolicy aPolicy);
79 void setMinimumSize (const QSize &aSize);
80
81public slots:
82
83 void clear();
84 void setMovie (QMovie *aMovie);
85 void setNum (int aNum);
86 void setNum (double aNum);
87 void setPicture (const QPicture &aPicture);
88 void setPixmap (const QPixmap &aPixmap);
89 void setText (const QString &aText);
90
91signals:
92
93 void linkActivated (const QString &);
94 void linkHovered (const QString &);
95
96protected:
97
98 virtual void init();
99
100 /* Protected member vars */
101 QILabelPrivate *mLabel;
102};
103
104#endif // __QILabel_h__
105
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