Quantcast
Channel: Installation and Deployment
Viewing all 22112 articles
Browse latest View live

Building Qt creator with private headers

$
0
0
I have built a qt4.8 for the Freescale i.mx6 ART board and I have successfully integrated the qt4.8 qmake into qtcreator. However, when I try to view my qml scripts with the designer tab in qtcreator, the designer tab is always grayed out. I learned that the problem is the qmldesigner plugin did not build because the qmldesigner plugin requires private headers. I built qt with the configuration option -developer-build, and built the qtcreator. Also when I built qtcreator according to the instructions in the qtcreator readme file and told the qmake where to find the private headers in the qt-source build tree. Both times I built qt-creator I get this error /usr/bin/ld: skipping incompatible /usr/local/Trolltech/Qt-4.8.4/lib/libQtDeclarative.so when searching for -lQtDeclarative /usr/bin/ld: skipping incompatible /usr/local/Trolltech/Qt-4.8.4/lib/libQtDeclarative.so when searching for -lQtDeclarative /usr/bin/ld: cannot find -lQtDeclarative collect2: ld returned 1 exit status make3: *** [../../../lib/qtcreator/libQmlEditorWidgets.so.1.0.0] Error 1 make3: Leaving directory `/home/lucid/qt-creator-2.7.0-src/src/libs/qmleditorwidgets’ make2: *** [sub-qmleditorwidgets-install_subtargets-ordered] Error 2 make2: Leaving directory `/home/lucid/qt-creator-2.7.0-src/src/libs’ make1: *** [sub-libs-install_subtargets-ordered] Error 2 make1: Leaving directory `/home/lucid/qt-creator-2.7.0-src/src’ make: *** [sub-src-install_subtargets-ordered] Error 2 Any advice will be helpful

how to find the height and width of a QVBoxLayout / QHBoxLayout?

$
0
0
int myBoxLayoutheight = ui->QBoxLayout->height int myBoxLayoutwidtht = ui->QBoxLayout->width but that doesn’t work, please help me ;)

Single codebase for android, ios, blackberry, etc? Or multiple codebases?

$
0
0
I’m debating on how to organize my git branches. Any tips? I’m thinking to make a separate branch for each android, ios, blackberry, etc… But in that case, then there will be duplicate QML and JavaScript files in each branch and I will have to copy them from branch to branch to update each branch. Can I keep everything in a single branch? How can I avoid having duplicate code across branches? I’m thinking perhaps I can send the QML and JavaScript through the network, from a server, and thus have QML and JavaScript in a single branch for the server, but that would make things slower (by requiring a network). Any ideas on how I should implement the git tracking? Will future versions of Qt make it easy to build for different platforms with a single codebase?

how to use list of elements in listmodel with different features(delegates) in qml

$
0
0
there are list of elements in list model and each of the elements must link to a different delegate to give it a different view,can we use many list view in a qml file?? pls help.I am new qt.

Talking to Items inside a Component loaded with Loader / QtQuick 2.0

$
0
0
Hi, I’m looking for a proper strategy for talking to (setting properties, calling methods, etc) Items inside a Component I’m loading dynamically. I have this setup that I’ve defined a Container(.qml) — which essentially is a “dialog” — type which does some magic like provides a BorderImage, a header, etc and uses a component id / Loader to load the “dialog” content dynamically so that the Container can be reused; the Container never really knows what its children are. The setup is something like this: Container.qml: Item {     id: root     clip: true       property alias contentComponent: contentLoader.sourceComponent     property alias headerText: headerText.text       // Frame / border image     BorderImage {         id: frameImage         anchors.fill: parent           border { left: 28; top: 28; right: 28; bottom: 28 }         horizontalTileMode: BorderImage.Stretch         verticalTileMode: BorderImage.Stretch         source: "qrc:/images/container_background.png"     }       // Container area; adds automatic margins to fit things inside border     Item {         id: containerArea         anchors.fill: parent         anchors.margins: 11           // Header rectangle         Rectangle {             id: header                // .. Omitted for clarity ..               // Header text             Text {                // .. Omitted for clarity ..             }         }           // Container contents         Item {             anchors.top: header.bottom             anchors.left: parent.left             anchors.right: parent.right             anchors.bottom: parent.bottom             anchors.margins: 10 * xScale             clip: true               // Dynamically loaded content through Loader             Loader {                 id: contentLoader                 anchors.fill: parent             }         }     } } main.qml:     // This is how I'm "instantiating" the "Container":     Container {         id: myContainer         // .. Omitted for clarity ..           // Here I define the header (string) and content (Component) for my Container         headerText: "My header"         contentComponent: myContent           Component {             id: myContent             Item {                 Text {                     id: myText                    // .. Omitted for clarity ..                 }            }      } Now, say something occurs and I would like to alter properties of the Text label “myText” which is inside the Component I’m using as the Container’s content. I cannot access it normally (qrc:/main.qml:62: ReferenceError: myText is not defined) obviously since it’s loaded by the Loader inside the separate Container.qml. So I am looking for a nice pattern for talking to the items inside a such Component. Or, should that be not feasible, another approach for defining such dynamic content for reusable Item components would be welcome too. It’s QtQuick 2.0 I’m working with and I’m somewhat a beginner with it still. Cheers, - Matti EDIT: For now I’m going with the “default property alias children” -trick mentioned here: http://stackoverflow.com/questions/5021350/how-do-you-assign-a-qml-item-to-a-component-property-in-qml-and-then-use-that-ob but still interested about hearing how to deal with the Loader / Component combo.

qml problem regarding delegates ,applying different properties to different listelement

$
0
0
hello, i want to design qml front end where i want pages sliding this one i could do using corkboard example , but all the pages having the same property but i want the pages with different features please help, i am very new to qml…

Superscript/Subscript a sub-string of text in QLabel?

$
0
0
Hi, I have a QLabel with some text. I want to superscript some part of the text. How do I do that? Also what if I want to subscript? Thank You.

how two connect two qml file using simple buttom

$
0
0
can anybody give a simple program to connect 2 qml files. when a button is clicked in one qml, the other qml file should open, please help,

Help for starting

$
0
0
Hi… I am new here I want to start with Qt.Can anyone suggest me some good book or link to learn Qt?

Application Deployment - Side by side configuration is incorrect

$
0
0
I am trying to deploy Qt Application. I have used Visual Studio 2008; Windows 7 I have already gone through this [qt-project.org]. I am using Inno Setup Compiler for the task. I am also using dependency walker [dependencywalker.com] to trace which files should be deployed. Dependency walker showing me following dlls !http://s21.postimg.org/483ih176r/dependency.jpg()! I am deploying all the listed dlls, except kernel32.dll as I believe it is present on every Windows OS. I am deploying this application to person who is NOT having any compiler installed. Install goes correctly — but while executing the application user gets error “application could not start because its side-by-side configuration is incorrect”. Any help in this regard will be highly appreciated. Thanks Andrew

How to build Qt3d?

$
0
0
I cloned Qt3d from git://gitorious.org/qt/qt3d.git, but a little confused about how to build it. It this written in README correct?   First fetch the Qt5 source tree and Qt3D master branch:       cd ~/depot     git clone ssh://codereview.qt-project.org:29418/qt/qt5.git     cd qt5     ./init-repository --codereview-username <username> \         --module-subset=qtbase,qtsvg,qtdeclarative,qttools,qtxmlpatterns,qtdoc,qlalr,qtrepotools,qtqa,qtlocation,qt3d     git submodule foreach "git fetch gerrit && git reset --hard gerrit/master"     cd qt3d     scp -p -P 29418 codereview.qt-project.org:hooks/commit-msg .git/hooks/     git fetch gerrit     git checkout --track -b master gerrit/master   If you are reading this file then somehow you probably already got this far anyway.   Now build Qt5, which will also build Qt3D as a module:       cd ~/build     mkdir qt5     cd qt5     ~/depot/qt5/configure -developer-build -opensource -confirm-license -no-webkit -no-phonon -nomake tests \         -nomake examples -declarative -opengl -svg && make -j 4 1). It seems that I don’t have permissions as an anonymous user when executing “git clone ssh://codereview.qt-project.org:29418/qt/qt5.git” Is git://gitorious.org/qt/qt5.git the same as ssh://codereview.qt-project.org:29418/qt/qt5.git ? 2). What does git fetch gerrit && git reset —hard gerrit/master mean? 3). I guess I won’t have permissions to execute this: scp -p -P 29418 codereview.qt-project.org:hooks/commit-msg .git/hooks/ Although I haven’t come to this step.

Is it possible to change the background color of compile and issues window?

$
0
0
Hi I use a dark theme and I want to change the background color (which is white now) of compile and issues window to something dark. I am one of those people with light sensitive eyes, so looking at white background is not fun at all. I am hoping that there is way to do this in QTC. thanks

QtMobility header not found on Mac OS X

$
0
0
Hello. I am trying to install QtMobility on Mac OS X. I need only the systeminfo module, so I do the following: ./configure -modules systeminfo -prefix /usr/local/QtMobility make make install I see QtSystemInfo.framework installed, but when I try to build quickstart sample, it can’t find QSystemInfo header. Also I see Xcode doesn’t add QtSystemInfo.framework to the project. Even if I drag it manually, it is shown in red color like a missing file. Installation guide tells I have to expand LD_LIBRARY_PATH variable, so I tried to add the following to /etc/profile: LD_LIBRARY_PATH=/usr/local/QtMobility/lib:$LD_LIBRARY_PATH export LD_LIBRARY_PATH Also tried to expand DYLD_LIBRARY_PATH instead. Nothing works. I’ve tried it on different Mac OS X versions (10.6 and 10.7) with no success. What should I do in order to make QtMobility available for my projects?

Changing a QML Listview title when the content of the Listview changes

$
0
0
I can only seem to get the Listview header to populate when the qml file containing the Listview is loaded. Whenever the content of the Listview changes I need to change the header content. How??? :-)

Loading qml into an area of main.qml

$
0
0
I have an application where main.qml has a subtitles bar and then an ‘application’ area which needs to show a qml ‘screen’ and the screen needs to keep the subtitle bar up to date. The ‘application’ area needs to show the qml from a dll – each actual application (email, bookreader etc) is in a dll which is all fine on the c++ side (have it working perfectly with widgets) but I just cannot fathom how to load the qml from the dll into the ‘application’ area. Is there a way without digging too deep into the qml (want to keep it ui only) or am I going to have to have every application have its own subtitle bar?

OpenGL Tutorial Release 1.0 by Digia, Qt Learning

$
0
0
The OpenGL Tutorial [qt-project.org] (dated February 28, 2013) provided is a excellent introduction to OpenGL using the Qt framework. However, the document has some inconsistencies regarding the shaders. I can’t find any other ways of giving feedback other than posting here: Edit: The document does not state what version of Qt it is based on, but I am using Qt 5.0.1. This of course implies the use of OpenGL ES, and I would assume that a tutorial published on February 28th 2013 was using Qt 5.0.1. The source code examples referred to in the documents have however problems compiling in Qt 5.0.1 due to the shaders. Section 3.1, page 20: paragraph states: “.., the vertex variable needs to be declared as an attribute vec4.” But in the following source code it is declared as: in vec4 vertex;, and this do not compile (QOpenGLShaderProgram). It should be attribute vec4 vertex; Same section and page: paragraph states: “The main() function the sets the built in hl_FragColor output variable…”. First, it is gl_FragColor. Secondly, the following source code is given in the document: uniform vec4 color; out vec4 fragColor; void main(void) {   fragColor = color; } This results in a compiling error when calling QOpenGLShaderProgram.addShaderFromSourceCode(QOpenGLShader::Fragment,…. It should be: uniform mediump vec4 color; void main(void) {   gl_FragColor = color; } As the document is self is pointing out, functions in GLSL need to specify in/out, but this do not apply for the main-function. The same errors occur in the shaders given in section 3.3 page 27, section 3.4 page 30 and section 3.5 pages 34-35. Luckily, I saw it right away, but as an introduction tutorial it should be corrected.

Stopping and deleting background QThread and its worker

$
0
0
I have UDPListener class (derived from QObject) that is a worker run in a background QThread. It is standard (as far as I know) way of doing it: I’m constructing parent-less UDPListner object in main thread. I’m constructing parent-less QThread object in main thread. I’m connecting QThread::started to UDPListener::run. Also I’m connecting UDPListener signals to my own slots on main thread objects that will handle received data. I think it doesn’t matter here. I’m moving the UDPListener to the QThread (with QObject::moveToThread). I’m starting the thread (with QThread::start). The UDPListener listens to multicasts and propagates received data to the main thread. There is no end to this. It does so for the life time of the application. I noticed that the UDPListener object is never destroyed. Also QThread is not destroyed. If I make some main thread object a parent of the QThread then it is destroyed but emits a warning on output that QThread was destroyed while still runing. And sometimes causes failures. So now during destruction of the main thread object “owning” the QThread and UDPListener I’m calling QThread::quit on the background thread. It does quit the thread (it is visible on debugger output that thread exited). But still neither QThread nor UDPListener are deleted. So I connected deleteLater on both of them to QThread::finished. But it doesn’t delete neither of those object. It seems UDPListener is not deleted since the thread in which it exists (the background thread) already exited its events loop (by the call to quit). And same issue with QThread since the “owning” main thread object is destroyed as a child of QApplication which is destroyed by leaving main (as its local variable). So how should I assure that the background thread quits properly and then both the UDPListener that lived in it and the thread itself are deleted (destroyed)?

QML Video element and Gstreamer options

$
0
0
Hi everyone, I’m trying to show a video on my qml code (qt5), I’m working on a ARM device. The problem is that if I create a Video tag (QtMultimedia 5.0) with a sample video I cannot see any video playback. The error I got is: (helloworld:927): GStreamer-CRITICAL **: gst_object_ref: assertion `object != NULL' failed   omx_setup error while setting FilterTimestamp Allocating new output: 1280x720 (x 12) Error: "The autoaudiosink element is missing." And that’s true, I’ve no autoaudiosink on gstreamer, I’m using nvidia proprietary driver so I’ve got “nv_omx_videosink” and “nv_omx_audiosink”. I can play the video with the following command: gst-launch filesrc location=big_buck_bunny.mp4 ! qtdemux name=demux demux.video_00 ! decodebin ! nv_omx_videosink force-aspect-ratio=true demux.audio_00 ! nv_omx_aacdec ! alsasink But how can I tell to the Video element to use another sink element other than the auto one? Thank you.

How to postpone function call as event in the loop?

$
0
0
I have an UDPListener object (derived from QObject) that is run on a dedicated background QThread. It joins a multicast group and keeps reading and propagating datagrams. UDPListener::run slot (invoked in respons to QThread::started signal) connects to QUdpSocket::readyRead signal (a function “processDatagrams” which keeps reading datagrams as long as there are any and the returns). Then UDPListener reads all already pending datagrams (since readyRead will not be emitted if there are already pending datagrams) with the very same “processDatagrams” and in the end returns. Now the thread runs its loop and whenever readyRead is emitted UDPListener will again read all pending datagrams and return. This works fine (at least it seems so). But if I’m not mistaken (correct me if I’m!) if datagrams keep coming fast enough I will keep reading them in the “processDatagrams” function and never return control to the events loop. It might be better to read one datagram at a time and return to events loop. But how would next datagram be read if readyRead will not be emitted in such cases? So I thought that after reading a datagram I could check if there are any other datagrams and if so then somehow post to the events loop a second invocation of the read method and just return. If there would be no more datagrams then I could just return since if new datagram appears readyRead will be emitted. Is it proper approach? How to post (postpone in fact) such method invocation?

Problema cu legarea la baza de date

$
0
0
Am introdus codul urmator #include <QCoreApplication> #include <QtSql> #include <QtDebug>   int main(int argc, char *argv[]) {     QCoreApplication a(argc, argv);   //    QString servername = "LOCALHOST\\SQLEXPRESS";     QString servername = "LOCALHOST\\MYSQL";     QString dbname = "test.dat";       QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");       db.setConnectOptions();       QString dsn = QString("DRIVER=(SQL Native Client);SERVER=%1;DATABASE=%2;UID=root;PWD=root;").arg(servername).arg(dbname); //    QString dsn = QString("DRIVER=(SQL Native Client);SERVER=%1;DATABASE=%2;Trusted_Connection=Yes;").arg(servername).arg(dbname);   //    db.setDatabaseName(":memory:");     db.setDatabaseName(dsn);       if(db.open())     {         qDebug() << "Opened!";         db.close();     } else {         qDebug() << "Error: " << db.lastError().text() ;     }           return a.exec(); } Si obtin eroarea “out of memory Error opening database” Problema pare a fi la numele serverului sau string-ul dsn. Mentionez ca folosesc UniServer, cu Apache si MySQL. Salutare, Mihnea Edit: Rezolvat! [ https://qt-project.org/forums/viewthread/26150/#119424 ]
Viewing all 22112 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>