Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Primary key purpose

    Unsolved
    3
    0 Votes
    3 Posts
    284 Views
    C
    @Saviz In your table the primary key column, your auto-incrementing surrogate key, does contain unique values. You can update one record independent of the other using that number to identify the record. If you intended that the combination of first and last name was unique (i.e. a "natural" key) then you need to enforce that either in your code, or with a second unique, compound index on the table, e.g. create unique index blah on workers(first_name, last_name); (If you use the index be prepared to handle the failure to insert) If that was your intent then please consider that real world names are generally not unique and this is precisely the reason you want a surrogate key in the first place. The Qt models and views rely on a single column, numeric primary key to identify records without needing business domain knowledge to determine identity.
  • get soap auth for dpd.com in QT C++

    Unsolved
    2
    0 Votes
    2 Posts
    219 Views
    Axel SpoerlA
    @Jakobm789 Could you post your entire code, please? The event loop has to spin and the timeout looks a bit like blocking code or early exit.
  • Brightness screen by qt app

    Solved
    4
    0 Votes
    4 Posts
    358 Views
    jsulmJ
    @Damian7546 said in Brightness screen by qt app: no, i'm not doing that Why not?
  • Control Z forward analog

    Unsolved
    2
    0 Votes
    2 Posts
    224 Views
    jsulmJ
    @JacobNovitsky Ctrl-Shift-Z
  • High DPI and AppImage format

    Solved
    4
    0 Votes
    4 Posts
    898 Views
    A
    Well, as it turns out there were some environment variables set that caused the highdpi scaling to be disabled. I must have set them at some point, though I can't recall when or why... Thanks @Asperamanca and @SimonSchroeder for your input!
  • QWidget is not transparent when being used as a subcontrol

    Solved
    4
    0 Votes
    4 Posts
    654 Views
    G
    Transparency in Windows is achieved through layered windows, which is also used in Qt's transparent window and belongs to DirectUI. The entire window has only one winId (HWND) but OpenGL and DirectX require a handle to render. However, if a child widget in the Qt window obtains the winId, it will break the "DirectUI" and all widgets in the window will have a handle. Therefore, it is impossible to render a specific widget with OpenGL or DirectX in a transparent window. The solution : Set the controls on top of the video to be Tooltip + transparent background. Additionally, when a control is set as a tooltip, its coordinates are no longer relative to the parent window but global. Therefore, special handling is required for its coordinates.
  • How to get WinMain function's params in Qt's main function?

    Solved
    5
    0 Votes
    5 Posts
    707 Views
    G
    @Chris-Kawa That' s exactly what I want, thank you.
  • how to use QXmlStreamWriter ::writeCurrentToken

    Unsolved
    8
    0 Votes
    8 Posts
    528 Views
    O
    for example the source xml file // <?xml version="1.0" encoding="ISO-8859-1"?> <indexedmzML xmlns="http://psi.hupo.org/ms/mzml"> <mzML xmlns="http://psi.hupo.org/ms/mzml"> </mzML> </indexedmzML> use writeCurrentToken to write a new file, the output is like this <?xml version="1.0" encoding="ISO-8859-1"?> <n1:indexedmzML xmlns="http://psi.hupo.org/ms/mzml"> <n1:mzML xmlns="http://psi.hupo.org/ms/mzml"> n1:/mzML n1:/indexedmzML
  • Qt Google Maps Plugin

    Solved
    3
    0 Votes
    3 Posts
    685 Views
    W
    @jsulm That my friend was the exact problem! Thank you very much.
  • filling window with QToolButtons and Icons

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    O
    @Chris-Kawa Thank you very much for your input. The images I have are actual photos from a vintage calculator (which took some time to make without any shadowing from the calculator keys). So yeah, it's strange (like the programmer himself, I suppose). And I discovered why my vertical spacing was off, I swapped the height/width parameters in QSize. So I'm getting there, thanks to you.
  • How to run multiple unit tests from command-line?

    Unsolved qttest qmake
    6
    0 Votes
    6 Posts
    1k Views
    SGaistS
    @Pixelgrease you might also want to consider migrating to cmake for the long run.
  • How to make QGraphicsItem not change size but keep the same position?

    Solved
    6
    0 Votes
    6 Posts
    987 Views
    JonBJ
    @odelaune Yes, drawForeground() would avoid all this! And you would not represent that "arrow" by a graphics item on the scene, it would just be artefact drawn on the view foreground. Which I suspect is just what you want here.
  • can not set permissions for usr/include/x11 qt

    Unsolved
    3
    0 Votes
    3 Posts
    187 Views
    JonBJ
    @JacobNovitsky You should not be doing anything which would cause to (try to) write/save to /usr/include/... anything --- that's a system area! What are you doing to make this happen? You didn't read in /usr/include/X11/Xlib.h (perhaps while following definitions), and then accidentally change it, did you? HEADERS += linuxkbhit.h I might be mistaken, but I would have expected the first line to end with a \, i.e. HEADERS += \ linuxkbhit.h Similarly SOURCES += linuxkbhit.cpp main.cpp ought be SOURCES += \ linuxkbhit.cpp \ main.cpp Is that relevant? You have two LIBS += lines both adding -lX11. Probably no harm, but just commenting.
  • Performance problem about QItemSelectionModel

    Unsolved
    10
    0 Votes
    10 Posts
    1k Views
    ruphusR
    May I suggest to use selection.select(left, right) instead of merging? In my experience, the former is faster.
  • 0 Votes
    13 Posts
    2k Views
    G
    @Narutoblaze Since I recently burned my feathers, I strongly advise you not to try to go against how the automatisms and things in general have been built, especially if it's just because you're used to doing it in a certain way. Use the signals available, use installEventFilter, avoid complications just to look cool, simplify the goals. You'll do the cool stuff in the future, after you get used to it.
  • qt5.9.9编译的界面程序在centos 7.6出错

    Unsolved
    4
    0 Votes
    4 Posts
    277 Views
    Pl45m4P
    @mrcbj said in qt5.9.9编译的界面程序在centos 7.6出错: compiled using qt5.9.9 Is it possible to test or compile with later version? Qt5.15 or Qt6? It may or may not fix your issue.
  • Click through windows

    Solved
    9
    0 Votes
    9 Posts
    8k Views
    S
    On Win7 (at least) transparent windows are are feature of the Windows window compositor (Aero) and you need to enable transparency in Windows graphics/system settings.
  • Resizing components in a Window

    Unsolved
    4
    0 Votes
    4 Posts
    304 Views
    jsulmJ
    @Duyct said in Resizing components in a Window: all the components can't fit in the window Because the window is too small. Do you use layouts?
  • Possible to default the qApp to ScrollBarOverlap?

    Solved
    4
    0 Votes
    4 Posts
    276 Views
    Chris KawaC
    Don't install it on individual scrollbars. Use it on your application object like in the example code I linked.
  • JUCE / macOs

    Unsolved
    2
    0 Votes
    2 Posts
    204 Views
    Pl45m4P
    @Xoaco Have a look here https://www.qt.io/blog/juce-x-qt but it has not been possible so far What happens? What does not work?