FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Qtd Painter Error

 
Post new topic   Reply to topic     Forum Index -> QtD
View previous topic :: View next topic  
Author Message
mweber1488



Joined: 10 Jun 2008
Posts: 15

PostPosted: Fri Feb 04, 2011 8:48 am    Post subject: Qtd Painter Error Reply with quote

I set up some test code to see if I built Qtd properly. Whenever I mouse over the quit button I get the following error:
Code:
QPaintDevice: Cannot destroy paint device that is being painted
object.Error: Access Violation
And here is the code that I am using:
Code:
import qt.gui.QApplication;
import qt.gui.QMainWindow;
import qt.gui.QWidget;
import qt.gui.QLabel;
import qt.gui.QPushButton;
import qt.gui.QVBoxLayout;

int main(string[] args)
{
    scope App = new QApplication(args);

    scope label = new QLabel(tr("Hello, World!"));
    scope quit = new QPushButton(tr("&Quit"));

    scope widget = new QWidget;
    widget.setLayout(new QVBoxLayout);
    widget.layout.addWidget(label);
    widget.layout.addWidget(quit);

    scope window = new QMainWindow;
    window.setWindowTitle(tr("Hello"));
    window.setCentralWidget(widget);
    QObject.connect(quit, "clicked", window, "close");

    window.show();
    return App.exec();
}
Back to top
View user's profile Send private message
arni



Joined: 24 Jan 2011
Posts: 5

PostPosted: Mon Feb 07, 2011 12:56 pm    Post subject: Reply with quote

Looks like some paint message is being sent to a destroyed windows.
Shouldn't you call the app's quit slot instead?
Back to top
View user's profile Send private message
arni



Joined: 24 Jan 2011
Posts: 5

PostPosted: Mon Feb 07, 2011 12:57 pm    Post subject: Reply with quote

Looks like some paint message is being sent to a destroyed windows.
Shouldn't you call the app's quit slot instead?
Back to top
View user's profile Send private message
mweber1488



Joined: 10 Jun 2008
Posts: 15

PostPosted: Mon Feb 07, 2011 2:47 pm    Post subject: Reply with quote

I always do close in case I want to do something before the window is destroyed but I doesn't matter as the error triggers when the tip of the mouse hovers over the button, not when it is clicked.
Back to top
View user's profile Send private message
Destructionator



Joined: 17 Sep 2007
Posts: 9
Location: New York State

PostPosted: Sat Feb 12, 2011 6:03 pm    Post subject: Reply with quote

I see this in my app too, but only on Windows.

I think it might have something to do with the Layouts. Simple examples without layouts work fine but using a layout like your code or my code seems to crash.
Back to top
View user's profile Send private message
Destructionator



Joined: 17 Sep 2007
Posts: 9
Location: New York State

PostPosted: Sat Feb 12, 2011 6:56 pm    Post subject: Reply with quote

FYI, my app seems to work if I use "-style cde" on the command line, so there are no mouse over effects.

Kinda sucks, but at least we've got something to work with.
Back to top
View user's profile Send private message
mweber1488



Joined: 10 Jun 2008
Posts: 15

PostPosted: Mon Feb 14, 2011 7:43 am    Post subject: Reply with quote

It works but definitely not ideal.
Back to top
View user's profile Send private message
Destructionator



Joined: 17 Sep 2007
Posts: 9
Location: New York State

PostPosted: Mon Feb 14, 2011 8:41 am    Post subject: Reply with quote

Yeah. I'm afraid I had to give up on QtD at this point. It worked so well on Linux, but even with the -style hack, it still had some random crashes on Windows as I used the app.

I ultimately decided to write a small dll in C++ that handles the GUI, and the main app is in D. They pass messages over a handful of simple C style functions.
Back to top
View user's profile Send private message
mweber1488



Joined: 10 Jun 2008
Posts: 15

PostPosted: Tue Mar 01, 2011 3:20 pm    Post subject: Reply with quote

How do you compile the c++ code? I have been unable to get it to work.
Back to top
View user's profile Send private message
michaelc97



Joined: 06 May 2007
Posts: 9

PostPosted: Sat Sep 21, 2013 10:58 am    Post subject: Reply with quote

i got this to work on windows 7 by compiling with -mstackrealign option e.g.

cmake -G"MinGW Makefiles" -DCMAKE_CXX_FLAGS=-m32 -fpermissive -mstackrealign" ../
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> QtD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group