Hello everybody.

There is a problem with showing QLabels.

There is a QPlugin made as dll. It has an array:
Qt Code:
  1. typedef boost::shared_ptr< QLabel > TLabel;
  2. typedef std::vector< TLabel > TLabels;
  3. typedef TLabels::iterator TLabelsIter;
  4. typedef TLabels::const_iterator TLabelsIterConst;
To copy to clipboard, switch view to plain text mode 

and so in the plugin's class:
Qt Code:
  1. TLabels labels;
To copy to clipboard, switch view to plain text mode 

During the work of the plugin, next initialization present:
Qt Code:
  1. TLabel newLabel;
  2. newLabel.reset(new QLabel);
  3. QFont newFont("Serif", 12);
  4. newLabel->setFont(newFont);
  5. QPalette pal( "#FFFF00");
  6. newLabel->setPalette(pal);
  7. newLabel->move(10, 10);
  8.  
  9. labels.push_back(pLabel);
To copy to clipboard, switch view to plain text mode 

The there is a code which simply changes text in the label:
Qt Code:
  1. labels[j]->setText(dataQStr);
To copy to clipboard, switch view to plain text mode 

The plugin's class has QWidget inheritance.

When the program starts, no labels are seen.

If I add to the plugin's class an element:
Qt Code:
  1. private:
  2. QMainWindow mainWindow;
To copy to clipboard, switch view to plain text mode 

And initialize it after with:

Qt Code:
  1. mainWindow.show();
To copy to clipboard, switch view to plain text mode 

When the program starts, there is a window with NULL information in it.

What do I need to do, in order to show the labels I have in the mainWindow?
or is there any ways to do it without the mainWindow element?

Thanks a lot in advance.