Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I create a custom widget with two standard widgets?

0
Posted

How do I create a custom widget with two standard widgets?

0

Hello, I would like to implement a custom widget that would contain a QTextEdit widget and another control. I would like the custon widget to look to the outside like a QTextEdit so that QTextEdit member methods should be exposed. This would allow the user to call QTextEdit member functions like this: customWidget->insert(), etc. The second control would be displayed to left of the QTextEdit control and would be used, for example, to display an arrow indicating which line in the QTextEdit has the cursor, etc. It could be implemented as perhaps a ListBox. The arrow would be repainted when the cursor moves. This is a simplification of the full requirements but should be sufficient to explain the problem. Ideally the custom widget would subclass QTextEdit so that all QTextEdit member methods like would be automatically available to the user of the custom widget. The problem with subclassing QTextEdit is that the custom widget has no way to create the ListBox control because the entire cus

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.