跳到內容

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k 主題 456.4k 貼文
  • 此主題已被刪除!

    Unsolved
    1
    0 評價
    1 貼文
    2 瀏覽
    尚無回覆
  • Modbus RTU Encapsulation (Modbus over TCP)

    Unsolved
    2
    0 評價
    2 貼文
    298 瀏覽
    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 評價
    11 貼文
    813 瀏覽
    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 評價
    19 貼文
    2k 瀏覽
    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 評價
    2 貼文
    210 瀏覽
    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 評價
    9 貼文
    2k 瀏覽
    C
    Thanks to all who contributed! I really appreciate it.
  • 0 評價
    17 貼文
    10k 瀏覽
    V
    @niquedegraaff, thank you, that's very cool! I have not heard of that project.
  • Centering a CheckBox in a GridLayout

    Solved
    8
    0 評價
    8 貼文
    884 瀏覽
    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 評價
    1 貼文
    185 瀏覽
    尚無回覆
  • QTextEdit HTML font issue

    Unsolved qtextedit html
    5
    0 評價
    5 貼文
    2k 瀏覽
    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 評價
    7 貼文
    689 瀏覽
    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 評價
    14 貼文
    2k 瀏覽
    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 評價
    4 貼文
    941 瀏覽
    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 評價
    13 貼文
    3k 瀏覽
    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 評價
    6 貼文
    599 瀏覽
    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 評價
    13 貼文
    2k 瀏覽
    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 評價
    7 貼文
    1k 瀏覽
    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 評價
    7 貼文
    1k 瀏覽
    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
  • Is Apple's SwiftUI just a copy of QML?

    Unsolved
    5
    0 評價
    5 貼文
    816 瀏覽
    W
    @Pl45m4 It's often said that Apple doesn't invent anything, but they just improve upon what others have done.
  • Problem building Qt for Raspberry Pi OS

    Unsolved
    7
    0 評價
    7 貼文
    1k 瀏覽
    Ronel_qtmasterR
    @jlouts check this.It is not on Ubuntu but it can hugely help you https://drive.google.com/file/d/1-Dd228_crhvV1VJnNjqLCAl3O6_cWeJ4/view?usp=drive_link