Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • [Solved]can i delete a topic or a post

    7
    0 Votes
    7 Posts
    3k Views
    S
    [quote author="yan bellavance" date="1311201171"]got it, thanks![/quote] Kindly please edit the title of the thread to: [SOLVED] can i delete a topic or a post
  • 0 Votes
    5 Posts
    18k Views
    A
    Thanks Bradley!!! I guess that was what Andre implied but I was unaware of these functions.
  • Quick question!

    10
    0 Votes
    10 Posts
    5k Views
    S
    I would kindly like to propose the original poster to edit the title of the thread to something more informative. :-)
  • [Solved] Mapping a column from a table to a QComboBox

    10
    0 Votes
    10 Posts
    8k Views
    E
    It works fine now. First I've understood that a proxy model automatically ads an extra row. Now I added proxyModel->insertRow(0); and it works like I want. Thank you very much!
  • Writing QGraphicsItemGroup to a .png file?

    3
    0 Votes
    3 Posts
    2k Views
    J
    [quote author="kibsoft" date="1311145041"]Maybe something like that :) @ QImage img(item->boundingRect().size().toSize(), QImage::Format_RGB32); img.fill(QColor(255, 255, 255).rgb()); QPainter painter(&img;); QStyleOptionGraphicsItem styleOption; item->paint(&painter;, &styleOption;); img.save(path); @ where "item" is your QGraphicsItemGroup. P.S. I'm not sure, but you can try..[/quote] I tried doing that, but it doesn't work; it only returns a blank image that's the same dimension of the QGraphicsItemGroup.
  • QLineEdit && use popup similar to QCompleter

    5
    0 Votes
    5 Posts
    5k Views
    L
    [quote author="Alexandra" date="1311153765"]It doesn't seem to be a real duplicate, so I reopen it after discussion with other moderators. I'll edit the other thread to keep things clean. Thanks![/quote] Thanks!
  • OpenGL and Threads

    3
    0 Votes
    3 Posts
    3k Views
    Z
    I tried the makeCurrent but I got error. As suggested by pcpower in irc (thanks), I have changed my code, and now instead of display lists I'm using Virtual Buffer Objects, with QGLBuffer. If my code is not threaded everything is working fine, but when I run threads, the buffers are created by threads (without error), but nothing is displayed - I think its because they have different contexts. Here's a sample of my code: viewer.cpp: @ Viewer::Viewer(QWidget *parent) : QGLViewer(parent) {} void Viewer::draw() { for(int i=0; i<facesToDisplay; i++) faces[i]->draw(); } void Viewer::loadNeededFaces() { for(int i=0; i<totalFaces; i++) { if(faceIsNeeded(i)) QtConcurrent::run(this, &Viewer;::loadFace, i); } } void Viewer::loadFace(int faceNumber) { Face* face = new Face(faceNumber); face->createBuffer(); } @ Face.cpp @ void Face::createBuffer() { vertexBuffer = new QGLBuffer(QGLBuffer::VertexBuffer); vertexBuffer->create(); vertexBuffer->bind(); vertexBuffer->setUsagePattern(QGLBuffer::StaticDraw); vertexBuffer->allocate(vertexs, 3totalVerticessizeof(GLfloat)); } void Face::draw() { vertexBuffer->bind()) glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3, GL_FLOAT, 0, BUFFER_OFFSET(0)); glDrawElements(GL_LINE_STRIP, 5, GL_UNSIGNED_INT, 0); glDrawArrays(GL_QUAD_STRIP, 0, totalVertices); glDisableClientState(GL_VERTEX_ARRAY); } @ The idea is to have a main GUI thread (instance of Viewer) to display the visible faces, and forecast the faces that will needed soon, to preload them using working threads, so when the user rotates the object, the faces that will appear are already precalculated (and possible in the GPU), so the loading will be smooth. The code isn't 100% correct, its just a sample of my code. Anyone can give me a hint on how to put that code working ? I think I need to get some context and then use makeCurrent. I have already tried to pass to the Face instance, a pointer to the Viewer, and then call the makeCurrent on that pointer, but with no success - "QGLContext::makeCurrent(): Failed."
  • 0 Votes
    6 Posts
    9k Views
    H
    Yes, thats exactly what I have done ;)
  • Quick Question Regarding Conversions in Qt [SOLVED]

    3
    0 Votes
    3 Posts
    2k Views
    G
    can you please show an example string that you get (in udpDataIn[61 - 64]) and show the expected result? It seems very difficult what you do there should be easier...
  • [SOLVED] How can I delete the content of a file with Qt ?

    5
    0 Votes
    5 Posts
    15k Views
    S
    Kindly please edit the title of the thread to begin with [SOLVED] ;-)
  • Dock widget resize. Many resize events.

    2
    0 Votes
    2 Posts
    3k Views
    F
    I think you should be able to use rubber band resizing, but I'm not sure how to do that and I didn't find it within five minutes :P. Normally I would say you should implement your paint event to only draw the exposed area, so take heed of the rectangle, or region passed to the paint event. It will significantly improve drawing performance in this case, as long as actually things are exposed. If you are going to be resizing a background there's not much use in this advice.
  • QScrollArea signal

    3
    0 Votes
    3 Posts
    4k Views
    E
    Thanks for the advices. I really thought Qt would manage the appearance of the scrollbar with signals. I'll try the eventfilter based in the showEvent.
  • Porting cocos2d to Qt

    3
    0 Votes
    3 Posts
    3k Views
    Q
    http://www.cocos2d-x.org/boards/6/topics/373 Here is the thread, it's porting cocos2d-x not cocos2d. I'd really love to see cocos2d on Qt. I would also love to help but I'm no expert in Qt. But at least I know the more than the basics in Qt and Objective-C, so if anyone would like to do this please let me know and I'll see what Can I do to help.
  • QPainterPath set operations deprecated in Qt 4.8

    7
    0 Votes
    7 Posts
    4k Views
    W
    Hrmm, I just noticed these were being deprecated. I'm going to really miss QPainterPath::setElementPositionAt. I use it to warp text to a curve. For example: @ QString text = "Sample string"; QFont font; QFontMetricsF fontMetric(font); qreal textWidth = fontMetric.boundingRect(text).width(); qreal circumfrance = 2PItextRadius; qreal textSweepAngle = (360.0 * textWidth) / circumfrance; QPainterPath path; path.addText(QPoint(0,0), scaledFont, text ); //warp points around a circle for (int i=0; i<path.elementCount(); i++) { const QPainterPath::Element &e = path.elementAt(i); qreal theta = MathTools::correctAngle(-90 + textSweepAnglee.x / textWidth; qreal r = textRadius - e.y; path.setElementPositionAt(i, rcos(theta), r*sin(theta)); } @ If QPainterPath::setelementPositionAt is going to be removed, won't it be impossible to warp text around a curve in Qt5? [EDIT: code formatting, please wrap in @-tags, Volker]
  • Converting display to single color output

    10
    0 Votes
    10 Posts
    4k Views
    M
    Aside from what I've mentioned, I really don't have a lot of other insight without a better idea of what the source files look like and how they're envisioned of appearing in the final display, etc. I hope you have some better ideas now after this exchange, or that anyone else might have some good insight.
  • 0 Votes
    32 Posts
    29k Views
    P
    [quote author="Gerolf" date="1311089904"]The easiest way would be put the correct dlls directly beside your executable and it should always work, regardeless of the path variable...[/quote] and, most important thing, if you put dlls in your executable directory you are ready to distribute your application: if you send only your .exe to someone else, he will have the same problem; instead, if you distribute the whole directory with dll files, everything will work without having to install or set anything.
  • How can I Update Xml files with QT ?

    4
    0 Votes
    4 Posts
    6k Views
    K
    I have not done it myself yet with Qt, but the "QDomDocument":http://doc.qt.nokia.com/4.7/qdomdocument.html seem to be a candidate to start with. The xml I have output was not very sophisticated. I have handled with ofstream. For more complex things the DOM document is in my opinion one option. There are the QXmlStreamReader and QXmlStreamWriter classes.
  • 0 Votes
    6 Posts
    4k Views
    B
    I tried using GLEW, because I was using that in the original MSVC project, but I kept getting linker errors no matter what I tried. Today I downloaded GLee and included the source code in my project. The compiler errors are gone!
  • Unique Machune Id

    2
    0 Votes
    2 Posts
    2k Views
    L
    There is no Qt way of doing it I know of. If you want to identify Windows installations you can use the Product ID (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProductId). If you want to identify systems you can retrieve various hardware identifiers using WMI or the native Windows SDK.
  • Confusion regarding insertion of QDomElement

    5
    0 Votes
    5 Posts
    3k Views
    W
    Hi KA51O this makes sense, so thank you, so I replaced line 39 with this @m_Doc->elementsByTagName("output").at(0).appendChild(e) ;@ The structure of the document is now correct and survives re-runs, but I am sure this is not the correct way (in C++ code) to do this. Can anyone clarify please?