Integrating Qt with Visual Studio (C++) in Win32Proj -
Integrating Qt with Visual Studio (C++) in Win32Proj -
short summary: qt class crashes @ class construction part when calling parent qwidget constructor. error message shows: "first-chance exception @ 0x0048fca9 in myapplication.exe: 0xc0000005: access violation reading location 0x00000000."
details: i'm working on project add together overlay user interface 1 client, much steam has when press "tab+shift" while game play. original application written in visual studio environment without ui stuff, , decide utilize qt job.
since project pretty complex transform qt project .pro file, want utilize qt library (including lib , include folder , utilize in project).
it works fine when write in c language. menu show it's not clickable. seems in order create qt event loop work, have declare custom widget class rather grouping of c functions.
i added qt class project, modify include , lib folder, generate moc file, including in project. compiles when run program, shows error message. tracking code shows constructor fails when tried build qwidget.
i have searched online tutorial tells how work in qt creator or visual studio addin scratch.
solved smi:
the problem initialize qapplication later qwidget gets initialized. adding qapplication before calling constructor fixed problem.
one possible reason qwidget
constructor failing have forgot initialize qapplication
object. qt documentation says:
for gui application using qt, there exactly 1 qapplication object, no matter whether application has 0, 1, 2 or more windows @ given time.
and also:
since qapplication object much initialization, must created before other objects related user interface created.
visual-studio qt user-interface
Comments
Post a Comment