Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How to disable keyboard?



  • This is an old "problem" and I am looking for better solution.
    My MdiChild class is QTexrEdit derived .

    I need to keep the MdiChild process and NOT to change the base class , BUT replace the objects with widgets , not text.

    So far I have removed build

    child->newFile();

    however I can still enter plain text to the MdiChild window.

    How to disable keyboard text entry ?

    MdiChild *child = createMdiChild();
    

    // child->newFile(); temporary no need file build
    child->show();



  • I'm not fully understanding what you want to do, but since your MdiChild class is derived from QTextEdit, you can call the QTextEdit:setReadOnly() method; passing it a value of true.

    child->setReadOnly(true);
    

Log in to reply