qt - Remove titlebar of QMessageBox when use static method QMessageBox::information()? -
to show message box use code:
int ret = qmessagebox::question(this,"title","stupid code",qmessagebox::yes | qmessagebox::no);
everything works expected, now, want remove title bar of message box. how can achieve this?
i don't want use:
qmessagebox msgbox("title" , "stupid code", qmessagebox::question, qmessagebox::yes | qmessagebox::no, this, qt::framelesswindowhint); msgbox.exec();
i suggest create wrapper function creating own xmessagebox
class static member function question()
, accepting same arguments qmessagebox::question()
. in wrapper function, create qmessagebox
object arguments given function , in addition, qt::framelesswindowhint
flag, call exec()
, pass on return value. way need search , replace occurrences of qmessagebox::question
xmessagebox::question
in code.
if want more flexibility can make question()
function accept additional argument of type qt::windowflags
, pass on qmessagebox
constructor.
the alternative let want without changing of code change qt code (qmessagebox.cpp) , recompile qt.
Comments
Post a Comment