qt5

Compute shader not writing to SSBO

a 夏天 提交于 2019-12-23 02:36:07
问题 I'm writing a simple test compute shader that writes a value of 5.0 to every element in a buffer. The buffer's values are initialized to -1, so that I know whether or not creating the buffer and reading the buffer are the problem. class ComputeShaderWindow : public QOpenGLWindow { public: void initializeGL() { // Create the opengl functions object gl = context()->versionFunctions<QOpenGLFunctions_4_3_Core>(); m_compute_program = new QOpenGLShaderProgram(this); auto compute_shader_s = fs:

undefined reference to `_imp___ZN10HTTPClient5abortEv' and others

烈酒焚心 提交于 2019-12-23 02:32:07
问题 I am migrating a huge project from Qt 4.x to 5, I am almost finished but Im having errors that I cannot locate, I think it has to do with the linkage of some libraries but I am somewhat lost here. I hope someone can throw some light on this matter. Errors: ./release\addeditaton.o:addeditaton.cpp:(.text+0x6ac2): undefined reference to `_imp___ZN10HTTPClient5abortEv' ./release\addeditaton.o:addeditaton.cpp:(.text+0x98c5): undefined reference to `_imp___ZN10HTTPClient3getE7QStringbb' ./release

Filtering only dirs and xml file in QFileSystemModel in Qt

我们两清 提交于 2019-12-23 02:21:13
问题 i have implemented a custom file browing dialog with the help of QListView QTreeView QFileSystemModel What i want ! a browsing dialog which use to browse xml file only. So i want to show dirs and xml files only in QListView if a dir has xml file then xml file will list under that dir otherwise just display dir as empty ( no matter how many it holds except xml ) like in most of cases where you are browsing a specific type of file. as in MSWord ( show only .doc and .docx to browse) What i have

Is it possible to transmit pointer to model from C++ to Qt Quick TableView?

不打扰是莪最后的温柔 提交于 2019-12-23 01:35:06
问题 I have class with QSqlDatabase and with pointer to QSqlTableModel in one class. I use pointer to QSqlTableModel, because initialization of database is going on in constructor and after that I create QSqlTableModel using this database (also in constructor but in heap already). This class is registered type in qml and so I create it in QML. How is it better to point out TableView to the QSqlTableModel pointer of this class? If it is possible. 回答1: It is not entirely clear what you're asking. I

How to get Qt 4/5 to build using VS2012 while targeting Windows XP?

99封情书 提交于 2019-12-22 15:52:25
问题 I'm trying to build Qt 4.8.5 / Qt 5.2.1 using Visual Studio 2012, targeting Windows XP (SDK v7.1a). There are various incompatibilities of the source with SDK v7.1a while compiled with VS2102, so it doesn't work out of the box. This is to be a canonical question that provides the knowledge necessary to successfully build Qt in such an environment. 回答1: First of all, the build environment needs to be prepared as below. Caveat emptor: There are variants of this script "out there" that have

How can I print a QWidget in Qt?

假如想象 提交于 2019-12-22 11:17:36
问题 I need to know how to print a QWidget as a PDF file. The Widget (QDialog) contains a lot of labels, some QPlainTextEdit and a background image. The Dialog shows a receipt with all of its field already filled. I already tried using QTextDocument and html for this purpose, but the complexity of the receipt(lots of image and format customisation) makes the html output completely messed up. This is the document. Receipt image 回答1: You have to use QPrinter and this is the object that you must use

How to use QWebEngineUrlRequestInterceptor

家住魔仙堡 提交于 2019-12-22 11:11:04
问题 I need to intercept requests made in our WebEngine qml component in our Qt application. I have found documentation on QWebEngineUrlRequestInterceptor which seems to do just this here http://doc.qt.io/qt-5/qwebengineprofile.html#details and here http://doc.qt.io/qt-5/qwebengineurlrequestinterceptor.html#details. However I haven't found any code examples on how to do this in Qt/C++. Any help is appreciated. 回答1: Managed to puzzle it together with the help of this post: https://forum.qt.io/topic

What is the lifespan of the captured stack allocated variables in lambda functions used as slots?

不羁的心 提交于 2019-12-22 10:45:03
问题 I need help understanding the way lambda functions work in order to prevent memory leaks when using them. More specifically, I would like to know when foo will be destroyed in the following case: void MainWindow::onButtonClicked() { QTimer *t(new QTimer(this)); bool foo = false; t->setSingleShot(true); t->setInterval(1000); t->start(); connect(t, &QTimer::timeout, [=](){ delete t; qDebug() << foo; }); } What about the case when [&] is used? 回答1: An evaluated lambda expression is a functor

Is it possible to run a Qt 5.10 programm on XP?

喜夏-厌秋 提交于 2019-12-22 09:37:11
问题 I have deployed a 5.10 32bit msvc programm.exe and it works ok on windows 8.1. But I have to run it on XP and I can not do it. It says " progamm.exe is not a valid Win32 app ". Am I doomed? Do I have to use the last version of Qt that supports XP, like Qt5.6? Thank you! 回答1: The latest version that supports XP is Qt 5.6.3. The Windows XP support is not enabled by default. You have to download the Qt source-code and compile it with ./configure -target xp . This means, if you install Qt 5.6.3

How to use the threads to create the images thumbnail

梦想的初衷 提交于 2019-12-22 08:53:07
问题 I'm use QTreeView to get the images path, then I'm use QListView to display the images that in specific path as thumbnail. The problem in the period, create and display the thumbnail images. The previous process, take a long time to done, depend on the number of images. And for that reason I decided to use the threads, maybe helps to prevent the hung up which occur in application and increase the speed of create and display the thumbnail images. void mainWidget::on_treeView_clicked(const