Question

I'm writing a simple text editor and using QTabWidget in it. For some QActon from QMenu I need to work with some widget from QTabWidget. QTabWidget::widget() return QWidget, but I need QTextEdit, which I added to QTabWidget using addTab(). How do I get a QTextEdit from QTabWidget?

QTextEdit *textEdit = new QTextEdit;
QTabWidget *tabWidget = new QTabWidget;
tabWidget->addTab(textEdit, "text_edit");

//How to get textEdit by index or somethin from tabWidget?
Was it helpful?

Solution

QWidget * QTabWidget::widget ( int index ) is the droid you are looking for ;)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top