I have few forms created in a project.
I declared an item-based list widget as below:
QListWidget *messageList;
To copy to clipboard, switch view to plain text mode
in my first form's *.h file. I want
to use it in the other forms as well. How can I call messageList and its items in another form?
Definition of messageList in *.cpp:
messageList->clear();
<< "Hello! ");
dock->setWidget(messageList);
QDockWidget *dock;
dock = new QDockWidget(tr("Message"), this);
messageList = new QListWidget(dock);
messageList->clear();
messageList->addItems(QStringList()
<< "Hello! ");
dock->setWidget(messageList);
To copy to clipboard, switch view to plain text mode
Bookmarks