Changeset 24002 in vbox for trunk/src/VBox/Frontends/VirtualBox/include/QILabel.h
- Timestamp:
- Oct 22, 2009 11:44:58 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 53839
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/QILabel.h
r16955 r24002 6 6 7 7 /* 8 * Copyright (C) 2006-200 8Sun Microsystems, Inc.8 * Copyright (C) 2006-2009 Sun Microsystems, Inc. 9 9 * 10 10 * This file is part of VirtualBox Open Source Edition (OSE), as … … 28 28 #define __QILabel_h__ 29 29 30 /* Qtincludes */31 #include <Q Frame>30 /* Global includes */ 31 #include <QLabel> 32 32 33 class QILabelPrivate; 34 35 class QILabel: public QWidget 33 class QILabel: public QLabel 36 34 { 37 35 Q_OBJECT; … … 39 37 public: 40 38 41 QILabel (QWidget *aParent = NULL, Qt::WindowFlags aFlags = 0);42 QILabel (const QString &aText, QWidget *aParent = NULL, Qt::WindowFlags aFlags = 0);39 QILabel (QWidget *aParent = 0, Qt::WindowFlags aFlags = 0); 40 QILabel (const QString &aText, QWidget *aParent = 0, Qt::WindowFlags aFlags = 0); 43 41 44 /* QLabelextensions */45 bool fullSizeSelection 46 void setFullSizeSelection (bool bOn);42 /* Focusing extensions */ 43 bool fullSizeSelection() const; 44 void setFullSizeSelection (bool aEnabled); 47 45 48 void updateSizeHint(); 46 /* Size-Hint extensions */ 47 void useSizeHintForWidth (int aWidthHint) const; 48 QSize sizeHint() const; 49 QSize minimumSizeHint() const; 49 50 50 51 /* 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 52 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 53 82 54 public slots: 83 55 84 56 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 57 void setText (const QString &aText); 91 92 signals: 93 94 void linkActivated (const QString &); 95 void linkHovered (const QString &); 58 void copy(); 96 59 97 60 protected: 98 61 99 virtual void init(); 62 void resizeEvent (QResizeEvent *aEvent); 63 void mousePressEvent (QMouseEvent *aEvent); 64 void mouseReleaseEvent (QMouseEvent *aEvent); 65 void mouseMoveEvent (QMouseEvent *aEvent); 66 void contextMenuEvent (QContextMenuEvent *aEvent); 67 void focusInEvent (QFocusEvent *aEvent); 68 void focusOutEvent (QFocusEvent *aEvent); 69 void paintEvent (QPaintEvent *aEvent); 100 70 101 /* Protected member vars */ 102 QILabelPrivate *mLabel; 71 private: 72 73 void init(); 74 75 void updateSizeHint() const; 76 void setFullText (const QString &aText); 77 void updateText(); 78 QString removeHtmlTags (QString aText) const; 79 Qt::TextElideMode toTextElideMode (const QString& aStr) const; 80 QString compressText (const QString &aText) const; 81 82 QString mText; 83 bool mFullSizeSelection; 84 static const QRegExp mCopyRegExp; 85 static QRegExp mElideRegExp; 86 mutable bool mIsHintValid; 87 mutable int mWidthHint; 88 mutable QSize mOwnSizeHint; 89 bool mStartDragging; 90 QAction *mCopyAction; 103 91 }; 104 92
Note:
See TracChangeset
for help on using the changeset viewer.