small window appears before QMainWindow startup
I'm using a QMainWindow
as a p开发者_如何学运维rimary window, and call QMainWindow::show()
in main.cpp
before QApplication::exec()
.
However, when it starts, I can actually see a small window first, then the window in a bigger size with everything loaded.
Is that wired or can I keep the window from showing up until everything is settled in?
P.S: this app has a tray icon. If I don't calling show()
in main.cpp
, I still see the small window.
The most likely thing is that some code in your application calls show(), probably during construction of its widgets.
Does your build of Qt allow you to debug, and step into, the Qt source code? If so, maybe try putting a break-point in QWidget::show(), and looking at the call-stack.
精彩评论