Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Qt Community Installer Broken (Fresh Win10 Install)

    Solved
    7
    0 Votes
    7 Posts
    466 Views
    enjoysmathE
    @enjoysmath Note, I renamed the long download name of the Qt installer to simply "maintenence.exe"
  • Problems encountered when the project moved from Mingw to MSVC 2017

    Solved
    30
    0 Votes
    30 Posts
    8k Views
    K
    @Jsulm I asked chatGPT for this question. It replied that : "If your Qt Creator can not resolve the Messagequeue < Mymessage > type correctly, try updating to the latest version of Qt Creator or try editing and compiling with another editor.Also, even if your editor can not parse the Messagequeue < Mymessage > type correctly, your code is still valid as long as the compiler compiles the code correctly. You can write, build, and test code without relying on the editor." It means that the warnings/errors QtCreator is shown in editor. can be ignored.But without this problem, as I said before, it would not compile: ... ... cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DWIN64 -DXLSX_NO_LIB -DQT_DEPRECATED_WARNINGS -D__MW_STDINT_H__ -DNDEBUG -DQT_NO_DEBUG -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -I..\AutoTestSystem -I. -I..\AutoTestSystem -I..\AutoTestSystem\Tools -I..\AutoTestSystem\Tools -I..\AutoTestSystem\Log4Qt-master\src -I..\AutoTestSystem\Log4Qt-master\src\log4qt -I..\AutoTestSystem\Log4Qt-master\include -I..\AutoTestSystem\Log4Qt-master\include\log4qt -I..\AutoTestSystem\my_include -I..\AutoTestSystem\Common -I..\AutoTestSystem\Common -I..\AutoTestSystem\Common -ID:\Qt5.14.2\5.14.2\msvc2017_64\include\QtGui\5.14.2 -ID:\Qt5.14.2\5.14.2\msvc2017_64\include\QtGui\5.14.2\QtGui -ID:\Qt5.14.2\5.14.2\msvc2017_64\include -ID:\Qt5.14.2\5.14.2\msvc2017_64\include\QtPrintSupport -ID:\Qt5.14.2\5.14.2\msvc2017_64\include\QtWidgets -ID:\Qt5.14.2\5.14.2\msvc2017_64\include\QtGui -ID:\Qt5.14.2\5.14.2\msvc2017_64\include\QtANGLE -ID:\Qt5.14.2\5.14.2\msvc2017_64\include\QtCore\5.14.2 -ID:\Qt5.14.2\5.14.2\msvc2017_64\include\QtCore\5.14.2\QtCore -ID:\Qt5.14.2\5.14.2\msvc2017_64\include\QtNetwork -ID:\Qt5.14.2\5.14.2\msvc2017_64\include\QtConcurrent -ID:\Qt5.14.2\5.14.2\msvc2017_64\include\QtCore -Irelease -I. -I/include -ID:\Qt5.14.2\5.14.2\msvc2017_64\mkspecs\win32-msvc -Forelease\AcBoardEntity.obj ..\AutoTestSystem\AcBoard\AcBoardEntity.cpp AcBoardEntity.cpp Internal compiler error in "D: Program Files (x86) Microsoft Visual Studio 2022 buildtools VC tools MSVC 14.16.27023 bin Hostx64 x64 cl.exe" Please Select Visual C + + Support Command on the help menu, or open the support help file for details ... ... jom: D:\QtProjects\autotest\1026msvc\autotestsystem\build-AutoTestSystem-Desktop_Qt_5_14_2_MSVC2017_64bit-Release\Makefile.Release [release\AcBoardEntity.obj] Error 2 jom: D:\QtProjects\autotest\1026msvc\autotestsystem\build-AutoTestSystem-Desktop_Qt_5_14_2_MSVC2017_64bit-Release\Makefile [release] Error 2 08:59:32: process“D: Qt5.14.2 tools qtcreator bin Jom.exe” exits, exit code 2. Error while building/deploying project AutoTestSystem (kit: Desktop Qt 5.14.2 MSVC2017 64bit) When executing step "Make" I guess there should be other issue.I recall, in ACBOARDENTITY. The most recent major change in the CPP file was: the error C1060 heap overrun due to the large array defined in the H file,so I replaced the array with a pointer and defined it in the CPP file.I thought maybe my pointer was written wrong, so I changed it back to the original array: //.h double m_sinForK[AC_BOARD_NUM*AC_PROBE_NUM][3840][125]; //.cpp memset(m_sinForK, 0, sizeof(m_sinForK)); And it works!
  • Platform plugin missing/not working

    Solved
    4
    0 Votes
    4 Posts
    747 Views
    R
    @rjmx Sorry, should have mentioned earlier. Using Qt 5.15.2 and msys64/mingw64.
  • Force dialogs to float; like QInputDialog

    Solved
    5
    0 Votes
    5 Posts
    543 Views
    S
    @ChrisW67 Thanks, it appears that having no parent widget treated it as a top-level independent window, but adding the parent widget worked, even without exec(). Thanks!
  • custom widget update() and repaint() will not work

    Unsolved
    3
    0 Votes
    3 Posts
    414 Views
    SGaistS
    @AI_Messiah hi, Might be a silly question but since you don't seem to be anything special with the image, why not use QLabel ?
  • Checking a QRadioButton using an integer parameter

    Unsolved qradiobutton select
    9
    0 Votes
    9 Posts
    2k Views
    Christian EhrlicherC
    Name your buttons in designer radioButton_X with X as your id, use a loop in your code to add them to QButtonGroup later on: QButtonGroup *bg = ... for (int i = 1; i <= maxCount; ++i) { auto button = findChild<QRadioButton*>(QString("radioButton_%1").arg(i)); if (button) { bg->addButton(button, id); } else { qWarning() << "Something went wrong"; } } or directly address them const auto buttons = { ui->radioButton_1, ui->radioButton_2, ... }; int id = 1; for (auto button : buttons) bg->addButton(button, id++);
  • Unable to advertise Bluetooth BLE in peripheral mode in OS Ubuntu 18

    Unsolved
    2
    1 Votes
    2 Posts
    584 Views
    D
    It may be your app does not have the right capabilities. Try: sudo setcap 'cap_net_raw+ep' <path to your app> If that does not work: sudo setcap 'cap_net_admin+ep cap_sys_rawio+ep cap_net_raw+ep' <path to your app>
  • QT6 hoverEnabled not working with an image

    Unsolved
    2
    0 Votes
    2 Posts
    195 Views
    jeremy_kJ
    This works for me with Qt 6.5.3 on macOS. import QtQuick import QtQuick.Window Window { visible: true RotationAnimator { id: rotationAnimator from: 0; to: 360; duration: 1000 loops: Animation.Infinite target: options } Image { id: options source: "https://ddgobkiprc33d.cloudfront.net/bfdb2533-84e9-45a1-956a-106722433d3f.png?v=ifu3inlhqv8" anchors.centerIn: parent MouseArea{ anchors.fill: parent hoverEnabled: true onEntered: rotationAnimator.running = true onExited: rotationAnimator.running = false } } }
  • The dreaded 0xc000007b error

    Solved
    4
    0 Votes
    4 Posts
    407 Views
    R
    @rjmx Found the missing DLL. Problem solved.
  • compiling to 64 bits ok How do I configure 32 bits static?

    Unsolved
    5
    0 Votes
    5 Posts
    440 Views
    J
    @SimonSchroeder How do I do that for what?
  • Grid layout widget and splitter-like resizing

    Unsolved grid gridlayout splitter
    9
    0 Votes
    9 Posts
    4k Views
    A
    @KenAppleby-0 I have an extremely stupid proof of concept that sort of does what I describe in the initial message, it's extremely rough and should not be considered a good idea by anybody, but here goes: from PyQt6.QtWidgets import QWidget, QPushButton, QGridLayout, QSizePolicy, QApplication from PyQt6.QtGui import QColor, QPalette from PyQt6.QtCore import Qt class BorderWidget(QWidget): def __init__(self, widget_id, side, layout=None, row=None, column=None): super(BorderWidget, self).__init__() self.widget_id = widget_id self.side = side self.layout = layout self.row = row self.column = column pal = self.palette() pal.setColor(QPalette.ColorRole.Window, QColor('white')) self.setAutoFillBackground(True) self.setPalette(pal) self.pressed = False def mousePressEvent(self, event): super(BorderWidget, self).mousePressEvent(event) print(f"Clicked on {self.side} border of widget {self.widget_id}") print(f"self.press is {self.pressed}") self.pressed = True self.last_x = event.globalPosition().x() self.last_y = event.globalPosition().y() def mouseReleaseEvent(self, event): self.pressed = False def mouseMoveEvent(self, event): if self.pressed and self.layout is not None: dx = event.globalPosition().x() - self.last_x self.last_x = event.globalPosition().x() dy = event.globalPosition().y() - self.last_y self.last_y = event.globalPosition().y() if dx != 0: if self.side in ['right', 'left']: new_stretch = max(1, self.layout.columnStretch(self.column) - dx) self.layout.setColumnStretch(self.column, int(new_stretch)) elif self.side in ['bottom', 'top']: new_stretch = max(1, self.layout.rowStretch(self.row) - dy) self.layout.setRowStretch(self.row, int(new_stretch)) class DraggableWrapper(QWidget): def __init__(self, widget, widget_id, main_layout, row, column): super(DraggableWrapper, self).__init__() self.layout = QGridLayout(self) self.layout.setSpacing(0) self.layout.setContentsMargins(0, 0, 0, 0) self.border_top = BorderWidget(widget_id, 'top', main_layout, row, column) self.border_bottom = BorderWidget(widget_id, 'bottom', main_layout, row + 1, column) self.border_left = BorderWidget(widget_id, 'left', main_layout, row, column) self.border_right = BorderWidget(widget_id, 'right', main_layout, row, column + 1) self.border_top_left_horizontal = BorderWidget(widget_id, 'topleft', main_layout, column) self.border_top_right_horizontal = BorderWidget(widget_id, 'topright', main_layout, column) self.border_bottom_left_horizontal = BorderWidget(widget_id, 'bottomleft', main_layout, column) self.border_bottom_right_horizontal = BorderWidget(widget_id, 'bottomright', main_layout, column) self.layout.addWidget(widget, 1, 1) self.layout.addWidget(self.border_top, 0, 1) self.layout.addWidget(self.border_bottom, 2, 1) self.layout.addWidget(self.border_left, 0, 0, 3, 1) # cover the corners self.layout.addWidget(self.border_right, 0, 2, 3, 1) # cover the corners self.layout.addWidget(self.border_top_left_horizontal, 0, 0) self.layout.addWidget(self.border_top_right_horizontal, 0, 2) self.layout.addWidget(self.border_bottom_left_horizontal, 2, 0) self.layout.addWidget(self.border_bottom_right_horizontal, 2, 2) border_width = 10 self.border_top.setFixedHeight(border_width) self.border_bottom.setFixedHeight(border_width) self.border_left.setFixedWidth(border_width) self.border_right.setFixedWidth(border_width) # apply size restrictions to corner border widgets to form L-shaped corners self.border_top_left_horizontal.setFixedSize(border_width, border_width) self.border_top_right_horizontal.setFixedSize(border_width, border_width) self.border_bottom_left_horizontal.setFixedSize(border_width, border_width) self.border_bottom_right_horizontal.setFixedSize(border_width, border_width) # Apply size policies self.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding) widget.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding) class MainWindow(QWidget): def __init__(self): super().__init__() layout = QGridLayout(self) layout.setSpacing(0) default_stretch = 300 layout.setRowStretch(0, default_stretch) layout.setRowStretch(1, default_stretch) layout.setColumnStretch(0, default_stretch) layout.setColumnStretch(1, default_stretch) widget1 = QPushButton("Button 1") wrapper1 = DraggableWrapper(widget1, '1', layout, 0, 0) widget2 = QPushButton("Button 2") wrapper2 = DraggableWrapper(widget2, '2', layout, 0, 1) widget3 = QPushButton("Button 3") wrapper3 = DraggableWrapper(widget3, '3', layout, 1, 0) widget4 = QPushButton("Button 4") wrapper4 = DraggableWrapper(widget4, '4', layout, 1, 1) layout.setContentsMargins(0, 0, 0, 0) layout.addWidget(wrapper1, 0, 0) layout.addWidget(wrapper2, 0, 1) layout.addWidget(wrapper3, 1, 0) layout.addWidget(wrapper4, 1, 1) if __name__ == '__main__': app = QApplication([]) mainWin = MainWindow() mainWin.setMinimumSize(800, 800) mainWin.show() app.exec()
  • Qt Installer Crash

    Unsolved
    3
    0 Votes
    3 Posts
    363 Views
    T
    Hi! Any updates? I have the same problem.
  • I want implement SCRAM ( RFC5802 ) in QT5, is there some useful library?

    2
    0 Votes
    2 Posts
    652 Views
    NeustradamusN
    @redbit Now QCA has changed since your original topic. https://invent.kde.org/libraries/qca https://github.com/KDE/qca But there is always a problem -PLUS variants do not work. I always need help of contributors to add the support of -PLUS variants. There is a ticket here: https://bugreports.qt.io/browse/QTBUG-77783 A not-complete list of supported softwares: https://github.com/scram-sasl/info/issues/1 Linked to: https://tools.ietf.org/html/rfc5929 https://tools.ietf.org/html/rfc9266 https://tools.ietf.org/html/rfc9266 https://xmpp.org/extensions/xep-0388.html https://xmpp.org/extensions/xep-0440.html https://xmpp.org/extensions/xep-0474.html https://www.iana.org/assignments/channel-binding-types/channel-binding-types.xhtml Jabber.ru MITM: https://notes.valdikss.org.ru/jabber.ru-mitm/ https://snikket.org/blog/on-the-jabber-ru-mitm/ https://www.devever.net/~hl/xmpp-incident https://blog.jmp.chat/b/certwatch
  • How can I change the QTreeView branch indicator width in the stylesheet?

    Moved Unsolved
    5
    0 Votes
    5 Posts
    443 Views
    SGaistS
    @Bob64 Topic moved
  • Problems creating mysql plugin in Qt6.6 on linux

    Solved
    5
    0 Votes
    5 Posts
    723 Views
    Christian EhrlicherC
    Nice to hear, please mark the topic as solved then.
  • Configurable QSlider/QDial that uses double values

    Unsolved
    3
    0 Votes
    3 Posts
    456 Views
    S
    @KenAppleby-0 said in Configurable QSlider/QDial that uses double values: It really isn't. Perhaps you could define and refine what you would call "intuitive" and then you would see why. To implement, that is, but I will try your suggestion to create a customizable class... thank you.
  • Widget' object has no attribute 'pushButton'

    Solved
    2
    0 Votes
    2 Posts
    1k Views
    C
    @xavi-hachem Please place code in a code block otherwise we will be guessing the indenting and having to piece together code that is mangled. This is the </> icon on the editor tool bar or type three backticks before and after the block. Anyway, you need to put loaded UI into a persistent member variable: import os from pathlib import Path import sys from PySide2 import QtCore, QtGui, QtWidgets from PySide2.QtWidgets import QApplication, QWidget, QPushButton from PySide2.QtCore import QFile from PySide2.QtUiTools import QUiLoader class Widget(QWidget): def __init__(self): super(Widget, self).__init__() self.load_ui() self.ui.pushButton.clicked.connect(self.hello_world) # ^^^^^ use the UI through the member variable def load_ui(self): loader = QUiLoader() path = os.fspath(Path(__file__).resolve().parent / "Application.ui") ui_file = QFile(path) ui_file.open(QFile.ReadOnly) self.ui = loader.load(ui_file, self) # ^^^^^ put the loaded UI into a member variable ui_file.close() def hello_world(self): print("Hello world") if __name__ == "__main__": QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_ShareOpenGLContexts) app = QApplication([]) widget = Widget() widget.show() sys.exit(app.exec_()) Alternatively use pyside2-uic/ pyside6-uic and get a range of advantages. BTW: Are you really mixing PySide2 and PyQt5?
  • This topic is deleted!

    Solved
    7
    0 Votes
    7 Posts
    8 Views
  • QSplashScreen after startup?

    Unsolved
    8
    0 Votes
    8 Posts
    737 Views
    richferraraR
    @Pl45m4 Never mind ... I found a memory error in my code. I think that was the problem.
  • Qt6 yocto build - filesystem no such file

    Unsolved
    1
    0 Votes
    1 Posts
    236 Views
    No one has replied