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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -