qt4

QObject::connect: Cannot connect (null)

陌路散爱 提交于 2019-12-11 23:21:51
问题 I try to load to plugins. If they are loaded with success , then i must connect returned widgets. With one plugin i create an action and add it to a menu , with another plugin i create a label and add it to window. Even if i get this error during runtime (when app loads plugins) , these two widgets are created and are visible. But there is no connection between them. This is how i try to connect widgets QObject *plugin = pluginLoader.instance(); if (plugin) { myAction = qobject_cast

Creating Custom QT Library

 ̄綄美尐妖づ 提交于 2019-12-11 22:27:08
问题 I created a static Qt library by using VS2005. It created an extra file "test_global.h" besides expected ones(test.h and test.cpp). test_global.h #ifndef TEST_GLOBAL_H #define TEST_GLOBAL_H #include <Qt/qglobal.h> #ifdef TEST_LIB # define TEST_EXPORT Q_DECL_EXPORT #else # define TEST_EXPORT Q_DECL_IMPORT #endif #endif // TEST_GLOBAL_H Why this file is generated, how I suppose to use it? Thanks. 回答1: You mark your class (or methods) as exported in your library headers: class TEST_EXPORT

QT exec() command crash

房东的猫 提交于 2019-12-11 22:01:30
问题 I´m developing an application in QT 4.7.3. This application is called from Matlab(simulink) using a mexFunction (*.mexw32) When I try to open a dialog using dialog.exec() command, the form is displayed but I get a "non responding application" instantaneously. After that, matlab crashes. If i try to open the dialog using dialog.show() command, it works fine. I really have no idea of whats going on, since both commands are somehow similar, as described here Does anyone know what is happening?

QLabel not showing images using QToolButton

时间秒杀一切 提交于 2019-12-11 20:32:07
问题 I have a small minimal example of a user interface for visualizing images (both .tif, .tiff, .jpg etc) composed of: 1) N.1 QLabel (used to show the image) 2) N.1 Pushbutton (used to upload a folder) 3) N.1 QLineEdit (used to visualize the path) 4) N.2 QToolbuttons (used as left and right to look through images) I am trying to look through images using the left and the right QToolbuttons but something is not correct and I am not able to see any image. I was looking at this source as an example

No such slot button QT

孤街醉人 提交于 2019-12-11 19:24:47
问题 for(i=0; i<height; i++) { for(j=0; j<width; j++) { button[i][j] = new QPushButton("Empty", this); button[i][j]->resize(40, 40); button[i][j]->move(40*j, 40*i); connect(button[i][j], SIGNAL(clicked()), this, SLOT(changeText(button[i][j]))); } } If i changed function changeText with function (fullScreen for example) it works but when i use a slot defined by me (changeText) this Error Appears and i don't know how to solve it QObject::connect: No such slot buttons::changeText(&button[i][j]) and

Issue with scrollarea in pyqt?

天大地大妈咪最大 提交于 2019-12-11 19:16:32
问题 This is the file I generated using qt-designer. from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s class Ui_Dialog(object): def setupUi(self, Dialog): Dialog.setObjectName(_fromUtf8("Dialog")) Dialog.resize(1024, 600) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(Dialog.sizePolicy()

QMessageBox and beep after migrate from 4 to 5 qt

大兔子大兔子 提交于 2019-12-11 18:25:37
问题 After migrate project from Qt4 to Qt5 version on Windows OS lost "beep" sound on QMessageBox::(information/critical/warning/question) function. Hove can I retrieve it? 回答1: Unfortunately there is no option to enable beep sound in QMessageBox . But you can use QApplication::beep() when you show message box. If you don't want call beep() where you show message box and if you you think that you really need this, you can subclass QMessageBox and add some method which will call QApplication::beep(

QWT plugin for QT 4.5

≡放荡痞女 提交于 2019-12-11 18:08:03
问题 I have gotten the latest QWT 5.1.2 for QT 4.5 and managed to get it to complie. I am now trying to get the plugin to work in QT Designer (with VS intergration). I have placed the plugin files into the plugin/designer folder, but when attempting to load, I hit this error Cannot load library qwt_desginer_plugin5.dll: The specified module cannot be found. I've done some search on this issue, one page which suggest moving the plugin to the VS intergration folder - which does not exist for Program

Custom button PyQT4

我只是一个虾纸丫 提交于 2019-12-11 17:46:24
问题 I'm having trouble displaying a button that I create from a class in PyQt4, using Python 2.7. My project has 80 buttons that all require a drag and drop function. I've created a button class that allows this, but I'm unsure as to how to display it within Ui_Form . I don't think I can use a layout manager as I want a background image so I assume I need to create the button from the Button class using the Form argument from Ui_Form 's setupUi function, but I'm insure as to how. Below is an

Handling gui with different threads

萝らか妹 提交于 2019-12-11 16:44:42
问题 I'm new in qt and c++, and I have a problem with threads. For example, if I have a gui with two QPushButton and one QTextEdit, is it possible to set values to the QTextEdit from a thread (different from the gui main thread) without freezing the gui? // These are the values that I want to set from the thread for(i=0;i<100;i++){ qtextedit.setText(i); } 回答1: It is possible: either use a signal/slot with a queued connection, or post events to the GUI thread. Your example is fast enough to not