Hello everybody.
There is a problem with showing QLabels.
There is a QPlugin made as dll. It has an array:
typedef boost
::shared_ptr<
QLabel > TLabel;
typedef std::vector< TLabel > TLabels;
typedef TLabels::iterator TLabelsIter;
typedef TLabels::const_iterator TLabelsIterConst;
typedef boost::shared_ptr< QLabel > TLabel;
typedef std::vector< TLabel > TLabels;
typedef TLabels::iterator TLabelsIter;
typedef TLabels::const_iterator TLabelsIterConst;
To copy to clipboard, switch view to plain text mode
and so in the plugin's class:
TLabels labels;
TLabels labels;
To copy to clipboard, switch view to plain text mode
During the work of the plugin, next initialization present:
TLabel newLabel;
QFont newFont
("Serif",
12);
newLabel->setFont(newFont);
newLabel->setPalette(pal);
newLabel->move(10, 10);
labels.push_back(pLabel);
TLabel newLabel;
newLabel.reset(new QLabel);
QFont newFont("Serif", 12);
newLabel->setFont(newFont);
QPalette pal( "#FFFF00");
newLabel->setPalette(pal);
newLabel->move(10, 10);
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:
labels[j]->setText(dataQStr);
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:
private:
private:
QMainWindow mainWindow;
To copy to clipboard, switch view to plain text mode
And initialize it after with:
mainWindow.show();
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.
Bookmarks