respect field column span and disable scrolling on combo fields
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "combofield.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include "ui/comboboxex.h"
|
||||
|
||||
ComboField::ComboField(EffectRow* parent, const QString& id) :
|
||||
EffectField(parent, id, EFFECT_FIELD_COMBO)
|
||||
@@ -18,7 +18,9 @@ void ComboField::AddItem(const QString &text, const QVariant &data)
|
||||
|
||||
QWidget *ComboField::CreateWidget()
|
||||
{
|
||||
QComboBox* cb = new QComboBox();
|
||||
ComboBoxEx* cb = new ComboBoxEx();
|
||||
|
||||
cb->setScrollingEnabled(false);
|
||||
|
||||
for (int i=0;i<items_.size();i++) {
|
||||
cb->addItem(items_.at(i).name);
|
||||
|
||||
@@ -50,7 +50,8 @@ EffectField::EffectField(EffectRow* parent, const QString &i, EffectFieldType t)
|
||||
QObject(parent),
|
||||
type_(t),
|
||||
id_(i),
|
||||
enabled_(true)
|
||||
enabled_(true),
|
||||
colspan_(1)
|
||||
{
|
||||
// EffectField MUST be created with a parent.
|
||||
Q_ASSERT(parent != nullptr);
|
||||
@@ -80,6 +81,7 @@ int EffectField::GetColumnSpan()
|
||||
|
||||
void EffectField::SetColumnSpan(int i)
|
||||
{
|
||||
Q_ASSERT(i >= 1);
|
||||
colspan_ = i;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#include "fontfield.h"
|
||||
|
||||
#include <QComboBox>
|
||||
#include <QFontDatabase>
|
||||
|
||||
#include "ui/comboboxex.h"
|
||||
|
||||
FontField::FontField(EffectRow* parent, const QString &id) :
|
||||
EffectField(parent, id, EFFECT_FIELD_FONT)
|
||||
{
|
||||
@@ -18,7 +19,9 @@ QString FontField::GetFontAt(double timecode)
|
||||
|
||||
QWidget *FontField::CreateWidget()
|
||||
{
|
||||
QComboBox* fcb = new QComboBox();
|
||||
ComboBoxEx* fcb = new ComboBoxEx();
|
||||
|
||||
fcb->setScrollingEnabled(false);
|
||||
|
||||
fcb->addItems(font_list);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user