qt5.4

Is is possible to edit an individual Widget in the QtDesginer?

左心房为你撑大大i 提交于 2019-12-25 01:36:46
问题 I got a external library, which includes a derived class from QGLWidget, very similar to that one here. In that library I have a class: class PictureGLWidget : public QGLWidget { //.. } This extends Qt's native QGLWidget and personalizes it. But it was not written by me, I just got it, via a *.dll. So then, I bind that Widget manually in my code to a layout like: QGridLayout* layout = new QGridLayout; layout->addWidget(myPictureGLWidget, 0, 1); ui->verticalLayout_5->addLayout(layout); since I

How to override a Q_Property?

别说谁变了你拦得住时间么 提交于 2019-12-24 07:46:28
问题 Consider these classes: Class A : public QObject { ... Q_PROPERTY(int value READ value WRITE setValue NOTIFY valueChanged) virtual int value() { return m_value; } void setValue(int v) { m_value = v; Q_EMIT valueChanged();} ... }; Class B : public A { ... int value() { return m_value * 2; } ... }; When property value is accessed, the Class A method is called directly instead of Class B's. So far, to workaround this apparent limitation I've replicated the property code and connected the signals

Qt load indicator by animated image (aka preloader) or alternative?

醉酒当歌 提交于 2019-12-23 15:41:05
问题 I want to display an animated loader image on my table view while loading. The screenshot below shows an impression. I have used an animated gif for that, displayed by setStyleSheet as centered background image. I face two issues: The gif is displayed, but not animated. Is it possible to display an animated gif as background image (via stylesheet)? Remark: In general an animated gif is possible as shown in Qt - How to show gif(animated) image in QGraphicsPixmapItem but there seems to be no

How do I add matplotlib plugin to Qt5.4 Designer plugins?

北城余情 提交于 2019-12-23 02:36:45
问题 For a project I have to combine matplotlib with a pyqt5-gui designed with the Qt5.4 Designer . The tutorial for adding PyQtdesignerplugins version 1.1 doesn't work. Install was correctly build with pip3 and the export of the env-variable s were written to the bashrc as followed by a re-log-in. In Tools of Qt Creator 3.3.2 based on Qt5.4.1 built on March, 4th, 2015, I found under "form Editor" -> "About Qt Designer Plugins" . Next I get a dialog which just informs me what plugins were found. I

Render web content offscreen using QtWebEngine

泪湿孤枕 提交于 2019-12-22 09:07:21
问题 I am trying to port an application that uses QtWebKit to render web content over to one that uses QtWebEngine. I am limited what I can change architecturally so I have to stick with the current approach of rendering the page, capturing to a memory buffer and then moving that across to a different process where the buffer is used as a texture in OpenGL. I've tried porting the code over (broadly speaking) by replacing WebKit with WebEngine, but the APIs are different. Can anyone tell me if this

How to assign SQL query output model from Qt to QML's TableView?

时光总嘲笑我的痴心妄想 提交于 2019-12-21 20:57:57
问题 From C++ (Qt): int main(int argc, char *argv[]) { QApplication app(argc, argv); /* * I have omitted the code about connection with the database and all for ease of * viewing the code. */ // My own function for filling in the data in the `QSqlQueryModel` QSqlQueryModel* model = new QSqlQueryModel; QString binid = "B1"; QString query = "SELECT t1.BinId, t1.PartitionId, t2.UnitId, t2.ItemCount FROM Bin_Partitions AS t1 " "INNER JOIN Partition_Units AS t2 ON t1.PartitionId = t2.PartitionId "

No default repositories in Qt Maintenance Tool

对着背影说爱祢 提交于 2019-12-18 10:53:17
问题 I recently installed Qt 5.5 and its MaintenanceTool (MaintenanceTool.exe). The default repositories were working, but after one day, my MaintenanceTool suddenly reports that no repositories were set? I can temporaryly enter individual repositories in the MaintenanceTool, but I would like to get the default repos set. Why are they gone? How can I set the default repositories again? Thanks in advance 回答1: The Maintenance Tool is doing crazy things since the recent updates made by Qt team. The

setMainQmlFile`, rootObject and showExpanded are not members of QQmlApplicationEngine

社会主义新天地 提交于 2019-12-13 07:35:12
问题 I've written this piece of code following some guys tutorial but I can't get it to run. The error says: setMainQmlFile`, rootObject and showExpanded are not members of QQmlApplicationEngine What it's supposed to do is get a signal from QML and print out a message (in console). Basically I'm trying to integrate C++ and QML. EDIT I've tried to replace some of the functions with some others that seemed appropriate (at least to me). I've also tried to find what to include so that these functions

Is QPixmap reentrant?

爱⌒轻易说出口 提交于 2019-12-12 03:07:16
问题 I have a program that needs to load a lot of QPixmaps. I split the loading of the pixmaps in several jobs using QtConcurrent::mappedReduced (I actually load a bunch of QGraphicPixmapItem s). The loading function calls only the constructors of the QPixmap s/ QGraphicItem s, it does not attempt to perform any drawing, and it does not communicate with the rest of the world (at least through my code) until the loading is finished. I get some random crashes during the initialization (say 1% of the

How do I add matplotlib plugin to Qt5.4 Designer plugins?

僤鯓⒐⒋嵵緔 提交于 2019-12-07 18:01:28
For a project I have to combine matplotlib with a pyqt5-gui designed with the Qt5.4 Designer . The tutorial for adding PyQtdesignerplugins version 1.1 doesn't work. Install was correctly build with pip3 and the export of the env-variable s were written to the bashrc as followed by a re-log-in. In Tools of Qt Creator 3.3.2 based on Qt5.4.1 built on March, 4th, 2015, I found under "form Editor" -> "About Qt Designer Plugins" . Next I get a dialog which just informs me what plugins were found. I can refresh it, but that didn't change anything. Since the PyQtdesginerplugins which are installable