leider stehe ich irgendwie auf dem Schlauch. Ich hoffe, mir kann einer den entscheidenden Tipp geben.
Ich habe ein QMainWindow mit mehreren QDockWidgets und einem MainWidget. Nun will ich im Vollbildmodus das MainWidget ohne Rand auf beide Monitore vergrößern.
Der normale "showFullscreen" funktioniert soweit gut mit einem Monitor.
Nun wollte ich die geometry selber setzen, aber anscheinend weiß ich nicht genau was ich tue
Code: Alles auswählen
void MainWindow::a_fullscreen() {
if (this->isFullScreen()) {
this->showNormal();
} else {
if(QApplication::desktop()->screenCount()>1) {
qDebug() << "Multi-screen setup detected";
int totalWidth = 0;
totalWidth += QApplication::desktop()->screenGeometry(0).width();
totalWidth += QApplication::desktop()->screenGeometry(1).width();
QRect rect = QApplication::desktop()->screenGeometry(0);
qDebug() << "Total Width: " << totalWidth;
rect.setTopLeft(QPoint(0,0));
rect.setBottomLeft(QPoint(0,1050));
rect.setTopRight(QPoint(totalWidth, 0));
rect.setBottomRight(QPoint(totalWidth, 1050));
qDebug() << rect;
this->setGeometry(rect);
this->showFullScreen();
} else {
this->showFullScreen();
}
}
}
openSuse 11.4 Gnome 32-bit, Qt 4.7.1
Danke Euch im Voraus.
Gruß
jerry42