VirtualBox

Changeset 104978 in vbox


Ignore:
Timestamp:
Jun 20, 2024 1:14:00 PM (9 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
163588
Message:

FE/Qt: bugref:10666, bugref:10669: A bit of cleanup for QILineEdit; This is the 1st step, reordering only.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/extensions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QILineEdit.cpp

    r104638 r104978  
    55
    66/*
    7  * Copyright (C) 2008-2023 Oracle and/or its affiliates.
     7 * Copyright (C) 2008-2024 Oracle and/or its affiliates.
    88 *
    99 * This file is part of VirtualBox base platform packages, as
     
    4848    , m_fAllowToCopyContentsWhenDisabled(false)
    4949    , m_pCopyAction(0)
     50    , m_fMarkable(false)
     51    , m_fMarkForError(false)
    5052    , m_pIconLabel(0)
    51     , m_fMarkForError(false)
    52     , m_fMarkable(false)
    5353    , m_iIconMargin(0)
    5454{
     
    6060    , m_fAllowToCopyContentsWhenDisabled(false)
    6161    , m_pCopyAction(0)
     62    , m_fMarkable(false)
     63    , m_fMarkForError(false)
    6264    , m_pIconLabel(0)
    63     , m_fMarkForError(false)
     65    , m_iIconMargin(0)
    6466{
    6567    prepare();
     
    7981{
    8082    setFixedWidth(fitTextWidth(strText).width());
     83}
     84
     85void QILineEdit::setMarkable(bool fMarkable)
     86{
     87    if (m_fMarkable == fMarkable)
     88        return;
     89    m_fMarkable = fMarkable;
     90    update();
    8191}
    8292
     
    96106    m_pIconLabel->setToolTip(strToolTip);
    97107    m_iIconMargin = (height() - m_pIconLabel->height()) / 2;
    98     update();
    99 }
    100 
    101 void QILineEdit::setMarkable(bool fMarkable)
    102 {
    103     if (m_fMarkable == fMarkable)
    104         return;
    105     m_fMarkable = fMarkable;
    106108    update();
    107109}
     
    144146}
    145147
    146 void QILineEdit::moveIconLabel()
    147 {
    148     AssertPtrReturnVoid(m_pIconLabel);
    149     m_pIconLabel->move(width() - m_pIconLabel->width() - m_iIconMargin, m_iIconMargin);
    150 }
    151 
    152148void QILineEdit::showEvent(QShowEvent *pShowEvent)
    153149{
     
    200196    return sa;
    201197}
     198
     199void QILineEdit::moveIconLabel()
     200{
     201    AssertPtrReturnVoid(m_pIconLabel);
     202    m_pIconLabel->move(width() - m_pIconLabel->width() - m_iIconMargin, m_iIconMargin);
     203}
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QILineEdit.h

    r104631 r104978  
    55
    66/*
    7  * Copyright (C) 2008-2023 Oracle and/or its affiliates.
     7 * Copyright (C) 2008-2024 Oracle and/or its affiliates.
    88 *
    99 * This file is part of VirtualBox base platform packages, as
     
    6262    void setFixedWidthByText(const QString &strText);
    6363
     64    /** Defines whether line-edit is @a fMarkable. */
     65    void setMarkable(bool fMarkable);
    6466    /** Puts an icon to mark some error on the right hand side of the line edit. @p is used as tooltip of the icon. */
    6567    void mark(bool fError, const QString &strErrorMessage, const QString &strNoErrorMessage);
    66 
    67     void setMarkable(bool fMarkable);
    6868
    6969protected:
     
    9999    QAction *m_pCopyAction;
    100100
    101     QLabel *m_pIconLabel;
    102     bool    m_fMarkForError;
    103     bool    m_fMarkable;
    104     QString m_strErrorMessage;
    105     int     m_iIconMargin;
     101    /** Holds whether line-edit is markable. */
     102    bool     m_fMarkable;
     103    /** Holds whether line-edit is marked for error. */
     104    bool     m_fMarkForError;
     105    /** Holds the icon label instance. */
     106    QLabel  *m_pIconLabel;
     107    /** Holds last error message. */
     108    QString  m_strErrorMessage;
     109    /** Holds cached icon margin. */
     110    int      m_iIconMargin;
    106111};
    107112
Note: See TracChangeset for help on using the changeset viewer.

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