VirtualBox

Changeset 79798 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 15, 2019 6:56:56 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9495: Reworking QIStyledItemDelegate to connect signals only if they present; we had to use property system for that; this was done specially for Form Editor widget but others only since they were affected.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
5 edited

Legend:

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

    r76553 r79798  
    4545
    4646    /* Watch for editor data commits, redirect to listeners: */
    47     if (m_fWatchForEditorDataCommits)
     47    if (   m_fWatchForEditorDataCommits
     48        && pEditor->property("has_sigCommitData").toBool())
    4849        connect(pEditor, SIGNAL(sigCommitData(QWidget *)), this, SIGNAL(commitData(QWidget *)));
    4950
    5051    /* Watch for editor Enter key triggering, redirect to listeners: */
    51     if (m_fWatchForEditorEnterKeyTriggering)
     52    if (   m_fWatchForEditorEnterKeyTriggering
     53        && pEditor->property("has_sigEnterKeyTriggered").toBool())
    5254        connect(pEditor, SIGNAL(sigEnterKeyTriggered()), this, SIGNAL(sigEditorEnterKeyTriggered()));
    5355
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAddDiskEncryptionPasswordDialog.cpp

    r79365 r79798  
    215215void UIPasswordEditor::prepare()
    216216{
     217    /* Make sure QIStyledDelegate aware of us: */
     218    setProperty("has_sigCommitData", true);
     219    setProperty("has_sigEnterKeyTriggered", true);
    217220    /* Set echo mode: */
    218221    setEchoMode(QLineEdit::Password);
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFormEditorWidget.cpp

    r79720 r79798  
    202202    Q_PROPERTY(TextData text READ text WRITE setText USER true);
    203203
    204 signals:
    205 
    206     /** Notifies listener about data should be committed. */
    207     void sigCommitData(QWidget *pThis);
    208 
    209204public:
    210205
     
    276271    Q_OBJECT;
    277272    Q_PROPERTY(RangedIntegerData rangedInteger READ rangedInteger WRITE setRangedInteger USER true);
    278 
    279 signals:
    280 
    281     /** Notifies listener about data should be committed. */
    282     void sigCommitData(QWidget *pThis);
    283273
    284274public:
     
    604594    : QComboBox(pParent)
    605595{
     596    /* Make sure QIStyledDelegate aware of us: */
     597    setProperty("has_sigCommitData", true);
     598    /* Configure connections: */
    606599    connect(this, static_cast<void(ChoiceEditor::*)(int)>(&ChoiceEditor::currentIndexChanged),
    607600            this, &ChoiceEditor::sltCurrentIndexChanged);
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHostComboEditor.cpp

    r79365 r79798  
    473473void UIHostComboEditor::prepare()
    474474{
     475    /* Make sure QIStyledDelegate aware of us: */
     476    setProperty("has_sigCommitData", true);
    475477    /* Configure self: */
    476478    setAutoFillBackground(true);
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIHotKeyEditor.cpp

    r76606 r79798  
    127127    , m_fSequenceTaken(false)
    128128{
     129    /* Make sure QIStyledDelegate aware of us: */
     130    setProperty("has_sigCommitData", true);
    129131    /* Configure self: */
    130132    setAutoFillBackground(true);
Note: See TracChangeset for help on using the changeset viewer.

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