Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.7k Topics 458.0k Posts
  • How load .obj into QMesh via c++

    Unsolved qt3d qmesh load mesh
    4
    0 Votes
    4 Posts
    2k Views
    A
    Hi from the future! to anyone still facing this problem, basically the QMesh will only load the file and create geometry when it gets placed in a scene in a node and the scene window is shown on the screen, then the QMesh will load the geometry, also the status will have a wrong naming of "Status.ReadCorruptData" which is the same as "Status.Ready", both have the value 2, that status is not even mentioned in the documentation, so it's probably a faulty naming.
  • Asking for help - what is wrong with my QAbstractItemModel and QTreeView?

    Solved
    9
    0 Votes
    9 Posts
    1k Views
    D
    @Christian-Ehrlicher Bug reported.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Modbus RTU Encapsulation (Modbus over TCP)

    Unsolved
    2
    0 Votes
    2 Posts
    384 Views
    J.HilkJ
    it's not quite clear if your Qt application is supposed to be the master or the client. Either way, for Slave use: Qt5: https://doc.qt.io/qt-5/qmodbusrtuserialslave.html#details Qt6: https://doc.qt.io/qt-6/qmodbusrtuserialserver.html for Master: Qt5 https://doc.qt.io/qt-5/qmodbusrtuserialmaster.html Qt6: https://doc.qt.io/qt-6/qmodbusrtuserialclient.html
  • QTableModel memory keep growing

    Unsolved
    11
    0 Votes
    11 Posts
    935 Views
    S
    I am not fully convinced that the memory will grow indefinitely. From my understanding, your current model does not access any real data yet, but just returns the row index on the fly. Which is why you expect the model to not use up any memory. Right? Just test this by only creating the model and not attaching it to a table view. If you add rows, does it still increase memory? My expectation is that it doesn't. Otherwise we should start here and you should provide the code of your test model for us to investigate. Together with the table view, in the beginning adding more items will increase memory usage as it has to create new table items for display. Once the full visible size of the table is used up table items could be reused in an ideal implementation. My understanding is that Qt is actually doing this. Maybe an optimized version has a few extra table items around for performance reasons which are not visible. But, at some point Qt should not allocate memory for the table view anymore. In that respect you are right that there should come a point when the memory should stop growing while adding more rows to your model and thus to your table view.
  • Send email by SMTP

    Unsolved
    19
    0 Votes
    19 Posts
    3k Views
    JonBJ
    @Saee1101 530-5.7.0 Must issue a STARTTLS command first. The server is telling you that you are trying to send a message unencrypted, but it requires encryption and won't just send in plain text. You can see from earlier that one of the commands it accepts is STARTTLS, and you need to issue that from your client. I can't recall the details, you may wait for other responses. But I think after you send the initial EHLO greeting you then send a STARTTLS. And then I think you have to set up to use SSL socket. An example is at https://stackoverflow.com/questions/34215231/send-email-with-starttls, it's for Java but you get the idea. I'm sure you can get a better one by Googling for smtp starttls example, e.g. https://stackoverflow.com/questions/22957189/smtp-send-mail-with-qtcpsocket for Qt. If you looked at/are using https://github.com/bluetiger9/SmtpClient-for-Qt I see that mentions it has support for STARTTLS.
  • QT_FILE_SELECTORS to android to simulate

    Unsolved
    2
    0 Votes
    2 Posts
    262 Views
    J
    @jchaviano I need to test the selector but I don't have an Android device, how can I initialize the selector to android so that qt loads the main.qml that is inside the +android folder
  • CMake for static library using Qt Core

    Solved
    9
    0 Votes
    9 Posts
    3k Views
    C
    Thanks to all who contributed! I really appreciate it.
  • 0 Votes
    17 Posts
    10k Views
    V
    @niquedegraaff, thank you, that's very cool! I have not heard of that project.
  • Centering a CheckBox in a GridLayout

    Solved
    8
    0 Votes
    8 Posts
    1k Views
    A
    @Pl45m4 Thanks, it's sometimes a little bit confusing for me working with the design features of qt-creator. Will set this to solved. Kind regards.
  • layoutStretch is applied in Qt Designer but not in the preview window

    Unsolved
    1
    0 Votes
    1 Posts
    237 Views
    No one has replied
  • QTextEdit HTML font issue

    Unsolved qtextedit html
    5
    0 Votes
    5 Posts
    2k Views
    L
    @Soren-Juul I know this post is old, but ... I had a similar problem changing the font on a QtextCursor in QTextEdit I solved it by using setFontFamilies instead of setFontFamily here a snip of my solution: QTextCursor cursor = ui->textEdit->textCursor(); QTextCharFormat current = cursor.charFormat(); QStringList ffamily; ffamily.append(font); current.setFontFamilies(ffamily); cursor.setCharFormat(current);
  • How to design architecture for qt based windows application?

    Unsolved
    7
    0 Votes
    7 Posts
    829 Views
    Pl45m4P
    @Ronel_qtmaster said in How to design architecture for qt based windows application?: Qt is a crossplatform integrated development Environment To be correct, Qt is not an IDE. Qt is a GUI framework written for C++, if you want to give it a "name". QtCreator is the IDE to work with Qt (of course every other IDE of choice will also work)
  • is it any Qt can compatible for ubuntu 20.04.6

    Solved
    14
    0 Votes
    14 Posts
    2k Views
    L
    @AnneRanch thanks i have solution for my error i install all package Gstreamer in synaptic and include virtualbox guest addtion. it's work and my camera can running as well
  • How yo use openseamap in QML?

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    JKSHJ
    @Ronel_qtmaster said in How yo use openseamap in QML?: i will advice you to use here map or mapbox instead since direct access to osm map has been removed in newer versions of Qt That's not true. OSM is retained in Qt 6, while all other providers (like Mapbox) have been removed: https://www.qt.io/blog/the-road-to-qt-location
  • How to avoid mixing const_iterator and iterator when using QList::erase?

    Solved
    13
    0 Votes
    13 Posts
    3k Views
    kshegunovK
    @Jack-Hill said in How to avoid mixing const_iterator and iterator when using QList::erase?: This works fine but I have clazy complaining about mixing iterators with const_iterators due to QList::iterator QList::erase(QList::const_iterator pos) Then don't. This can be as simple as: for (int i = 0, size = m_numbers.size(); i < size; i++) { auto value = m_numbers[i]; if (value < lowerBound || value > upperBound) continue; beginRemoveRows(parent, i, i); // for whatever `parent` is here, it isn't clear where it comes from m_numbers.removeAt(i--); size--; endRemoveRows(); } If you want to minimize the number of draws the view does on the other hand you'd do two passes - take the bounds of elements to be removed and only then remove them in batches. [Edit: Fixed wrong boolean operation ~kshegunov]
  • Qt6.3.x/6.4.x run Example openglseries under debug mode assert trigged.

    Unsolved
    6
    2 Votes
    6 Posts
    700 Views
    Christian EhrlicherC
    @p_Each said in Qt6.3.x/6.4.x run Example openglseries under debug mode assert trigged.: Any other workaround? Fix it by yourself and create a bug report.
  • QSerialPort

    Unsolved
    13
    0 Votes
    13 Posts
    2k Views
    SGaistS
    @Tomaz hi, It depends on what your device has to do, which services are required, etc. Based on that you can optimize some things to reduce boot time.
  • How to control style of disabled qicons

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    S
    @Ronel_qtmaster, I need to affect the button icon. I.e. I need to have grey color of my icon instead of black for disabled button. But Qt changes it very little and icon still looks like a completely black and indistinguishable from an active button. As of now I went with below code to adjust alpha-channel for each of images inside QIcon. Not very effecive but icons are small so I can afford it. This way I have pretty grey icons for disabled buttons. But if someone knows better way to do it, I would like to know. def add_disabled_state(icon: QIcon) -> QIcon: disabled_icons = [] for size in icon.availableSizes(): icon_image = icon.pixmap(size).toImage() for y in range(icon_image.height()): for x in range(icon_image.width()): pixel_color = icon_image.pixelColor(x, y) pixel_color.setAlpha(pixel_color.alpha() / 5) icon_image.setPixelColor(x, y, pixel_color) disabled_icons.append(QPixmap.fromImage(icon_image)) for disabled_image in disabled_icons: icon.addPixmap(disabled_image, mode=QIcon.Mode.Disabled) return icon
  • QMediaPlayer: How to keep the pitch of audio while changing playback rate (Windows 10)

    Unsolved
    7
    0 Votes
    7 Posts
    2k Views
    JoeCFDJ
    @Shootah This may help if you try to use a customized pipeline. https://gstreamer.freedesktop.org/documentation/soundtouch/pitch.html?gi-language=c and https://stackoverflow.com/questions/75456587/change-pitch-on-playback-with-gstreamer