Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.1k Posts
  • QSerialPort::SerialPortError::TimeoutError ? what can I do ?

    Unsolved
    6
    0 Votes
    6 Posts
    423 Views
    K
    I assume, you are use the Linux... https://github.com/qt/qtserialport/blob/dev/src/serialport/qserialport_unix.cpp#L986 look on: if (ret == 0) { setError(QSerialPortErrorInfo(QSerialPort::TimeoutError)); return false; } prevouosly, the qt_safe_poll has been implemented something like that (e.g. up to Qt6, e.g. in Qt 5.15): https://github.com/qt/qtbase/blob/5.15/src/corelib/kernel/qcore_unix.cpp#L150 int qt_safe_poll(struct pollfd *fds, nfds_t nfds, const struct timespec *timeout_ts) { if (!timeout_ts) { // no timeout -> block forever int ret; EINTR_LOOP(ret, qt_ppoll(fds, nfds, nullptr)); return ret; } timespec start = qt_gettime(); timespec timeout = *timeout_ts; // loop and recalculate the timeout as needed forever { const int ret = qt_ppoll(fds, nfds, &timeout); if (ret != -1 || errno != EINTR) return ret; // recalculate the timeout if (!time_update(&timeout, start, *timeout_ts)) { // timeout during update // or clock reset, fake timeout error return 0; } } } look on: // timeout during update // or clock reset, fake timeout error return 0; so, the ret-code with 0-value was interpreted as a some TimeoutError (only when you ar euse the waitFor metrods, on Linux). But right now, in Qt6, the implementation of qt_safe_poll seems a bit different: https://github.com/qt/qtbase/blob/6.8/src/corelib/kernel/qcore_unix.cpp#L121 look on: int qt_safe_poll(struct pollfd *fds, nfds_t nfds, QDeadlineTimer deadline) { if (deadline.isForever()) { // no timeout -> block forever int ret; QT_EINTR_LOOP(ret, qt_ppoll(fds, nfds, nullptr)); return ret; } using namespace std::chrono; nanoseconds remaining = deadline.remainingTimeAsDuration(); // loop and recalculate the timeout as needed do { timespec ts = durationToTimespec(remaining); const int ret = qt_ppoll(fds, nfds, &ts); if (ret != -1 || errno != EINTR) return ret; remaining = deadline.remainingTimeAsDuration(); } while (remaining > 0ns); return 0; } so, maybe a cause in that.. maybe in something else. Just don't use the waifForXXX methods... it is a crutch. AFAIK, right not there are no any maintainer for a serialport module... I assume, that the serialport module should be refactored because it's implementation is too old.
  • Debug: Performance issue with QJsonDocument destructor

    Unsolved
    4
    0 Votes
    4 Posts
    272 Views
    JonBJ
    @BaroneAshura Then that is indeed a big difference. I will bow out because I do not know about the details/features of the MSVC debugger, or how Creator communicates with that rather than gdb. I will say that when I used to develop for Windows with MSVC (no Qt) I found no particular slowness issues when debugging. I don't know how easy this is from where you are now, but can you run the debugging session from Visual Studio instead of from Qt Creator to compare?
  • QtQuick.Studio.DesignEffects module in Vscode

    Unsolved
    2
    0 Votes
    2 Posts
    330 Views
    J
    Windows 11
  • Strange header like boxes in front of every table row

    Solved
    4
    0 Votes
    4 Posts
    246 Views
    sebastianzanderS
    @artwaw said in Strange header like boxes in front of every table row: @sebastianzander those are row headers. Empty and visible, since - like you said - not configured. Please try something along this line: ui->tableView->verticalHeader->setVisible(false); Alternatively if you dive into the design view you'll see in the inspector property "Vertical header visible" checked. Thank you very much, Artur. You were right, the thing is that in our company we use a special class that inherits from QTableView and this class uses the vertical header to configure screen and DPI dependent row heights. I guess without those settings it would not even display those "strange boxes". Many windows in our software explicitly set verticalHeader->setVisible(false) or verticalHeader->hide() in their constructors, so it seemed odd to me that other tables do not have these vertical header boxes. I will suggest a change to our special QTableView descendant so that it calls verticalHeader->hide() in its constructor. @Pl45m4, thank you, too. I should have written that I use a descendant of QTableView, because so I (our company to be exact) indeed configure QTableView and QHeaderView specifically in this regard. Once again, many thanks to both of you for your quick replies and help. Kind regards, Sebastian
  • About addText () in QPainterPath

    Locked Unsolved
    2
    0 Votes
    2 Posts
    209 Views
    jsulmJ
    @cszr Please stop double posting! https://forum.qt.io/topic/157896/about-addtext-in-qpainterpath Closing this one...
  • Creating a UDP Communication Project

    Unsolved
    2
    0 Votes
    2 Posts
    133 Views
    Christian EhrlicherC
    Look into ui_Sender.h and you will see that you named your dialog different - fix it.
  • This topic is deleted!

    Solved
    3
    0 Votes
    3 Posts
    25 Views
  • Forcing PyQt6 to update part of a window that is not on screen

    Unsolved
    1
    0 Votes
    1 Posts
    296 Views
    No one has replied
  • Expanding multiple ListViews within QScrollArea.

    Solved
    9
    0 Votes
    9 Posts
    487 Views
    M
    @SGaist said in Expanding multiple ListViews within QScrollArea.: Here you have a variant in python that works quite well: Thank you for this. I'll dig into what you're doing with sizeHints, and see if I can adapt it to my working code above. Would be nice to not be dependent on all list items being the same size.
  • Qt6 - cmake

    Unsolved
    14
    0 Votes
    14 Posts
    6k Views
    SGaistS
    @Tom-asso You can also use the qt-cmake wrapper from the bin folder of your Qt installation.
  • How can I build Qt 6.5.1 / Android with openssl-1.1?

    Unsolved
    6
    0 Votes
    6 Posts
    896 Views
    JoeCFDJ
    @FrogCruiser From Qt6.5 https://www.qt.io/blog/moving-to-openssl-3-in-binary-builds-starting-from-qt-6.5-beta-2
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • [QTcpSocket - Qt-6.2.7] Write to socket big raw data

    Solved
    17
    0 Votes
    17 Posts
    1k Views
    Christian EhrlicherC
    @JonB It will for sure not. The data is somewhere between the users application and the other end. Maybe even buffered in a switch / router / whatsoever.
  • QHttpServer - middleware /route pre-process?

    Unsolved
    7
    0 Votes
    7 Posts
    497 Views
    artwawA
    @SGaist perhaps. My imagined wrapper simply holds the QNAM inside exposing request() and finished() slots/signals (in general), doing all the examinations inside and then sending requests. So, a gateway to replacing QNAM altogether in a sense.
  • Unable to compile, ui header never found. (Qt6, Clion, Windows)

    Unsolved
    12
    0 Votes
    12 Posts
    2k Views
    MoonFeatherM
    Also, for different file path of .ui file, both change CMakeLists.txt: set(PROJECT_SOURCES main.cpp mainwindow.cpp mainwindow.h Form/mainwindow.ui ) and the mainwindow.cpp's include path: #include "./Form/ui_mainwindow.h"
  • QWidget Drag And Drop inside Layout. Is this a good way?

    Unsolved qt c++ drag and drop layout qwidget
    5
    0 Votes
    5 Posts
    876 Views
    Pl45m4P
    @Axel-Spoerl said in QWidget Drag And Drop inside Layout. Is this a good way?: I have troubles to imagine what you mean by that. Colors aside, a widget is typically a rectangle. If I want to indicate a potential landing spot, I'd rather use a rectangle, than a line. I think @StudentScripter means the same behavior you see when adding widgets to a layout in QtDesigner. A "line" can be a thin rectangle :) You also see a rectangle when dragging QDockWidgets around showing the valid DockAreas. Maybe check the source code of QtCreator's Designer or QMainWindows dockarea.
  • 0 Votes
    8 Posts
    450 Views
    Pl45m4P
    @Zbigniew-Sch said in Program does not work properly using QFileSystemModel and QTreeView (Qt 6.7.2) under Windows 11: Are you from the Qt development team? This is a user forum... most people here are users like you with more or less experience. Debug your app to see why and where it crashes. If you think it's a bug related to QFileSystemModel and Win11, create a bugreport here
  • How to get minimum size Mainframe?

    Solved qwidget
    8
    0 Votes
    8 Posts
    989 Views
    Pl45m4P
    @SiGa As @SimonSchroeder said above, if you were using layouts properly, there's almost no way that things overlap, when resizing the main widget. Only free floating widgets, which are not part of any layout might do.
  • QBoxLayout misplacing

    Unsolved
    8
    0 Votes
    8 Posts
    491 Views
    G
    up .
  • Adding notes to QCalendarWidget

    Unsolved
    3
    0 Votes
    3 Posts
    254 Views
    jsulmJ
    @symHeisenberg You could show a widget when https://doc.qt.io/qt-6/qcalendarwidget.html#clicked is emitted where you show the notes for the date which was clicked.