fractorium/Source/Fractorium/StealthComboBox.h

31 lines
640 B
C
Raw Normal View History

#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:
2014-12-11 00:50:15 -05:00
explicit StealthComboBox(QWidget* p = 0) : QComboBox(p) { }
/// <summary>
/// Set the current index of the combo box without triggering signals.
/// </summary>
/// <param name="index">The current index to set</param>
2014-12-11 00:50:15 -05:00
void SetCurrentIndexStealth(int index)
{
blockSignals(true);
setCurrentIndex(index);
blockSignals(false);
}
};