- Timestamp:
- Apr 16, 2018 2:23:01 PM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
r71865 r71866 441 441 src/UITakeSnapshotDialog.h \ 442 442 src/extensions/QIFlowLayout.h \ 443 src/extensions/QILabelSeparator.h \444 443 src/extensions/QIMainDialog.h \ 445 444 src/extensions/QIManagerDialog.h \ … … 658 657 src/extensions/QIFileDialog.h \ 659 658 src/extensions/QILabel.h \ 659 src/extensions/QILabelSeparator.h \ 660 660 src/extensions/QIMainWindow.h \ 661 661 src/extensions/QIMessageBox.h \ … … 732 732 src/extensions/QIFileDialog.h \ 733 733 src/extensions/QILabel.h \ 734 src/extensions/QILabelSeparator.h \ 734 735 src/extensions/QIMainWindow.h \ 735 736 src/extensions/QIMessageBox.h \ … … 906 907 src/UITakeSnapshotDialog.cpp \ 907 908 src/extensions/QIFlowLayout.cpp \ 908 src/extensions/QILabelSeparator.cpp \909 909 src/extensions/QILineEdit.cpp \ 910 910 src/extensions/QIMainDialog.cpp \ … … 1156 1156 src/extensions/QIFileDialog.cpp \ 1157 1157 src/extensions/QILabel.cpp \ 1158 src/extensions/QILabelSeparator.cpp \ 1158 1159 src/extensions/QIMainWindow.cpp \ 1159 1160 src/extensions/QIMessageBox.cpp \ … … 1257 1258 src/extensions/QIFileDialog.cpp \ 1258 1259 src/extensions/QILabel.cpp \ 1260 src/extensions/QILabelSeparator.cpp \ 1259 1261 src/extensions/QIMainWindow.cpp \ 1260 1262 src/extensions/QIMessageBox.cpp \ -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QILabelSeparator.cpp
r69500 r71866 1 1 /* $Id$ */ 2 2 /** @file 3 * VBox Qt GUI - VirtualBoxQt extensions: QILabelSeparator class implementation.3 * VBox Qt GUI - Qt extensions: QILabelSeparator class implementation. 4 4 */ 5 5 6 6 /* 7 * Copyright (C) 2008-201 7Oracle Corporation7 * Copyright (C) 2008-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 20 20 #else /* !VBOX_WITH_PRECOMPILED_HEADERS */ 21 21 22 /* Global includes */ 22 /* Qt includes: */ 23 # include <QHBoxLayout> 23 24 # include <QLabel> 24 # include <QHBoxLayout>25 25 26 /* Local includes*/26 /* GUI includes: */ 27 27 # include "QILabelSeparator.h" 28 28 … … 30 30 31 31 32 QILabelSeparator::QILabelSeparator (QWidget *aParent /* = NULL */, Qt::WindowFlags aFlags /* = 0 */)33 : QWidget (aParent, aFlags)34 , m Label(0)32 QILabelSeparator::QILabelSeparator(QWidget *pParent /* = 0 */, Qt::WindowFlags fFlags /* = 0 */) 33 : QWidget(pParent, fFlags) 34 , m_pLabel(0) 35 35 { 36 init();36 prepare(); 37 37 } 38 38 39 QILabelSeparator::QILabelSeparator (const QString &aText, QWidget *aParent /* = NULL */, Qt::WindowFlags aFlags /* = 0 */)40 : QWidget (aParent, aFlags)41 , m Label(0)39 QILabelSeparator::QILabelSeparator(const QString &strText, QWidget *pParent /* = 0 */, Qt::WindowFlags fFlags /* = 0 */) 40 : QWidget(pParent, fFlags) 41 , m_pLabel(0) 42 42 { 43 init();44 setText (aText);43 prepare(); 44 setText(strText); 45 45 } 46 46 47 47 QString QILabelSeparator::text() const 48 48 { 49 return m Label->text();49 return m_pLabel->text(); 50 50 } 51 51 52 void QILabelSeparator::setBuddy (QWidget *aBuddy)52 void QILabelSeparator::setBuddy(QWidget *pBuddy) 53 53 { 54 m Label->setBuddy (aBuddy);54 m_pLabel->setBuddy(pBuddy); 55 55 } 56 56 57 57 void QILabelSeparator::clear() 58 58 { 59 m Label->clear();59 m_pLabel->clear(); 60 60 } 61 61 62 void QILabelSeparator::setText (const QString &aText)62 void QILabelSeparator::setText(const QString &strText) 63 63 { 64 m Label->setText (aText);64 m_pLabel->setText(strText); 65 65 } 66 66 67 void QILabelSeparator:: init()67 void QILabelSeparator::prepare() 68 68 { 69 mLabel = new QLabel(); 70 QFrame *separator = new QFrame(); 71 separator->setFrameShape (QFrame::HLine); 72 separator->setFrameShadow (QFrame::Sunken); 73 separator->setEnabled (false); 74 separator->setContentsMargins (0, 0, 0, 0); 75 // separator->setStyleSheet ("QFrame {border: 1px outset black; }"); 76 separator->setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); 69 /* Create layout: */ 70 QHBoxLayout *pLayout = new QHBoxLayout(this); 71 if (pLayout) 72 { 73 /* Configure layout: */ 74 pLayout->setContentsMargins(0, 0, 0, 0); 77 75 78 QHBoxLayout *pLayout = new QHBoxLayout (this); 79 pLayout->setContentsMargins(0, 0, 0, 0); 80 pLayout->addWidget (mLabel); 81 pLayout->addWidget (separator, Qt::AlignBottom); 76 /* Create label: */ 77 m_pLabel = new QLabel; 78 if (m_pLabel) 79 { 80 /* Add into layout: */ 81 pLayout->addWidget(m_pLabel); 82 } 83 84 /* Create separator: */ 85 QFrame *pSeparator = new QFrame; 86 { 87 /* Configure separator: */ 88 pSeparator->setFrameShape(QFrame::HLine); 89 pSeparator->setFrameShadow(QFrame::Sunken); 90 pSeparator->setEnabled(false); 91 pSeparator->setContentsMargins(0, 0, 0, 0); 92 // pSeparator->setStyleSheet("QFrame {border: 1px outset black; }"); 93 pSeparator->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred); 94 95 /* Add into layout: */ 96 pLayout->addWidget(pSeparator, Qt::AlignBottom); 97 } 98 } 82 99 } 83 -
trunk/src/VBox/Frontends/VirtualBox/src/extensions/QILabelSeparator.h
r69500 r71866 5 5 6 6 /* 7 * Copyright (C) 2008-201 7Oracle Corporation7 * Copyright (C) 2008-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 16 16 */ 17 17 18 #ifndef __ QILabelSeparator_h__19 #define __ QILabelSeparator_h__18 #ifndef ___QILabelSeparator_h___ 19 #define ___QILabelSeparator_h___ 20 20 21 /* Global includes*/21 /* Qt includes: */ 22 22 #include <QWidget> 23 23 24 /* Global forwards */ 24 /* GUI inlcudes: */ 25 #include "UILibraryDefs.h" 26 27 /* Forward declarations: */ 25 28 class QLabel; 29 class QString; 30 class QWidget; 26 31 27 class QILabelSeparator: public QWidget 32 /** QWidget extension providing GUI with label-separator. */ 33 class SHARED_LIBRARY_STUFF QILabelSeparator : public QWidget 28 34 { 29 35 Q_OBJECT; … … 31 37 public: 32 38 33 QILabelSeparator (QWidget *aParent = 0, Qt::WindowFlags aFlags = 0); 34 QILabelSeparator (const QString &aText, QWidget *aParent = 0, Qt::WindowFlags aFlags = 0); 39 /** Constructs label-separator passing @a pParent and @a fFlags to the base-class. */ 40 QILabelSeparator(QWidget *pParent = 0, Qt::WindowFlags fFlags = 0); 41 /** Constructs label-separator passing @a pParent and @a fFlags to the base-class. 42 * @param strText Brings the label text. */ 43 QILabelSeparator(const QString &strText, QWidget *pParent = 0, Qt::WindowFlags fFlags = 0); 35 44 45 /** Returns the label text. */ 36 46 QString text() const; 37 void setBuddy (QWidget *aBuddy); 47 /** Defines the label buddy. */ 48 void setBuddy(QWidget *pBuddy); 38 49 39 50 public slots: 40 51 52 /** Clears the label text. */ 41 53 void clear(); 42 void setText (const QString &aText); 54 /** Defines the label @a strText. */ 55 void setText(const QString &strText); 43 56 44 57 protected: 45 58 46 virtual void init(); 59 /** Prepares all. */ 60 virtual void prepare(); 47 61 48 QLabel *mLabel; 62 /** Holds the label instance. */ 63 QLabel *m_pLabel; 49 64 }; 50 65 51 #endif // __QILabelSeparator_h__ 52 66 #endif /* !___QILabelSeparator_h___ */
Note:
See TracChangeset
for help on using the changeset viewer.