thanks Wysota- i've subclassed QWidget and have a new widget, BuPan. I've a pretty simple question about declaring pointers in my header file; the constructor contains the following:
BuPanel
::BuPanel(QWidget *parent,
int numBu,
int slid
) : QWidget(parent
){
for(int a=0; a<numBu; a++)
{
//etc...
}
//etc...
BuPanel::BuPanel(QWidget *parent, int numBu, int slid) : QWidget(parent)
{
for(int a=0; a<numBu; a++)
{
pushB[a] = new QPushButton;
//etc...
}
//etc...
To copy to clipboard, switch view to plain text mode
and i have
QPushButton *pushB[20]; //private
To copy to clipboard, switch view to plain text mode
in the header. "20" is the maximum number of buttons I'll have in any panel, but most will have far fewer. Is this bad coding practice? ...to declare unnecessary pointers that won't be used/instantiated?
Bookmarks