mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-01 22:06:10 -04:00
Initial source commit
Initial source commit
This commit is contained in:
30
Source/Fractorium/StealthComboBox.h
Normal file
30
Source/Fractorium/StealthComboBox.h
Normal file
@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "FractoriumPch.h"
|
||||
|
||||
/// <summary>
|
||||
/// StealthComboBox class.
|
||||
/// </summary>
|
||||
|
||||
/// <summary>
|
||||
/// A thin derivation of QComboBox which allows the user
|
||||
/// to set the index without triggering signals.
|
||||
/// </summary>
|
||||
class StealthComboBox : public QComboBox
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit StealthComboBox(QWidget* parent = 0) : QComboBox(parent) { }
|
||||
|
||||
/// <summary>
|
||||
/// Set the current index of the combo box without triggering signals.
|
||||
/// </summary>
|
||||
/// <param name="index">The current index to set</param>
|
||||
void StealthComboBox::SetCurrentIndexStealth(int index)
|
||||
{
|
||||
blockSignals(true);
|
||||
setCurrentIndex(index);
|
||||
blockSignals(false);
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user