I am going to program easy game in Qt, which 2D widgets I should use to display game? I've tried GraphicsView, but that's really awful for me....unexpected behavior around painting onto the screen such as added scrollbars in my main window to see full GraphicsView ?! But the size is the same as main window! It's too strange.
Added after 40 minutes:
I am quiet angry myself, it's terrible to work with GraphicsView and other GraphicsXYZ classes, awful! I don't understand how it can works!
Added after 1 8 minutes:
I have a lot of questions:
1. I have an inherited class QGraphicsView and implemented paintEvent, why does debugger write: QPainter::begin: Paint device returned engine == 0, type: 1 ??
This is whole code:
{
painter.drawRect(this->sceneRect());
}
void GraphicsView::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.setBrush(QBrush(QColor(255,127,0)));
painter.drawRect(this->sceneRect());
}
To copy to clipboard, switch view to plain text mode
And I am not drawing outside from paintEvent method.
2. Why I have scollbars in my GraphicsView window ? How to remove them?
It's amazingly silly...
Bookmarks