VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/include/QILabel.h@ 19223

Last change on this file since 19223 was 16955, checked in by vboxsync, 16 years ago

FE/Qt4: 1 - Update QILabel to support minimum width setter. 2 - Update QILabel to maintain custom minimum size hint policy. These updates are necessary for word-wrapping feature.

  • 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 void setMinimumWidth (int aMinWidth);
73 QString text() const;
74 Qt::TextFormat textFormat() const;
75 Qt::TextInteractionFlags textInteractionFlags() const;
76 bool wordWrap() const;
77
78 /* Default QWidget methods */
79 void setSizePolicy (QSizePolicy aPolicy);
80 void setMinimumSize (const QSize &aSize);
81
82public slots:
83
84 void clear();
85 void setMovie (QMovie *aMovie);
86 void setNum (int aNum);
87 void setNum (double aNum);
88 void setPicture (const QPicture &aPicture);
89 void setPixmap (const QPixmap &aPixmap);
90 void setText (const QString &aText);
91
92signals:
93
94 void linkActivated (const QString &);
95 void linkHovered (const QString &);
96
97protected:
98
99 virtual void init();
100
101 /* Protected member vars */
102 QILabelPrivate *mLabel;
103};
104
105#endif // __QILabel_h__
106
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