I can't understand why my custom widget is missing some designer functions, like in designer,
the custom widget doesn't have any tab order and it doesn't appear in the tab order list.
I'm thinking it's because I've placed it in a layout which doesn't have a tab order ?
I had to do this because without it, my widget didn't show up when placing it on a form.
DbComboBox
::DbComboBox(QWidget *parent
){
cb->setEditable(true);
cb->installEventFilter(this);
connect(cb, SIGNAL(currentIndexChanged(int)), this, SLOT(on_currentIndexChanged(int)));
layout->addWidget(cb);
layout->setContentsMargins(0,0,0,0);
this->setLayout(layout);
}
DbComboBox::DbComboBox(QWidget *parent)
: QWidget(parent)
{
cb = new QComboBox(this);
cb->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
cb->setEditable(true);
cb->installEventFilter(this);
connect(cb, SIGNAL(currentIndexChanged(int)), this, SLOT(on_currentIndexChanged(int)));
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(cb);
layout->setContentsMargins(0,0,0,0);
this->setLayout(layout);
}
To copy to clipboard, switch view to plain text mode
Also QComboBox public methods aren't available, when I compile my project with an instance of this part and access a method:
m_ui->myComboBox->currentText
m_ui->myComboBox->currentText
To copy to clipboard, switch view to plain text mode
compiler says
/home/vince/projects/Qt/myProject/plugins/DbComboBoxExtension/dbcombobox.h:56: error: ‘QString DbComboBox::currentText’ is private
Can someone please point out why it isn't behaving ?
Bookmarks