Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • Newbie: Canonical way for getting this layout (screenshot)

    Solved
    3
    0 Votes
    3 Posts
    256 Views
    C
    @SGaist Your two buttons should go in their own vertical layout to which you add a stretch after adding the second button so they are pushed up. B and the buttons layout go into a horizontal layout and finally, A and the horizontal layout go into a vertical layout that you set on you main widget. Already done. What you get at the end is that the vertical spacer grows, which in turn the vertical layout grows, which in turn the horizontal layout grows up to the half of the main window. The top half is take by table A. When adding A to the vertical layout, use a stretch factor of 1 so it will get more space than what is below. Do the same >for B when you add it to the horizontal layout so it should also take more space that the buttons. As far as I've understood, with stretch you set a different factor of growing than what is the default. But I don't care about table A, it can grow or shrink, table B must grow or shrink only horizontally and not vertically. Do you talk about vertically stretch in you comment I guess, right? Thanks
  • Accessing FT_RENDER_MODE_SDF through Qt APIs

    Unsolved
    2
    0 Votes
    2 Posts
    194 Views
    SGaistS
    Hi, Good question, I think the best way to check that is to take a look at the qtbase module and search for it there.
  • Need suggestion to develop cross platform desktop application for traders

    Unsolved
    8
    0 Votes
    8 Posts
    707 Views
    JoeCFDJ
    @SimonSchroeder Maybe RUST is a good option for trading underneath and Qt for display.
  • newbie question: how to set a fixed height of a set of Widgets

    Solved
    19
    0 Votes
    19 Posts
    2k Views
    C
    @mpergand In fact you circonvent the normal behavior of layouts, so the need to fiddling around . My intention was to get my desired layout using only horizontal and vertical layouts, optionally with grid layouts, and their properties. Yes, because without this, only the table is size constrainted, not the buttons. My knowledge of Qt is still very poor, but why the vertical layout containing the buttons and the spacer doesn't honor the layoutSizeConstraint property set to SetFixedSize but instead grows as in my second screenshot at the top of this thread? Thanks
  • Can't find 'QObject'

    Locked Unsolved
    2
    0 Votes
    2 Posts
    358 Views
    Christian EhrlicherC
    @MyNameIsQt Any reason posting the same question again? https://forum.qt.io/topic/152812/qobject-file-not-found -> closed
  • Set tab alignment for QTabBar whith is not within QTabWidget

    Solved
    4
    0 Votes
    4 Posts
    476 Views
    Axel SpoerlA
    @YuJin said in Set tab alignment for QTabBar whith is not within QTabWidget: By the way,Is there any way to control QTabBar layout direction by Qss which is not whitin QTabWidget? No, as far as I know. That would not make too much sense, as this property is style-independent.
  • Source build errors

    Unsolved
    4
    0 Votes
    4 Posts
    410 Views
    sierdzioS
    @kkoehne ah right, makes sense. I was surprised to see ninja in Qt 5.12 but thought maybe I just don't remember that it was possible to use cmake. But now that's clear, this ninja call comes from one of the web modules which I don't use.
  • Is it possible to synchronize widget updates to vsync without OpenGL?

    Unsolved
    1
    0 Votes
    1 Posts
    149 Views
    No one has replied
  • How to get service, path, interface parameters for QDBusInterface class ?

    Unsolved
    5
    0 Votes
    5 Posts
    474 Views
    V
    @sierdzio Thank you so much !
  • I updated the UI in the sub thread, but the program did not crash

    Solved
    7
    0 Votes
    7 Posts
    582 Views
    S
    @John-Van said in I updated the UI in the sub thread, but the program did not crash: That is to say, whether one crash or not depends on luck? Yes, it does. From my experience I would say that having luck in this context is mostly deterministic: As long as you don't change your code you could continue to be lucky (and I would claim that the odds are slightly stacked towards not crashing). However, any change in your code (most likely totally unrelated) will lead to crashes eventually. BTW, in your case this is really easy to fix. Just write: connect(timer, &QTimer::timeout, this, [=]() { btn->setText("11111"); }); The third argument (if present) is a context object. It has a double purpose: 1) If the context object is deleted, the connection will be disconnect (since you rely on capturing this this would be a good idea). 2) More importantly in your case, the lambda will be executed in the thread of the context object (if I'm not mistaken).
  • QVector<mystruct> access

    Solved
    4
    0 Votes
    4 Posts
    339 Views
    jsulmJ
    @gfxx said in QVector<mystruct> access: you means these? No, I did not mean this. What I mean is simply: QVector<mystruct> mys(10);
  • accessing multiple pushbutton objects from a loop

    Unsolved
    3
    0 Votes
    3 Posts
    274 Views
    D
    @Pl45m4 Thanks I believe that I have it.
  • type_traitsFile not found

    Unsolved
    15
    0 Votes
    15 Posts
    7k Views
    C
    @ham13 I have the same result with Qt 6.6.1/GCC 11 on Ubuntu 22.04. I cannot yet see the connection between the line identified in the error and the type of error (std::pair-related type conversion issues).. I do note, however, that some of the components are venerable and do things that cause problems. For example, QXlsx forces C++11 flags on the compiler, generating warnings about C++17 requirements (and probably plenty more). Zint appears to be of Qt4 vintage. Qt6 is supported though the QT5 compatibility layer.
  • Custom Qt USB FileSave dialog

    Unsolved
    2
    0 Votes
    2 Posts
    240 Views
    C
    Perhaps look into the Qt D-Bus module if D-Bus is available on your target platform. The org.freedesktop.UDisks2 system bus service looks of interest. Qt provides qdbus and qdbusviewer to help dig around in this world, and there is also dbus-monitor. I am not familiar enough with how this works to help further. It'll also need a mount feature so the USBs are mounted at a specified location. Mounted at a user-specified location or a known, fixed location (i.e. specified by the /etc/fstab file)? Any arbitrary USB drive or only known USB devices? Mounting could be done with sudo and a suitably restrictive sudoers file but you need to think about the security implications.
  • cannot find -ld3d12

    Unsolved
    4
    0 Votes
    4 Posts
    774 Views
    C
    @pistachio MingW is supposed to have included DirectX 12 headers/libraries since version 8.0. Perhaps an upgrade is needed. Do relevant files exist within your MingW install (even though CMake does not find them) ?
  • Detecting Drop Events Outside Application in QT C++

    Solved
    2
    0 Votes
    2 Posts
    314 Views
    Axel SpoerlA
    @M4cM4rco You can just override drag events in your custom Widgets like documented here. The drag override makes sure that the user observes the outside of main window as a valid drop area. The drop override has to implement a new window being created. I’d look into dock widget options, because much of the required functionality comes out of the box here.
  • Using local gis server

    Solved
    6
    0 Votes
    6 Posts
    774 Views
    Q
    @QuanTong I fixed, maybe the MapType.CustomType is not passed as my old code above. I found a guy who fixed from this and I tried -> It worked well <3 My new source code: Window { visible: true width: 800 height: 600 Plugin { id: mapPlugin name: "osm" PluginParameter { name: "osm.mapping.providersrepository.disabled" value: true } PluginParameter { name: "osm.mapping.custom.host" // Modified here value: "http://127.0.0.1/hot/" } } Map { id: map anchors.fill: parent center { latitude: 10.802138 longitude: 106.6397577 } zoomLevel: 10 gesture.enabled: true plugin: mapPlugin //Make sure to set activeMapType equal to MapType.CustomType activeMapType: { return map.supportedMapTypes[6] // Modified here } } }
  • 0 Votes
    5 Posts
    302 Views
    Christian EhrlicherC
    @Tricoffee said in Using the QImageReader::setClipRect function, can not be used to load the interesting parts of a given image: Is there an alternative method to only load the part of interest of the given BMP image? No, read the complete image and then copy out the part of interest.
  • QTableView Versus Row Drag/drop crashes

    Unsolved
    8
    0 Votes
    8 Posts
    762 Views
    J
    Hello @SGaist, fully agree with you and understand. I wrongly assumed that row drag and drop was part of the baseline behavior of the qtableview :) I'm following the links you sent me and the various example to work on it (the source code of the Qtableview itslef provides a lot of information)
  • How to replace QwtLegend::legendItems()

    Solved
    5
    0 Votes
    5 Posts
    470 Views
    R
    @rock37 found the way, thanks for the advice