Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Getting frame bits data from video stream

    1
    0 Votes
    1 Posts
    932 Views
    No one has replied
  • Access WebCam

    3
    0 Votes
    3 Posts
    9k Views
    A
    Hello thank you very much for your reply, I'll try it.
  • QTextDocument::addResource question please

    10
    0 Votes
    10 Posts
    5k Views
    A
    [quote author="przybysh" date="1330692429"][quote author="Volker" date="1330691822"] @przybysh: It's stated nowhere that loadFromData() requires the uchar array to be valid dring the life time of the QImage object. The source code doesn't suppose that either. The overload that takes a QByteArray just calls the uchar version, so anything that holds true for the one does so for the other too.[/quote] I agree that it's not stated explicitly. Later today I will provide example which proves that loadFromData() requires valid data during life time. For me loadFromData acts just like bq. QImage ( const uchar * data, int width, int height, Format format ) [/quote] OK, I took a look at the code, and my conclusions are that loadFromData follows a completely different code path than the constructor version, but that indeed the QByteArray version is the same as the uchar* version (in quite a weird way, actually[1]). The loadFromData version creates a QBuffer, and then uses the normal image loading code (QImageReader) to create a new image, which is then assigned to this using an explicit operator=() call. My conclusion is that the data does not need to stay valid after that. [quote author="phantom23" date="1330745543"]I have two follow-up questions if it is not too much of a hassle: If QImage does indeed create a deep copy of the image data, should I assume that the destructor will release the memory? Or should I create a QByteArray, copy the image data into that and release it myself when the iamge is no longer needed? [/quote] QByteArray will take care of clearing up its own data. There is no need for manual memory management here. QImage using this path indeed will own the data it stores the image in. [quote] I also have a question related to QTextDocument::addResource(). When I'm done with the image, should I re-set the resource name using a null QVariant, or is that not necessary?[/quote] I'm not sure what you mean by this exactly. [1] The QByteArray version calls the uchar* version, which in turn creates a QByteArray from the raw data. Doing it the other way around would have been more logical, IMHO.
  • Does Qt Widgets has SOftware OVERLAY support.

    1
    0 Votes
    1 Posts
    875 Views
    No one has replied
  • Environment Variables

    18
    0 Votes
    18 Posts
    10k Views
    A
    Where's this build file?
  • [Solved] Swapping QDeclarativeView QML Sources

    6
    0 Votes
    6 Posts
    3k Views
    T
    hopeful bump.... trying to get this all sorted by tomorrow.
  • [Solved] Problem clicking QPushButton with a menu

    8
    0 Votes
    8 Posts
    4k Views
    B
    in addition to tagging it at solved
  • "Not so basic" drawing application

    24
    0 Votes
    24 Posts
    16k Views
    ?
    BTW, here is my interpolation logic, it is fairly primitive, but I ain't no programmer yet, and I do realize Qt might have a better API for this, so any recommendations are welcome! @void Widget::drawLine() { QPointF point, drawPoint; point = newPos - lastPos; int length = point.manhattanLength(); double xInc, yInc; xInc = point.x() / length; yInc = point.y() / length; drawPoint = lastPos; for (int x=0; x < length; ++x) { drawPoint.setX(drawPoint.x()+xInc); drawPoint.setY(drawPoint.y()+yInc); drawToCanvas(drawPoint); } }@ Edit: One optimization that comes to mind looking at the code now is use the rx and ry methods of QPoint that return references to use the += on and save the extra function call...
  • Opengl with QGraphicsItem and QGraphicsScene?

    4
    0 Votes
    4 Posts
    10k Views
    ?
    @TheDestroyer - 3d is just an illusion anyway, and there are plenty of ways to draw 3d in Qt, it is just that the 3d api is pretty basic, not very feature rich and really just intended for basic 3d, by no means a substitute for a game engine. AndreAhmed - there are plenty of examples on using OpenGL in Qt - just take a look. The "40000 chips":http://qt-project.org/doc/qt-4.8/demos-chip.html example in particular makes use of QGraphicsView and offers both software and OpenGL rendering
  • Memory leak with QLocalSocket

    3
    0 Votes
    3 Posts
    3k Views
    S
    Hi I didn't found a memory leak in my code (maybe I'm wrong). If I remove the write functions to the socket object is there no increasing memory use. That's the reason that I believe the leak is in the socket object. If I delete the QLocalSocket object in the thread, the memory is free. Than I instantiate the QLocalSocket again and all runs. But I think it's not a good style to delete and instantiate an object again and again.
  • Where to get qt 2.3 for windows? (the old qt release from year 2001)

    6
    0 Votes
    6 Posts
    3k Views
    Z
    @nokiadev: thank you so much for your help, this is exactly what I needed. @Andre: I contacted Digia but they don't support old trolltech releases of qt, Thank You all!
  • Regarding Registering QT dll using regsvr32

    3
    0 Votes
    3 Posts
    2k Views
    M
    Hi, I've seen this problem myself in the past and the missing IESHIMS and IEFRAME dlls was a red-herring and had nothing to do with the issue. If you copy those files across, you'll likely just find other missing dlls that it will complain about. Instead the problem was actually one of our own dlls that was missing. Hope that helps.
  • QTcpSocket and WebKit: form post data gets lost

    5
    0 Votes
    5 Posts
    4k Views
    G
    d'oh, you are right (both), just didn't understand it the first tme. As i close the connection on the first readReady signal, the second never had a chance to occur. Thanx a lot!
  • Drawing QGraphicsItem inside QGraphicsPolygon

    7
    0 Votes
    7 Posts
    5k Views
    M
    Unless I'm missing something in glancing at your code, it looks like you've created the nodes in the constructor of the block, but the nodes still aren't parented. Try this: - mNodes.append(new Node(this)); Note the 'this' pointer being added as a parent to the Node and make sure that the parameter gets passed through to the base class (QGraphicsItem) in the Node constructor.
  • QTextEdit freeses

    3
    0 Votes
    3 Posts
    2k Views
    Z
    Good idea. Maybe it works
  • Problem in subclassing QTable

    8
    0 Votes
    8 Posts
    3k Views
    A
    ok... 1.My files are all tab spaced values..each file size may range from few MB's to 1.5Gb.. 2. Most of the values in the table are number (1 to 256 digit), but text also present 3. I want to show this file content in a table format... 4. In that table i may perform searching operation for particular value... I tried using model view...code is shown below.... But using this i was unable to load files more than 50Mb...:( Please suggest me what else i can do? @ model = new QStandardItemModel(this); while(!f.atEnd()) { line=f.readLine(); LineList=line.split(" ",QString::SkipEmptyParts); int row =model->rowCount(); model->insertRow(row); for(int i=0;i<LineList.count();i++) { QStandardItem *fileNameItem=new QStandardItem(LineList.at(i)); fileNameItem->setFlags(fileNameItem->flags() ^ Qt::ItemIsEditable); model->setItem(row,i,fileNameItem); } } f.close(); table=new QTableView(); table->setModel(model); ui->tabWidget->addTab(table,"NEW TAB");@
  • Change pixels in an image.

    4
    0 Votes
    4 Posts
    2k Views
    K
    Please mark your post as solved then.
  • 0 Votes
    10 Posts
    9k Views
    A
    HI , I have just tested my transparency code in Suse Linux, which is having Qt 4.6.3 run time libraries. I am getting totally black window instead of transparent window and on commnad prompt I am getting message as "QGtkStyle was unable to detect the current GTK+ theme." Please help what is going wrong on Linux. Am I missing some X11 related display driver on Linux machine
  • QNetworkManager fails to download from furk.net

    Locked
    3
    0 Votes
    3 Posts
    2k Views
    A
    None, so I close this one.
  • Why the shortcut display wrong?

    1
    0 Votes
    1 Posts
    770 Views
    No one has replied