qt4

What's different with my lookAt and perspective calls VS gluPerspective and glLookat (cube stretched)

孤人 提交于 2019-12-11 16:35:51
问题 Side note: hey everyone, if you found my question/answer helpful, please don't forget to up vote. I kind of need it... So there seems to be something different with my implementation of both matrix [projection and model] (other than the stuff I've commented out for debugging purposes). Below is a screenshot of the bug I see when drawing a cube. Keep in mind I do keep the viewport and matrix up to date with the window size and calculate screen ratio with float and not int, so don't bother

Imagemagick Linking to QT and mingw32-make: *** [debug] Error 2

家住魔仙堡 提交于 2019-12-11 16:23:22
问题 I created an application using Imagemagick library with Qt on Mac. Now that I want to deploy the application for windows: I installed the imagemagick library on my pc, I installed the SDK version of QT 4.7 I added my include and lib paths And when I go run the application I'm getting errors that I think they are related to mingw32. here are the build issues: and here is the compile output: Can someone Identify the error ? What do I have to do to deploy the application for windows? I also

piping standard output into QLabel in Qt 4.7

懵懂的女人 提交于 2019-12-11 14:44:34
问题 I am trying to wrap a colleges c++ code in a Qt widget. However, his programs std output necessarily needs to be viewed. As of now I am assuming I will build a GUI and open a QProccess that will run his program (then send commands over that pipe). So my question is there anyway to read the standard output of that program and display it in a qlabel or something similar (i.e. what functions should I be looking into)? 回答1: As the process runs, the QProcess object will emit the

Accessing QTextHtmlImporter in PyQt4

↘锁芯ラ 提交于 2019-12-11 14:41:07
问题 I'm writing a cross platform app in PyQt4. For a particular feature, I would like to access the QTextHtmlImporter class of Qt4. There is no direct python adapter class available in PyQt4. The class is part of the src/gui/text/qtextdocumentfragment_p.h file. Is there any way I can access that in Python? I would like to modify QTextDocument.setHtml() , which code is: void QTextDocument::setHtml(const QString &html) { Q_D(QTextDocument); setUndoRedoEnabled(false); d->clear(); QTextHtmlImporter

Qt resizeGL problem

只愿长相守 提交于 2019-12-11 13:25:45
问题 I'm writing a simple program where i have only one widget QGLWidget. I initialize it in constructor of my main class like this: view3d = new GLBox(this); The view3d object is displayed properly but the problem is that the method resizeGL works only once - when the obejct is being created. After that it doesn't run when I change the size of the window. I used qDebug() function to chcek this and as I said it works only one time. I declared resizeGL as a protected method. Do you maybe know what

How can I remove columns from a QTreeView (using QDirModel)?

点点圈 提交于 2019-12-11 13:10:23
问题 I have a QDirModel attached to a QTreeView and I only want to see the paths, not size, type and date modified. Is there a way to remove these columns? 回答1: QTreeView::setColumnHidden(int column, bool hide) should do the trick. 回答2: One can also use hideColumn(). Something like: for i in range(1, self.my_tree_view.header().length()): self.my_tree_view.hideColumn(i) 来源: https://stackoverflow.com/questions/4203022/how-can-i-remove-columns-from-a-qtreeview-using-qdirmodel

Qt variable re-assignment

笑着哭i 提交于 2019-12-11 12:12:54
问题 I have two examples I have a question about. Let me explain via some code: Question 1: QStringList qsl(); // Create a list and store something in it qsl << "foo"; QString test = "this is a test"; qsl = test.split(" ", QString::SkipEmptyParts); // Memory Leak? What happens when I re-assign the qsl variable what happens to "foo" and the original data allocated on the first line? Question 2: class Foo { QStringList mylist; void MyFunc(QStringList& mylist) { this->m_mylist = mylist; } void

PyQT Button click doesn't work

做~自己de王妃 提交于 2019-12-11 12:02:59
问题 So my problem is that instead of manually writing a ton of code for a bunch of buttons, I want to create a class for a QPushButton and then change so many variables upon calling that class to create my individual buttons. My problem is that my button does not seem to be clickable despite calling the clicked.connect function and having no errors upon running the code. Here are the relevant parts of the button class: class Button(QtGui.QPushButton): def __init__(self, parent): super(Button,

Accessing padding from stylesheet in QT

荒凉一梦 提交于 2019-12-11 11:21:48
问题 I have a custom QWidget subclass that lays out a number of children. In my stylesheet I define a background, which works fine. I also define padding, which doesn't work. I clearly need to provide support for this myself. To do that, I need to be able to find out what padding is set in the stylesheet for my widget. I do not wish to parse the stylesheet myself, that would not make much sense. How can I access the top, left, bottom and right padding set in the stylesheet? Thanks in advance, 回答1:

QTimer to execute method every second

浪尽此生 提交于 2019-12-11 11:19:31
问题 I'm learning Qt and I was reading about Threads, Events and QObjects from Qt wiki, and followed the wiki recommendations on how to handle some work in a while condition but its not working for my specific case. Here's a simple example of what I'm currently trying to achieve. class FooEvents : public FooWrapper { public virtual serverTime(..) { std::cout << "Server time event\n"; } public virtual connected(..) { std::cout << "Connected event\n"; } } class Foo : public QObject { private: FooAPI