Close button only for some tabs in Qt

后端 未结 7 1977
天命终不由人
天命终不由人 2021-02-05 05:22

I am using Qt for an assignment I have for college, and I want to use QTabWidget to display a chat window much like Pidgin\'s. I want to make the \"group chat\" tab

7条回答
  •  再見小時候
    2021-02-05 05:58

    You should reimplement your widget's event(Event *e) method, check the type of e, find out CloseEvents, and call parent class's event when you can allow tab to close, or e->ignore() when you do not want it.

    Note, then you must parent's event() handle othr events, so do not accept(), reject() or forget them Ж)

提交回复
热议问题