Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • create

    Solved
    4
    0 Votes
    4 Posts
    409 Views
    C
    Hi, Could you, please, use the below as a title: How to create multiple parallel hierarchical pages under a QStackedWidget in Qt Designer? Take into consideration that other people in the future would like to also get the same help, and the current title does not help make finding this thread easy. Thank you.
  • Compilation times with Qt6

    Solved
    17
    0 Votes
    17 Posts
    3k Views
    Christian EhrlicherC
    @Asperamanca said in Compilation times with Qt6: Hoping for C++ Modules in Qt before I retire... I would not bet on this - from my pov there is way to much work to be done before such a big framework as Qt can use them properly.
  • Qprocess:readAllStandardError is reading output of succesul gpg command

    Unsolved
    3
    0 Votes
    3 Posts
    315 Views
    JonBJ
    @Devesh-Mishra You should not use emptiness or not of stderr to judge whether a program ran "successfully". Use int QProcess::exitCode() const after waitForFinished() to access exit/return code of program. However, you show a batch file which executes various sub-commands. As written I doubt you will get an non-zero exit code from this if one iteration returns that. You may have to rewrite you batch file to achieve that, and IIRC you need to use exit /b exit-code from a .bat file to get it to return a non-0 value to the caller.
  • How to set BG color for Tree item.

    Solved
    3
    0 Votes
    3 Posts
    224 Views
    S
    @jsulm Thank you very much , This is what i needed.
  • 0 Votes
    2 Posts
    182 Views
    jsulmJ
    @JohnyB said in Why increase memory usage of running QApp, after executting Java JAR file in QProcess even if process done?: I suppose that java garbage collector no clean Has nothing to do with your app as you're running Java apps in other processes. At what level does memory consumption stay after running these QProcesses? It is normal that freed memory often stays assigned to the application. You can also use memory profiling tools like Valgrind.
  • how to GUI show data in fraction of seconds for large data sets

    Unsolved
    23
    0 Votes
    23 Posts
    6k Views
    jeremy_kJ
    @Qt-Enthusiast said in how to GUI show data in fraction of seconds for large data sets: https://codeshare.io/ZJYk4o I have put the formatted code in the link . PLease review Tip 1: Use the forum code button instead of an external website: [image: 3cd546f4-e93a-4237-8890-534ddf29d9f0.png] or format manually: ``` code goes here ``` Tip 2: For python3, avoid super(Class, object) when super() will work. Can you spot the error? This is valid code, but probably not what is intended. class Base: def __init__(self, *args, **kwargs): print("Base.__init__") class Mid(Base): def __init__(self, *args, **kwargs): super(Mid, self).__init__(*args, **kwargs) print("Mid.__init__") class Derived(Mid): def __init__(self, *args, **kwargs): super(Mid, self).__init__(*args, **kwargs) print("Derived.__init__") obj = Derived() As for the general strategy, displaying or hiding visible items based on what is visible is the job of the view. Unless the overhead of non-viewable items in the scene is significant, don't remove them from the scene. One of the points of the chips demo is to alter the details of the visible items as appropriate, rather than removing or adding them.
  • How can I restrict the display area of a widget, apart from setting its parent?

    Unsolved
    7
    0 Votes
    7 Posts
    481 Views
    Q
    @jsulm yes,My widget can be an image, and I am moving the image from the right side to the left side within the specified area. This is a common animation.
  • Issue with QTabWidget - QtDesigner

    Unsolved qtdesign qtdesigner stylesheet qtabwidget
    2
    0 Votes
    2 Posts
    599 Views
    C
    Hi, Please provide the following information: Qt kit you are using. Qt Creator version. OS, and if Linux, what desktop environment? I tested that stylesheet on Fedora KDE spin, using Qt 5.15.2/6.2.4/6.6.1, Qt Creator 12, and this MRE: int main(int argc, char *argv[]) { QApplication a(argc, argv); QTabWidget t; t.setStyleSheet(R"(QTabWidget::pane { border: 3px solid rgb(68, 76, 94); } /*======TAB*========*/ QTabBar::tab { /*color: rgb(68, 76, 94);*/ border: 2px solid rgb(68, 76, 94); } QTabWidget::tab-bar:top { top: 3px; } QTabWidget::tab-bar:bottom { bottom: 2px; } QTabWidget::tab-bar:left { right: 2px; } QTabWidget::tab-bar:right { left: 2px; } QTabBar::tab:left:last, QTabBar::tab:right:last, QTabBar::tab:left:only-one, QTabBar::tab:right:only-one { margin-bottom: 0px; } QTabBar::tab:first { border-top-left-radius: 10px; border-top-right-radius: 10px; } QTabBar::tab:last { border-top-left-radius: 10px; border-top-right-radius: 10px; } QTabBar::tab:middle { border-top-left-radius: 10px; border-top-right-radius: 10px; } QTabBar::tab:top, QTabBar::tab:bottom { min-width: 8ex; margin-right: -1px; padding: 5px 10px 5px 10px; } QTabBar::tab:top:last, QTabBar::tab:bottom:last, QTabBar::tab:top:only-one, QTabBar::tab:bottom:only-one { margin-right: 0; } QTabBar::tab:left, QTabBar::tab:right { min-height: 8ex; margin-bottom: -1px; padding: 10px 5px 10px 5px; } /*TAB:SELECTED*/ QTabBar::tab:selected { background: white; color: rgb(68, 76, 94); border-color: rgb(68, 76, 94); border-bottom-color: transparent; margin-top: 0; } QTabBar::tab:top:selected { border-bottom-color: none; } QTabBar::tab:bottom:selected { border-top-color: none; } QTabBar::tab:left:selected { border-left-color: none; } QTabBar::tab:right:selected { border-right-color: none; } /*TAB !SELECTED*/ QTabBar::tab:!selected { color: white; background-color: rgb(68, 76, 94); border-color: rgb(68, 76, 94); border-width: 3px; } QTabBar::tab:top:!selected { margin-top: 4px; } QTabBar::tab:bottom:!selected { margin-bottom: 3px; } QTabBar::tab:left:!selected { margin-right: 3px; } QTabBar::tab:right:!selected { margin-left: 3px; })"); t.addTab(new QWidget, "Variable fisicas"); t.addTab(new QWidget, "Variable fisiologicas"); t.addTab(new QWidget, "Unidad de Control de Agua"); t.show(); return a.exec(); } and I get this: [image: 61409c28-5d4c-4550-96f0-8aee04ef5f27.gif] Which looks normal. I also tried it on in Qt Designer, just slapped a QTabWidget on a QMainWindow and applied the stylesheet on it, and got this: [image: 715530db-bd48-40b5-82c8-e54b32875f4d.gif] I also tried to apply the stylesheet on the main window, and the QApplication just to be sure, but same result.
  • 1 Votes
    5 Posts
    940 Views
    D
    I will try these suggestions. Thank you very much!
  • Issues resizing stylesheet indicators

    Unsolved
    4
    0 Votes
    4 Posts
    353 Views
    SGaistS
    Hi, You can create a proxy style and customize there the rendering of the QRadioButton.
  • Installing Qt on Ubuntu...

    Unsolved
    8
    0 Votes
    8 Posts
    12k Views
    SGaistS
    @jsulm said in Installing Qt on Ubuntu...: @SPlatten said in Installing Qt on Ubuntu...: qt5-default Maybe there is no such package in Ubuntu 22.04? Simply search for qt5 packages. @jsulm is correct. If you take this answer on the stack overflow thread, you'll see the change and why. To get started install qtbase5-dev and all the dev packages of the modules you are going to use for developing your application.
  • Library not registered error!

    Solved
    12
    0 Votes
    12 Posts
    3k Views
    H
    @Hachenze I solved this problem. There was a problem with memory alocation. Very stupid me.
  • Save QTreeView/QStandardItemModel with DataStream to file?

    Unsolved
    40
    0 Votes
    40 Posts
    8k Views
    M
    @StudentScripter As I said earlier, you can serialize an array or a map of json/xml text, no need for a zip file. For the performance of json, have a test yourself, create a json with a thousand of parameters and look how it works.
  • QTableWidget - showing headers

    Unsolved
    1
    0 Votes
    1 Posts
    132 Views
    No one has replied
  • QDoubleSpinBox->setValue() truncates floats/doubles

    Unsolved
    8
    0 Votes
    8 Posts
    923 Views
    richferraraR
    @Christian-Ehrlicher I get the correct values (1.12, 98.42, 98.42). I don't understand why it's different in my Qt Creator application.
  • How to open QWindow on specified coordinate

    Unsolved
    2
    0 Votes
    2 Posts
    207 Views
    Christian EhrlicherC
    If you want to select the screen then use the QWindow ctor taking a QScreen. The position can be set via setPosition() but not all window managers (e.g. wayland) allow this.
  • How to get the position of the spanned cell in QGridLayout

    Solved
    5
    0 Votes
    5 Posts
    792 Views
    B
    @Hai-Anh-Luu One simple way to get index is using QLayout::indexOf(QWidget *widget)
  • Some question about .pro.shared

    Unsolved
    1
    0 Votes
    1 Posts
    161 Views
    No one has replied
  • Qt Creator custom Icon

    Locked Unsolved
    2
    0 Votes
    2 Posts
    232 Views
    Christian EhrlicherC
    Dupe of https://forum.qt.io/topic/152838/how-to-change-my-gui-icon-to-custom
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    13 Views