qt5

Unable to make qmlRegisterType work

眉间皱痕 提交于 2019-12-20 10:55:08
问题 I've found some examples of qmlRegisterType on the internet but just can't make it work. I create a new Qt Quick 2 project and add the following contents: This is my .pro file: #Add more folders to ship with the application, here folder_01.source = qml/testlib folder_01.target = qml DEPLOYMENTFOLDERS = folder_01 #Libraries QT += core gui widgets #Additional import path used to resolve QML modules in Creator's code model QML_IMPORT_PATH = #Header files HEADERS += main.hpp #The .cpp file which

Building Qt5 Quick project without Qt Creator via CMake

房东的猫 提交于 2019-12-20 07:21:56
问题 Im trying to build simple Qt Quick project and want to work with it outside Qt Creator . It means coding, building and running program only with tools like Vim or CMake . I have two problems: I don't understand why CMake cannot find all needed libraries by itself and build project. I don't understand why clicking on ▶ button in Qt Creator builds default project succesfully, but running CMake by myself results in c++ error. Firstly i made CMakeLists.txt in the image of Qt5 Quick project i

QMainWindow closes right after show()

僤鯓⒐⒋嵵緔 提交于 2019-12-20 05:39:11
问题 I am new to Qt (use Objective-C mostly) so I am stuck with probably noob issue. From the QDialog window I try to open QMainWindow like this: this->close(); SQLWindow window; window.receivePath(path); //Path for the .sqlite file window.show() QDialog closes and for millisecond I see a glimpse of a new window, but it closes too. Below is QMainWindow part: SQLWindow::SQLWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::SQLWindow) { ui->setupUi(this); this->initialSetup(); } SQLWindow::

Qt 5.10 QGraphicsView cannot scale QGraphicsScene to fullscreen

本秂侑毒 提交于 2019-12-20 05:15:13
问题 I am experimenting with Qt 5.10 QMultimedia on Ubuntu 16.04 to play Gstreamer recorded videos. The meat of the application is shown below. I cannot seem to get the video to scale to the full Qt screen after I call showMaximized(). The small video shown in the middle of the screen is shown below ( I want it to scale to the entire window ): The Code: #include "mainwindow.h" #include <QVideoWidget> #include <QGraphicsView> #include <QtMultimedia> #include <QGraphicsVideoItem> #include <unistd.h>

“EGL Error : could not create the EGL surface: error 0x300b” on i.MX6 when running Qt5 application with -platform eglfs

雨燕双飞 提交于 2019-12-20 04:53:05
问题 I am trying to run the hellogl_es2 Qt example without X Server by specifying the eglfs platform: ./hellogl_es2 -platform eglfs EGL Error : Could not create the egl surface: error = 0x300b Aborted (core dumped) CPU is Freescale i.MX6. Linux kernel is 3.10.17. Distribution is Ubuntu 14.04.4 LTS (trusty). Qt version is 5.2.1, installed from http://packages.ubuntu.com, armhf architecture, packages qtbase5-dev, qtbase5-examples, qtbase5-examples-dbg. The core dump is: GNU gdb (Ubuntu 7.7.1

Qt Creator - How To Enable a Floating IDE Layout?

怎甘沉沦 提交于 2019-12-20 04:34:35
问题 I'm a long-time user of Embarcadero C++Builder peeking into Qt Creator (Ver. 4.4.0) at the moment, which seems to be well-suited for all kind of C++ development tasks and thus might be pretty productive. Unfortunately there's one major drawback slowing me down significantly in comparision to C++Builder : I can't find any setting enabling the re-arrangement of Qt Creator 's default IDE layout, since it's just not mine. Is it really the case, that such a classy-looking IDE won't have that kind

Performance issues when painting text on custom item delegates in Qt C++

最后都变了- 提交于 2019-12-20 04:24:40
问题 Goal: Creating an item delegate with custom textual content to be used in QListView. Problem: Drawing text with QPainter in a reimplementation of the paint() method of a QAbstractItemDelegate's subclass is noticably slower than drawing shapes and pixmaps. Changing the base class to QStyledItemDelegate does not improve the speed. Setup: Qt 5.9.1, MSVC 2017, tested on Windows 7/10 Pre-research: A similar bug is reported here, however in this particular case the performance issue exists even if

Implementation of Inter Thread Communication in Qt

[亡魂溺海] 提交于 2019-12-20 03:25:07
问题 I am having problem to implement the following scenario. My problem statement goes like this: I have 3 threads. ThreadCamera for grabbing frames from a camera. ThreadProcess for processing (doing some image processing with OpenCV on the image/frame grabbed) the frame and main GUI Thread for displaying the image. I don't know how much time ThreadProcess will take to process an image. So I want to pass the image from ThreadCamera to ThreadProcess , do some image processing on the image and pass

QT5 Radio button signal not compatible with function, even though it should be

萝らか妹 提交于 2019-12-20 02:58:06
问题 According to the QT5 docs, the QRadioButton inherits the 4 signals from QAbstractButton, which includes the clicked signal. The template for it is clicked(bool checked = false) so I'm confused why this code returns a long error message, part of which is error: static assertion failed: Signal and slot arguments are not compatible . Code (Simplified, may contain mistakes that are not part of the original): #include <QApplication> #include <QMainWindow> #include <QRadioButton> #include <iostream

QList of QScopedPointers

老子叫甜甜 提交于 2019-12-20 02:42:12
问题 I'm trying to store QScopedPointers in a QList. I found this comment One can also use QList >. – Kuba Ober Jan 14 '14 at 18:17 (first comment on this answer: https://stackoverflow.com/a/21120575/3095014) and this post https://forum.qt.io/topic/59338/solved-qlist-of-qscopedpointers which implies that this should work. But if I try to compile the code of the second link, I'm getting this errors: E:\Qt\Qt5Enterprise\5.5\msvc2013\include\QtCore/qlist.h(404) : error C2248: 'QScopedPointer<Label