Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • Flip or rotate viewport within QOpenGLWidget in Qt 5.8

    Unsolved
    2
    0 Votes
    2 Posts
    2k Views
    johngodJ
    Hi there You cannot use glScalef() in the core profile. You now rotate the images using a rotation matrix in the paintGL() method (not in resizeGL(...) ) and then pass it to the vertex shader where the rotation is applied. Something like this: void MyGL::paintGL() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glUseProgram(program); QMatrix4x4 view; view.setToIdentity(); view.rotate(90, 1.0f, 0.0f, 0.0f ); //90 degree around x axis view.scale(scaleX, scaleY, scaleZ);// also do some scaling if you want glUniformMatrix4fv(glGetUniformLocation(program , "matrixRotation"), 1, false, view.constData());// send the matrix to the shader ..... Now in the vertex shader: uniform mat4 matrixRotation; layout (location = 0) in vec4 position; void main() { gl_Position = matrixRotation * position; ...
  • pyQt How do I get a widget from a QListWidgetItem?

    Solved
    4
    0 Votes
    4 Posts
    3k Views
    SGaistS
    Hi, That's because you put a widget in it which means it's that widget that will get the events.
  • Sizing a bottom dock widget with a TabWidget in the Main Window

    Unsolved
    1
    1 Votes
    1 Posts
    404 Views
    No one has replied
  • Paint widget directly on QListView with QStyledItemDelegate::paint()

    Solved
    21
    0 Votes
    21 Posts
    13k Views
    S
    @VRonin I managed to paint everything manually... I had to calculate the coordinates of every widget and draw it, and it worked. I have to say it's quite depressing that Qt doesn't have a solution to paint a widget as is. Thanks for the help, and have a nice day :-)
  • Creating info tips like shown in Adobe Lightroom CC

    Solved
    12
    0 Votes
    12 Posts
    3k Views
    mrjjM
    Hi [image: cdwTF0.png] paintEvent + painter.setCompositionMode(QPainter::CompositionMode_Clear); painter.fillRect(rect, Qt::transparent); allows to not dim an area so widget is clearly visible.
  • Add source files - works on CLI, not in Qt Creator

    Solved
    9
    0 Votes
    9 Posts
    2k Views
    J
    We found the issue. With the header file, we needed to do an: extern "C" { #include "file.h" }
  • 0 Votes
    6 Posts
    6k Views
    JKSHJ
    @jronald said in QObject: Cannot create children for a parent that is in a different thread, but it works, why?: it works! Why? This is called "Undefined Behaviour". It doesn't follow the rules, but it seems to work. However, the problem is: it might suddenly stop working in the future. So, don't use it, even though it works now. if networkAccessManager can be reused by multiple threads, it'll be appreciated. QNetworkAccessManager is meant for be used from 1 thread only. I recommend that you design your software to only use it from 1 thread: When your main thread finishes downloading, emit a signal to send the data to another thread. Anyway, may I ask why you want to use multiple threads?
  • Starting a python project in qt creator, how?

    Unsolved qt designer qt creator 4.2 material design python3
    3
    0 Votes
    3 Posts
    6k Views
    mrjjM
    @Pataruutu Hi the video you link is QML :) So its its the reason it looks differently. The one you call ugly is QWidgets and it uses the default look of the platform. It seems you can use QML with pyt http://pyqt.sourceforge.net/Docs/PyQt5/qml.html
  • What is signficance of mapToScene and mapRect and QMatrix

    Unsolved
    4
    0 Votes
    4 Posts
    912 Views
    m.sueM
    Hi @Qt-Enthusiast Do you mean: Why would I need these transformations? The view may contain just a small sub-area inside the whole area of where all your objects lie (which is the scene). So you need some transformation (mapping) between the small sub-area to the whole area (-> mapToScene). Technically there are (will be) functions that you call with view coordinates and others that you call with scene coordinates. You may even write some yourself. Then the mapping functions come in handy. -Michael.
  • Expected class-name before '{' token error

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    tomyT
    Thank you. The problem belonged to the .pro file. It's solved now.
  • Mouseover vs Mouseclick

    Unsolved
    3
    0 Votes
    3 Posts
    989 Views
    P
    @jsulm No, the whole scenario is within Illustrator. For eg, if I open a swatch and then move the mouse over my panel as seen in the image below. [image: 01f74651-47aa-48b1-b79a-cd5e15dd122f.png] Here, the focus is in the Swatch panel. But, when I move the mouse over the button, it gets the event.
  • 0 Votes
    5 Posts
    1k Views
    J.HilkJ
    @TobyYi for anything that Qt does not have a native api, you can always include other libaries. In your case something like this example should help you. That one is from the archives and for qt 4, so you may want to look for something more uptodate.
  • Receiving signal when pressing on QTableWidget header?

    Solved qtablewidget header signal
    3
    0 Votes
    3 Posts
    3k Views
    K
    @mrjj Thanks for your response. I have to admit that I figured that part already, but it looked a bit out of style for Qt. Therefore, I was not sure, if I simply overlooked a more obvious way. Sometimes one dos not recognize the forest, because of the wood the around ;) Finally the implementation looked less complicated than I thought initially. And it works.
  • How to detect QListWidget events with custom widget loaded

    Unsolved
    3
    0 Votes
    3 Posts
    829 Views
    robbiecooperR
    @VRonin In other words- to detect the mouse from the qlistwidget and access the qlistwidgetitem, and its contents, through that, rather than through the custom widget? I'll check out custom qstyleditemdelegate, thanks!
  • Extract slides from ppt

    Unsolved
    2
    0 Votes
    2 Posts
    604 Views
    VRoninV
    If you can require MS PowerPoint to be installed on the target machine then you can use QAxObject to control MS PP and make it save it for you. Here you can find an example with excel: https://forum.qt.io/topic/80647/how-can-i-read-an-excel-worksheet-from-qt-application/9 but the concept is the same. The syntax inside the calls is the same as the one you'd use in VBA
  • QListWidgetItem activate first item

    Solved
    6
    0 Votes
    6 Posts
    3k Views
    U
    I solved the problem. It was a bug... Thanks for your help and patience!!
  • 0 Votes
    3 Posts
    2k Views
    VRoninV
    In 90% of the cases you can use QStandardItemModel instead of going through the minefield that is subclassing an abstract model. My advice is just to use that "universal model" instead of a custom one. If you really, really want to customise it as performance of QStandardItemModel is a problem then make sure you run your model through the Model Test (needs just a couple of trivial fixes to work on Qt5) that will tell you if you did everything as you were supposed to or you fell in the countless pitfalls of model subclassing
  • QT with XML

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    VRoninV
    @BinuJanardhanan said in QT with XML: create a UI based on parsed XMl if you can convert or adapt your XML format to Qt's one, you can use uic to do this (in fact, .ui files are xml and converting them to code that creats a UI is what uic is for) If you want to stick with your own syntax the uic source code is still probably the best place to start to get inspiration
  • QT Charts dragable

    Unsolved charts qml
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • what is this error mean: :-1: error: [qrc_images.o] Error 1 !

    Solved
    5
    0 Votes
    5 Posts
    3k Views
    MhM93M
    it solved, I reset my Ubuntu. because of virtual memory exhausted: Cannot allocate memory make your ram free and make free space