0
내 QtGraphicsView가 작업중인 창 100 %를 차지하는 데 문제가 있습니다. 생성 된 그래픽 창을 100 % 차지하도록보기 크기를 설정하는 방법이 있습니까? ? 당신이 원하는 일을해야 QWidget
을 상속 이후QtGraphicsView 크기 in 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
바로 그거야! 'QApplication :: desktop() -> screenGeometry();'QRect'를 반환합니다. – AquilaRapax