What does this debugger warning means????And I installed 4.3.3. Are there any bugs regarding qpainter, becuase SAME CODE worked on 4.3.2.???Qt Code:
paint device returned engine == 0, type: 3To copy to clipboard, switch view to plain text mode
What does this debugger warning means????And I installed 4.3.3. Are there any bugs regarding qpainter, becuase SAME CODE worked on 4.3.2.???Qt Code:
paint device returned engine == 0, type: 3To copy to clipboard, switch view to plain text mode
Qt 5.3 Opensource & Creator 3.1.2
Is this a warning or an error?becuase SAME CODE worked on 4.3.2.???
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Probably because you are trying to paint on a null QPaintDevice...
Can you post some code?
I compiled same code under 4.3.3. and my app crashes. Then I went into debug mode with gdb and I get that warning (at runtime - after app crashes). And I do not have any clue what to do with it. I have been seeking error for 14 hours and I am desperate.![]()
Qt 5.3 Opensource & Creator 3.1.2
Here is some code, I am "playing" with the code of "Cover browser demo". Here is code:That warning is written only ONCE and "After first p->save()". And under 4.3.2 this exact code worked perfectly.Qt Code:
qint16 w, qint16 h, qint16 angle) { qDebug() << "Entered CMerchandizeBrowser::drawItemsAt ..."; // debug Q_ASSERT(p!=0); p->save(); qDebug() << "After first p->save()"; // debug if (!m_MirrorCache.contains(img.cacheKey())) { m_MirrorCache.insert(img.cacheKey(), mirror); } QTransform trans; trans.scale(qreal(w)/img.width(), qreal(h)/img.height()); trans.rotate(angle, Qt::YAxis); p->setTransform(trans * QTransform().translate(loc.x(), loc.y()), true); p->save(); qDebug() << "After second p->save()"; // debug Q_ASSERT(p!=0); p->drawImage(pt2, mirror); p->restore(); p->drawImage(pt, img); p->restore(); qDebug() << "Exiting CMerchandizeBrowser::drawItemsAt ..."; // debug }To copy to clipboard, switch view to plain text mode
Qt 5.3 Opensource & Creator 3.1.2
Chill dude...
Post some code and someone will figure it out![]()
On what paint device did you use the painter passed to the function before entering this function? Maybe that paint device has been deallocated.
The warning is laucnhed after call DrawItem at from:Qt Code:
{ qDebug() << "Entered CMerchandizeBrowser::drawItemsBeforeSelected ..."; // debug Q_ASSERT(p!=0); height()/2-m_ImagesList[m_iSelected].height()/4); qint16 widthDiff = selPt.x(); qint16 startIdx = m_iSelected - widthDiff/pos_diff; if (startIdx < 0) startIdx = 0; for (qint16 i = 0, idx = startIdx; idx < m_iSelected; ++i, ++idx) { img, img.width() -size_diff, img.height()-size_diff, -55); } qDebug() << "Exiting CMerchandizeBrowser::drawItemsBeforeSelected ..."; // debug }To copy to clipboard, switch view to plain text mode
Qt 5.3 Opensource & Creator 3.1.2
Where is the QPainter object originally created? Where does CMerchandizeBrowser::drawItemsBeforeSelected() get called from?
J-P Nurmi
I think painter is created here, in line 4:Qt Code:
{ qDebug() << "Entered CMerchandizeBrowser::paintEvent ..."; // debug p.setClipRect(e->rect()); p.fillRect(rect(), Qt::black); #ifdef SCALE_VIEW static qint16 diff = 0; qint16 w = width() - diff; qint16 h = height() - diff; QTransform trans; trans.translate(width()/2, height()/2); trans.scale(qreal(w)/width(), qreal(h)/height()); trans.translate(-width()/2, -height()/2); p.setTransform(trans); #endif drawItemsBeforeSelected(&p); drawItemsAfterSelected(&p); drawSelectedItem(&p); #ifdef SCALE_VIEW static bool goingUp = true; if (goingUp) diff += 3; else diff -= 3; if (diff >= 200 || diff <= 0) goingUp = !goingUp; #endif if (m_iSelected>=m_ImagesList.count()) m_iSelected=0; //QTimer::singleShot(1000/60, this, SLOT(update())); qDebug() << "Exiting CMerchandizeBrowser::paintEvent ..."; // debug }To copy to clipboard, switch view to plain text mode
Qt 5.3 Opensource & Creator 3.1.2
You say the app is crashing, do you know where?
Last edited by high_flyer; 12th December 2007 at 10:14.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Creation of QPainter looks look to me. But I hope you're aware that
- 100/60 = 1
- 1000/60 = 16
so you're attempting to schedule a paint event every one or every 16th millisecond. Of course, the platform won't succeed in delivering timer events at so tight interval and Qt will also optimize it a bit behind the curtains by merging pending paint events but it might still not be a wise thing to do.
J-P Nurmi
But this code, even with short timer, worked fine in 4.3.2. I simply do not get it. Let me try to change this timer.
Same warning!![]()
Qt 5.3 Opensource & Creator 3.1.2
That doesn't mean anything. I suggest you use a debugger to find out where the crash occurs instead of shooting blind.
Bookmarks