Hello,
Regarding the actual function that I use to get screen height:
I have subclassed QGraphicsView and putted it on on first QStackedWidget page stretched to full screen.
I'm getting screen resolution from events
void MGraphicsView
::showEvent(QShowEvent *event
) { emit viewSet(this->viewport()->geometry().width(),this->viewport()->geometry().height());
}
emit viewResized(this->viewport()->geometry().width(),this->viewport()->geometry().height());
}
void MGraphicsView::showEvent(QShowEvent *event) {
QGraphicsView::showEvent(event);
emit viewSet(this->viewport()->geometry().width(),this->viewport()->geometry().height());
}
void MGraphicsView::resizeEvent(QResizeEvent *event) {
QGraphicsView::resizeEvent(event);
emit viewResized(this->viewport()->geometry().width(),this->viewport()->geometry().height());
}
To copy to clipboard, switch view to plain text mode
Starting my app first time, it is doing some registration with my home server, and during this I used to save this resolution into application config file, so next time when app was starting I didn't have to wait for showEvent, I could paint and position elements before it, which was convenient for me.
Regarding the showFullScreen and showMaximized, with the later there is always this task bar visible at the top. I'm not sure if I want it to be visible
Haven't decided yet.
Regarding the concurrent processes, I think it may be some race condition between java and Qt ?
During both cases I have slightly different debug output during application startup, and it differs because some internal messages from dalvik machine, or/and java.
I have included some debug for both cases.
I think that delay or QApplication::ProcessEvents() would be a goood idea, but where to put it? in main before creating main window? or before creating object mainView which uses subclassed QGraphicsView ?
best regards
Marek
Bookmarks