c++ - Qt 5.3 QWidget::paintEngine : Should no longer be called -
I'm taking my code from Qt 4.x to Qt 5.3 and I'm showing a strange QT alert in the command Prompt will show an error or anything but the command prompt will show the following:
QWidget :: paintEngine: should now be called QPainter :: Start: Paint tool returned engine == 0, type: 1 QPainter :: setClipRegion: Painter not active QPainter :: setClipRect: Painter not active I believe that it limits only to a square Tip: Header:
#include once #include & lt; QtCore \ qmetaobject.h & gt; # Include & lt; QtWidgets \ Qwidget.h & gt; # Include & lt; QtWidgets \ Qslider.h & gt; # Include & lt; Qtwidgets \ Qpushbutton.h & gt; # Include & lt; Qtwidgets \ Qcheckbox.h & gt; #include "MyGLWindow.h" #includes & lt; QtWidgets \ QHboxLayout & gt; # Include & lt; QtWidgets \ QVboxLayout & gt; # Include & lt; QtWidgets \ qmenubar.h & gt; # Include & lt; QtWidgets \ qlabel.h & gt; Class MeWidg: Public QGLWidget {Public: QTimer myTimer; Bull Test toggle; Float testrave; Bool noToggle; MyGielWindows * GamesGelWindows; MeWidg (); Private: zero myUpdate (); Zero load model (); }; More sources:
#include "MeWidg.h" #include "DebugMenu.h" MeWidg :: MeWidg () {QVBoxLayout * mainLayout = New QVBoxLayout (); SetLayout (mainLayout); QHBoxLayout * setUpLayout = new QHBoxLayout (); SetWindowTitle ("Game Maker"); QHBoxLayout * game = new QHBoxLayout (); GameGLWindow = New MyGLWindow (); DebugMenu.initialize (setUpLayout); DebugMenu.addLayout ("world"); QMenuBar * mb = new QMenuBar (); Mb- & gt; SetMaximumHeight (20); QNew * File menu = MB- & gt; Adman ("file"); Qation * Action; FileMenu-> Adaction (action = new queue ("load project", it)); // Action & gt; SetShortcut (QKeySequence :: Open); // connect (action, signal (trigger), this, slot (load obj ())); FileMenu-> Adaction (action = new queue ("save project", this)); // Action & gt; SetShortcuts (QKeySequence :: save); // connect (action, signal (trigger), this, slot (gentleman ()); FileMenu-> AddSeparator (); FileMenu-> Adaction (action = new queue ("load level", this)); // Action & gt; SetShortcuts (QKeySequence :: save); // connect (action, signal (trigger), this, slot (loadLVL)); FileMenu-> Adaction (action = new queue ("save level", it)); // Action & gt; SetShortcuts (QKeySequence :: save); // connect (action, signal (trigger), this, slot (gentleman ()); FileMenu-> AddSeparator (); FileMenu-> Addition (action = new Q action ("closed", this)); // Action & gt; SetShortcuts (QKeySequence :: save); // connect (action, signal (trigger), this, slot (gentleman ()); QMenu * objectMenu = mb-> addMenu ("objects"); Object menu-> Adaction (action = new queue action ("load model", this)); // Action & gt; SetShortcut (QKeySequence :: Open); Connect (action, and queue :: triggers, [=] () {it-> loadmodel ();}); ObjectMenu- & gt; Addition (action = new queue action ("Add Light", this)); // Action & gt; SetShortcut (QKeySequence :: Open); // connect (action, signal (trigger), this, slot (load obj ())); Object menu-> Adaction (action = new queue ("add sound", this)); // Action & gt; SetShortcut (QKeySequence :: Open); // connect (action, signal (trigger), this, slot (load obj ())); ObjectMenu- & gt; Adaction (action = new queue action ("Add Game Object", this)); // Action & gt; SetShortcut (QKeySequence :: Open); // connect (action, signal (trigger), this, slot (load obj ())); MainLayout-> AddWidget (MB); Games - & gt; Edugetet (game GLWindo, 1, 0); Set Up Layout - & gt; AddLayout (game); GameGLWindow- & gt; SetMinimumHeight (600); GameGLWindow- & gt; SetMinimumWidth (500); Main layout- & gt; Adlayout (Setup Layout, 1); Connect (& myTimer, & amp; QTimer :: Timeout, [=] () {this-> myUpdate ();}); MyTimer.start (16); } Zero MeWidg :: myUpdate () {debugMenu.update (); If (GetAsyncKeyState (VK_ESCAPE) & noToggle) {noToggle = true; DebugMenu.toggleVisibility (); } And if (GetAsyncKeyState (VK_ESCAPE) and Nautgagal) {noToggle = false; }} Zero IWidg :: loadModel () {gameGLWindow-> LoadModel (); } Will anyone know why I get these warnings? Apart from this, the widget I am using is also not being shown, the only thing that looks is a blank box where the layout was used, if I do not understand it, then only QT 4.x I'll go back.
You are not showing the relevant part of your code, some custom widgets appear in the base class On PaintEngine () calls the method (which is not allowed). Find that widget by finding PaintEngine () and fixing it.
Comments
Post a Comment