0
我無法讓我的QtGraphicsView佔用我在工作窗口的100%。
有沒有一種方法來設置視圖的大小佔用所創建的圖形窗口的100% ?QtGraphicsView大小QTGraphicsScene
QApplication app(argc, argv);
QGraphicsScene * scene = new QGraphicsScene();
int counter = 1000;
scene->setSceneRect(0, 0, counter, counter);//scene size
QGraphicsEllipseItem * item = new QGraphicsEllipseItem(0, scene);
item->setRect(0,0, 1000.0, 1000.0);
QGraphicsView view(scene);
view.setRect(100, 100);
view.setRenderHints(QPainter::Antialiasing);
view.show();
謝謝!無論如何,我現在可以從這個屏幕的大小?所以我可以在我的其他代碼中使用它?謝謝 – JonMorehouse
@JonMorehouse:如果你想要屏幕信息,你應該使用[QDesktopWidget](http://qt-project.org/doc/qt-4.8/qdesktopwidget.html)API代替。 – jmk
這就對了! - ;'返回一個'QRect' – AquilaRapax