qt4

Targeting Qt child widget with gstreamer

社会主义新天地 提交于 2019-12-14 04:05:06
问题 I have a gstreamer pipeline which ends with a xvimagesink element. To have the video displayed in a particular window , I can use the x_oerlay_interface : gst_x_overlay_set_xwindow_id(GST_X_OVERLAY(xvsink), winid); So far, so good. However, it only works if winid is the idea of a top level window, which is not the case of child widget. Let's say I have : A dialog widget DialogWidget A video widget VideoWidget, which is a child of DialogWidget. If I use DialogWidget->winId() , then the video

QT + CUDA setting qmake.pro file

≯℡__Kan透↙ 提交于 2019-12-14 03:57:41
问题 I'm trying to do a simple Qt + Cuda framework with an Helloworld.cu example. It is the simplest Qt ever. I'm trying to create the project file using a .pro file. My setup is windows 7, Qt 4.7.4 and Cuda toolkit + SDK (last version). Everything for Qt is working. What is not working is the Cuda part of the code, and that's probably because there is something missing in the .pro file...is there a simple paste/copy i could use for cuda in my .pro file? thanks 回答1: Take a look at http://cudaspace

qt4 build fails with message error

混江龙づ霸主 提交于 2019-12-14 03:17:22
问题 I'm trying to build the qt-all-opensource-src-4.5.3 sources, I'm on a debian testing and build fails with the following error message: g++ -c -pipe -g -fno-exceptions -O2 -Wall -W -D_REENTRANT -DQT_NO_CAST_TO_ASCII -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_XML_LIB -DQT_CORE_LIB -DQT_SHARED -I../../../mkspecs/linux-g++ -I. -I../../../include/QtCore -I../../../include/QtXml -I../../../include -I.moc/release-shared -o .obj/release-shared/preprocessorcontrol.o

How do I determine the height of a QTextDocument?

烂漫一生 提交于 2019-12-14 02:08:54
问题 Given a specific width, I want to find out the height of a QTextDocument . In other words, if the QTextEdit that contains the QTextDocument is w wide, what is its minimum height h in order to fully display the document without the need for scrollbars? 回答1: Set the width for the QTextDocument object to your desired with and then call the function size().height(), this should return the height required for the width you have give it before. Have a look at the size() function documentation of

Morphing multiple executables into a single application

白昼怎懂夜的黑 提交于 2019-12-14 01:32:56
问题 I have three legacy applications that share a lot of source code and data. Multiple instances of each of these applications be executed by a user at any time, e.g. a dozen mixed application executions can be active at a time. These applications currently communicate through shared memory and messaging techniques so that they can maintain common cursor positioning, etc. The applications are written primarily in C++, use Qt and run in total to about 5 million lines of code. Only some of the

Why am I missing the Qt Multimedia functionality?

只愿长相守 提交于 2019-12-14 00:30:41
问题 I am new to Qt and I'm creating a simple application which will playback an audio file. I realized that I am lacking the Qt Multimedia API for audio when I wrote: #include <QAudioOutput> ..and I get that there is no such file. I downloaded the latest Qt SDK framework and I can't find a way to add these APIs. I am using Qt creator IDE. IS there a way to get the multimedia functionality working maybe as an add-on or some other way? Thanks. 回答1: Try including it like this: #include <QtMultimedia

What is the correct way of QSqlDatabase & QSqlQuery?

烂漫一生 提交于 2019-12-14 00:15:14
问题 I got confused with the manual , should i work like this: { QSqlDatabase db = QSqlDatabase::addDatabase (...); QSqlQuery query (db); query.exec (...); } QSqlDatabase::removeDatabase (...); As the document points out, query or db will be deconstructed automatically. But is that efficient ? Well , if i cache db inside a class , like the following: class Dummy { Dummy() { db = QSqlDatabase::addDatabase (...); } ~Dummy() { db.close(); } bool run() { QSqlQuery query (db); bool retval = query.exec

Qt vs XCB: How powerful is Qt to do low level tasks?

别等时光非礼了梦想. 提交于 2019-12-13 20:07:34
问题 I'm trying to create a program to lock the screen of a computer with Linux OS which is to be unlocked using my own authentication mechanism. Can I do it in Qt alone( The lock screen, the ability to switch to the lock screen ...) or do I need to learn XCB or something related? 回答1: Window or session management like locking the screen isn't covered by Qt. You'll need to use native API. Usually locking the screen isn't something random applications do, but something the desktop environment

Signal QWebPage::loadFinished(bool) returns twice?

戏子无情 提交于 2019-12-13 19:08:34
问题 I got a problem with QWebPage::loadFinished (bool) signal , it calls back twice , is that normal ? ( there's no link following at all , e.g HTTP status 302 ) Consider the following code , the whole thing may cause problem , is trying to load another link within that slot , will this be a problem ? If i do a qDebug() << thisUrl; each time in loadFinished(bool) slot , i could see it for 3 times , is that normal , one for url XXX , and two for url YYY , and the last two links are exactly the

QTreeView custom row height of individual rows

强颜欢笑 提交于 2019-12-13 18:18:42
问题 Is it possible to redefine the row height of certain individual rows within a QTreeView ? I have a custom QTreeView , custom QAbstractItemModel and a custom QStyledItemDelegate , but it seems that all the sizeHint methods are either called only once (initially) or are not virtual in the base classes. Qt Version 4.7.4, no upgrade to 5 possible. Any help appreciated. 回答1: Reimplement the delegate’s sizeHint(). Found an example in some production code of mine. It is shown simplified below. In