Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • Widgets not visible in QGridLayout

    Solved
    8
    0 Votes
    8 Posts
    4k Views
    osirisgothraO
    fwiw, late though it may be, i found an odd behavior with some custom widgets requiring you to explicitly set the row/colspan when adding the item (eg, insertWidget(item,row,col,1,1)) -- this does not seem to happen with custom widgets that are a collection of custom controls, just ones that do their own custom painting in paintEvent.
  • Illegal attempt to connectthe class that is in a different thread that the QML engine

    Unsolved
    7
    0 Votes
    7 Posts
    830 Views
    Pl45m4P
    @J-Hilk This masterpiece deserves an extra medal 🤣
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    8 Views
    No one has replied
  • 0 Votes
    7 Posts
    675 Views
    A
    @JonB actually it sounds like a good idea, thanks
  • Qt Button

    Unsolved
    15
    0 Votes
    15 Posts
    2k Views
    jsulmJ
    @Rkutun Take a look at https://ftp.gnu.org/old-gnu/Manuals/gprof-2.9.1/html_mono/gprof.html
  • How to change cornerWidget style in QTabWidget?

    Solved
    14
    0 Votes
    14 Posts
    3k Views
    A
    you added setContentsMargins(1, 0, 1, 0) on QHBoxLayout . so toolbutton expanded in full size. thanks for this answer it worked for me.
  • 0 Votes
    7 Posts
    1k Views
    K
    @Christian-Ehrlicher Here is a quickly written piece of code to reproduce the issue. It is just a single main.cpp file. I have to use pastebin since my message is being flagged as spam (I have no idea why!) https://pastebin.com/DLVbDLzj It depends on which mode the system starts with. I have the issue when the system starts with dark mode.
  • qtabwidget stylsheet with tabbar cornerwidget

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    A
    i facing same issue. cornerwidget is overlapping/misaligned if resized widget using set size method.
  • How can I run my simple project from Qt Design Studio in Qt Creator?

    Unsolved
    1
    0 Votes
    1 Posts
    89 Views
    No one has replied
  • QSplitter: Disable "magnetic" behavior of the handles

    Unsolved
    2
    0 Votes
    2 Posts
    197 Views
    S
    Found the solution myself. Just added p->setMinimumSize(2, 2); for each QListWidget - p->setMinimumSize(0, 0); wont work as this resets the minimum Width - i was not aware of this. [image: 1c7b4f72-88b2-4601-9091-e0e45015d7f0.png]
  • Migrating from MFC to Qt: Modal window in MFC

    Unsolved
    6
    0 Votes
    6 Posts
    704 Views
    JKSHJ
    @jsulm said in Migrating from MFC to Qt: Modal window in MFC: @JKSH OK, didn't know Qt would use the event loop from MFC automatically. I didn't know either, until I tried to port QtWinMigrate to Qt 6. Volker (our Chief Maintainer) said: Based on what I'm seeing in Qt 6's (and Qt 5's) Win32 event dispatcher, QtWinMigrate isn't needed at all, at least not for hooking a Qt UI into a Win32 event loop. The code touched by https://codereview.qt-project.org/c/qt/qtbase/+/387409 is designed to make delivery of posted QEvents work even if Qt is not running the event loop.
  • JS notation to Qt

    Solved
    4
    0 Votes
    4 Posts
    395 Views
    JonBJ
    @Damian7546 Yes, that principle looks good. I said the JS looked sufficiently close to JSON that you could have made a few edits in an editor (e.g. change single quotes to double quotes for strings, remove trailing commas from last elements in lists, etc.) so that you could have used Qt's JSON calls to directly read that into an auto-created JSON structure. And that is the "simplest". But if you want an actual C++ struct/class, with specific typed members, for each compound entry in the source then you do indeed need to do what you show: declare a corresponding C++ structure and alter the original a little more so that you can assign to it directly in source code. But would not allow assignment from data in external file, without writing separate code for that, which the JSON would. A couple of elements in the JS you have require an additional example member variable, which can presumably be empty in items which do not specify it.
  • QT 6.8.1 QPA plugin version mismatch

    Solved
    5
    0 Votes
    5 Posts
    771 Views
    jsulmJ
    @Rukshan-Perera said in QT 6.8.1 QPA plugin version mismatch: When I tried to build qt6.8.1 locally How did you install it?
  • 0 Votes
    5 Posts
    368 Views
    J
    @Gaobo said in Re-implemented QComboBox and QLineEdit, the dropdown flash with a left-click using the touchpad: Does ‘left mouse button’ mean pressing the left button of the touchpad or just touching it once with a single finger? Just touch it once with a single finger. @Gaobo said in Re-implemented QComboBox and QLineEdit, the dropdown flash with a left-click using the touchpad: Is that question also appear on qt original QComboBox? The question does not appear on qt original QComboBox. CustomComboBox initialize like: auto items = _treeModel->GetItemList(); for (int i = 0; i < items.size(); ++i) { auto name = items[i][0]->text(); auto shape = items[i][1]->text(); ui.comboInput->addItem(name, shape); } The full code is in my question, so you can try it out if it's convenient for you
  • Issue with "QSslSocket" when Sending an Email

    Unsolved
    4
    0 Votes
    4 Posts
    296 Views
    C
    @Mourad2024 said in Issue with "QSslSocket" when Sending an Email: Despite this, I’m unable to successfully send the email, and no further progress is made after the MAIL FROM command. What further progress have you tried? 250 Ok indicates the envelope sender was accepted but you appear to have not sent anything more. You should be sending one or more RCPT TO:<alice@example.com> lines, a DATA line, the email headers, blank line, message body, and a line containing only a period to complete the transfer. See SMTP transport example. BTW; What does any of this have to do with the thread title?
  • How to load a DICOM data with DCMTK

    Unsolved
    3
    0 Votes
    3 Posts
    408 Views
    SGaistS
    Hi, First thing, I would simplify the code to handle one known case, for example an RGB image and just show it on a QLabel. That said, from memory, DICOM images are pretty tricky and a library such as VTK is often used to handle them with Qt as front end.
  • How to wait for Qtcpsocket data without freezing the GUI?

    9
    0 Votes
    9 Posts
    5k Views
    F
    This is an old topic, but you can use canReadLine() to check if a complete line has arrived. If not, just don`t read the buffer and wait for the next readyRead(). When a complete line arrive, use readLine(), so the tcp socket will let the contents after the \n to the next read and so on.
  • Qt 6 qml module and qml import path

    Unsolved
    4
    2 Votes
    4 Posts
    4k Views
    EndrII 0E
    @pjorourke What about qmlls (qml language server) - this language server continues to sent me warnings about not founded modules, but these modules are exists and qt creator found them.
  • The application was unable to start correctly 0xc0000279

    Unsolved
    2
    0 Votes
    2 Posts
    419 Views
    hskoglundH
    Just a wild guess, but if you have antivirus, try disabling it (unless it's Microsoft Defender).
  • 0 Votes
    2 Posts
    155 Views
    C
    @Sauntor said in How to make a library with the installed layout looks like Qt's internal modules (a.k. QtCore, QtQml, ect.)?: All in a word, how to make the library users use Demo like the way they use QtCore, for example: You cannot control how the users use the headers provided but you can give then the option of "clean" header names like <QWidget> the same way that Qt does it. The deployed headers files are: - include - QtWidgets (directory) - QtWidgets (file) - QWidget (file) - qwidget.h (file) The file "QWidget" simply contains: #include "qwidget.h" The file QtWidgets similarly includes all the headers for the entire module. The qmake or cmake setup ensures that the include/QtWidget folder is added to the include path when the widget module is invoked (e.g. QT += widgets). The include folder is also present. So, the user can specify: // found via the top level include path #include <QtWidgets/QWidget> #include <QtWidgets/qwidget.h> // found via the QtWidgets include path #include <QtWidgets> #include <QWidget> #include <qwidget.h> To do this for your library you need to deploy at least the "clean" files. I do not want to write any camel cased header wrappers manually, it should be auto generated, and how? You only need to do this once and check it in to your source control. It's probably faster than trying to automate. As for how you could automate this; there's no magic bullet here.