Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Generic way to restore / set widgets to initial state ?

    Solved
    10
    0 Votes
    10 Posts
    2k Views
    Pl45m4P
    @SPlatten said in Generic way to restore / set widgets to initial state ?: thought I'm going to implement a signal, something like dataUpdate where the controls will connect to this signal and they're own slot will update the control. Just do it :) You know best, how your widgets should look in your initial state or how to "reset" them. Can't be that hard to think about everything you want to undo / reset and then write a function which does so. Some function or slot which can be connected to your signal and which will clear, uncheck, flush, whatever... everything. Btw: This behavior is not very uncommon. A dialog with some input fields and a button to "clear" / reset all input, while keeping the rest. On QLineEdits you can simply call clear() (you probably know that)... for every other widget and maybe even custom ones, we can't help you, how your initial state might look like and how to get there :)
  • This topic is deleted!

    Solved
    12
    0 Votes
    12 Posts
    71 Views
  • Setting background colour of qtableview

    Unsolved
    4
    0 Votes
    4 Posts
    405 Views
    JonBJ
    @andi456 That's fine, QStyledItemDelegate seems best. What triggers the paint method of QStyledItemDelegate? Just whenever it needs painting/re-painting! QStyledItemDelegate receives a QModelIndex(). That contains the row. You can find the "column x" with the desired color via siblingAtColumn() in the row.
  • How mathematical operations done correctly in qtCreator?

    Unsolved
    11
    0 Votes
    11 Posts
    565 Views
    Christian EhrlicherC
    @Wasee said in How mathematical operations done correctly in qtCreator?: I am adding/subtracting two string values You can not add/substract string, only numbers... see QString::toInt() and similar QString functions.
  • No sound in exe file on different PC

    Unsolved
    11
    0 Votes
    11 Posts
    860 Views
    jsulmJ
    @harish__rajora Found this: https://forum.qt.io/topic/41943/platform-plugin-windows/8 Check the last post there.
  • At the paint event after applying the style sheet to the button

    Unsolved
    2
    0 Votes
    2 Posts
    252 Views
    Pl45m4P
    @IknowQT Why you need stylesheet when you use the paintEvent anyway? How does your paintEvent look like? Do you call the base implementation of QPushButton::paintEvent afterwards? It could overwrite your custom style
  • This topic is deleted!

    Solved
    12
    0 Votes
    12 Posts
    30 Views
  • How to include so files (libraries).

    Solved
    5
    0 Votes
    5 Posts
    2k Views
    J
    @jsulm said in How to include so files (libraries).: @jenya7 said in How to include so files (libraries).: I don't understand why do I need so files Well, you want to use a library (.so), right? How else should it work? Or is your library header-only? " just can't figure what is a library in the folder" - it is a *.so file in the build folder of your library project. Thank you. Now it makes sense to me. :)
  • StackWidget objects in qt designer not resizing

    Unsolved
    7
    0 Votes
    7 Posts
    634 Views
    S
    @LT-K101 said in StackWidget objects in qt designer not resizing: But when I used all the layouts in Qt designer it reposition the objects in a different manner which is not the way i arranged the objects. I have to disagree here. When you don't use a layout, the position of widgets is in relation to the top left of the widget they are contained in: The spacing between the widgets stays the same in your full screen view, and also their relative position in relation to the top and the left. I am not entirely sure what you are trying to achieve or why a layout would break the thing you are trying to achieve. With the way things are layout in Qt Designer right now, I would just apply a grid layout to the parent widget (I believe this is a little complicated with a stacked widget; you might have to select the correct widget in the Object Inspector on the right to apply the layout). If you want some space between some of the widgets, add horizontal or vertical spacers (they can be found almost at the top of the list on the left). I tend to use horizontal spacers with a fixed width of 20 pixels from time to time.
  • 0 Votes
    6 Posts
    589 Views
    jsulmJ
    @dounreay said in Qkeychain - error: undefined reference to `__imp__ZN9QKeychain16WritePasswordJobC1ERK7QStringP7QObject': No, the libraries and the includes are in different sub directories This is not what I asked. And there is also no need to move the lib. What I asked was: was this library built using same compiler or a different one? You can't mix binaries built with different compilers (like MSVC and MinGW) in same application.
  • btchat example not working between windows 10

    Unsolved
    1
    0 Votes
    1 Posts
    177 Views
    No one has replied
  • How to start a QEventLoop and triggers a function every 5 seconds.

    Unsolved
    4
    0 Votes
    4 Posts
    1k Views
    Christian EhrlicherC
    The detailed description should help here. Create timer, connect timeout to the your custom slot, do your work and checks in there.
  • Test successful but the application crashes

    Solved
    2
    0 Votes
    2 Posts
    621 Views
    Christian EhrlicherC
    As always - start your app with a debugger and see where it crashes, fix it. From what I see erdBridget is not initialized so delete will crash
  • Scroll gestures do not work.

    Unsolved
    2
    0 Votes
    2 Posts
    245 Views
    SGaistS
    Hi, Aren't you missing something like: QScroller::grabGesture(&tree, QScroller::TouchGesture); ?
  • Qt 6.2 QImage JPG over 33,547,526 pixels no longer loads

    Solved
    10
    0 Votes
    10 Posts
    1k Views
    R
    @Christian-Ehrlicher @hskoglund @SGaist Thanks very much gentlemen!
  • QSpinBox doesn't send signal valueChanged() anymore

    Solved
    16
    0 Votes
    16 Posts
    6k Views
    kshegunovK
    @Christian-Ehrlicher said in QSpinBox doesn't send signal valueChanged() anymore: No need - a simple look in the documentation reveals it. But who needs a documentation ... I assume it's the overload resolution, I wanted it confirmed.
  • How to pass parameters via contextmenu addActions() ?

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    Christian EhrlicherC
    @nicholas_yue said in How to pass parameters via contextmenu addActions() ?: [this, v1=p1, v2=p2]{ Why do you want to rename them? A simple [this, p1, p2] is enough.
  • Error with customsortfiltermodel example

    Solved
    6
    0 Votes
    6 Posts
    429 Views
    P
    @Christian-Ehrlicher it works! Thank you guys!
  • Saving UI components to file

    Unsolved
    4
    0 Votes
    4 Posts
    717 Views
    SGaistS
    Hi, One thing you might want to explore is QAbstractFormBuilder.
  • Qprocess read Jlink Commander line

    Unsolved
    12
    0 Votes
    12 Posts
    1k Views
    JonBJ
    @Naireyang said in Qprocess read Jlink Commander line: way2. use windows api "CreatePipe" and "CreateProcess" in windows.h or qt-windows.h. thanks to @JonB I don't know, and certainly not for Windows, but I would have thought you could achieve whatever you've done with QProcess settings. It depends just what the vital bit is, whether you can affect it. Anyway if you do need and you are happy with your Windows code solution for this that's fine.