Esempio n. 1
0
	CodeSpinBox::CodeSpinBox(QWidget *parent)
	: QSpinBox(parent)
	{
		CodeLineEdit *codeLineEdit = new CodeLineEdit(parent);
		codeLineEdit->setEmbedded(true);
		setLineEdit(codeLineEdit);

		connect(codeLineEdit, SIGNAL(codeChanged(bool)), this, SLOT(codeChanged(bool)));

		addActions(codeLineEdit->actions());
	}
	CodeDateTimeEdit::CodeDateTimeEdit(QWidget *parent)
	: QDateTimeEdit(parent)
	{
		CodeLineEdit *codeLineEdit = new CodeLineEdit(parent);
		codeLineEdit->setEmbedded(true);
		setLineEdit(codeLineEdit);

		setCalendarPopup(true);

		connect(codeLineEdit, SIGNAL(codeChanged(bool)), this, SLOT(codeChanged(bool)));

		addActions(codeLineEdit->actions());
	}
Esempio n. 3
0
    CodeComboBox::CodeComboBox(QWidget *parent) :
		QComboBox(parent)
	{
		setModel(new CodeComboBoxModel(this));
		setItemDelegate(new CodeComboBoxDelegate(this));

        CodeLineEdit *codeLineEdit = new CodeLineEdit(parent);
		codeLineEdit->setEmbedded(true);
		
		setLineEdit(codeLineEdit);
		setEditable(true);
		setInsertPolicy(QComboBox::NoInsert);

		connect(codeLineEdit, SIGNAL(codeChanged(bool)), this, SIGNAL(codeChanged(bool)));

		addActions(codeLineEdit->actions());
		
		setMinimumWidth(sizeHint().width() + codeLineEdit->codeButton()->maximumWidth() + codeLineEdit->editorButton()->maximumWidth() + 50);
	}