Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Calling MainWindow code from QGraphicsItem objects

    Solved
    6
    0 Votes
    6 Posts
    517 Views
    A
    Now it finally starts making sense. I was able to link the signals and slots together thanks to your explanation. I think the signal procedures are like radio transmitters that emit a message at a certain frequency. And a slot is the transmitter that must be tuned to the same frequency with connect() to be useful. But just like in radio, repeater receiver/transmitter pairs (chaining) are needed over long distances (across class boundaries). Please excuse my ramblings and many thanks for your helpful, clear explanations.
  • disabling all keyboard input to a dialog

    Unsolved
    2
    0 Votes
    2 Posts
    363 Views
    JonBJ
    @Kent-Dorfman +1 for your command of the English language to (correctly) use "one fell swoop", and not the spelling so often found which refers to football or chickens... :) In a single word, is the way to achieve your desired behaviour by defining an eventFilter() on the dialog, where you can select which events to handle/pass on and which to ignore?
  • Do I need the private libraries in order to make a custom QGraphicsLayout?

    Unsolved
    2
    0 Votes
    2 Posts
    201 Views
    C
    @Kill-Animals said in Do I need the private libraries in order to make a custom QGraphicsLayout?: do I need to be using the private libraries here No. They are private to the Qt library itself for a reason. The subclasses that already exist layout items in non-overlapping areas (horizontally, vertically, or both). It sounds like you want something far more complex than that. If you want to handle this as a layout manager then you really have no choice but to subclass QGraphicsLayout. When you do that your subclass needs to implement its own logic for all of the pure virtual members and develop its own mechanisms for actually laying out the contained items. It should not need to reach into the private workings of the abstract QGraphicsLayout to achieve this.
  • Undefined Reference

    Unsolved
    8
    0 Votes
    8 Posts
    476 Views
    O
    My mistake. If you note the second constructor does what I want: get a two dimensional array of [row ][column] that will allow me to construct a contiguous array of qreals. White the final constructor I was trying to make it less verbose. Some other languages allow something like x[0][:] to return and array with the first row of x[][]. Also, I will note that I have watching on but I do not get a notification unless I click no the icon, before a number, representing the number of notifications, would appear on the icon.
  • Creation of custom menubar.

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    A
    @JonB You are right. I will try.
  • QTableWidget has blank cells after I set their strings

    Solved
    11
    0 Votes
    11 Posts
    942 Views
    JonBJ
    @Publicnamer I look forward to your future illustration of such fundamental bugs in QString. The problem with programmers these days is that they do insist there are no bugs (without evidence), I don't agree with your sentiment here. Rather I find the problem with (some) programmers is that they are too quick to blame their tools --- toolkit, Qt, whatever --- when they should reflect on how widely used it is among other people and it is their own code they should examine instead. Speaking at least from experience on this forum I know just how many people come say "there is a bug in Qt" when their own code is faulty. Lots & lots of times....
  • Multiple definition of '__imp___C_specific_handler'

    Solved
    6
    0 Votes
    6 Posts
    832 Views
    JonBJ
    @pingal That is a funny one! Windows should be case-insensitive, filename-wise. However, it looks like MinGW linker is case-sensitive to some degree.
  • The MouseEvent of Qlabel doesn't work, after an advanced click on the label.

    Unsolved
    5
    0 Votes
    5 Posts
    878 Views
    SGaistS
    What exactly do you want to happen when clicking on that QLabel ? The proper way is to create a subclass of QLabel and re-implement mousePressEvent however you can do things a bit differently since you are using Python.
  • MacOS: how to run AppleScript script from a Qt app?

    36
    0 Votes
    36 Posts
    22k Views
    Z
    About running such a script as a QProcess : I am trying to make it work in a sandbox environment (App Store), but I'm not sure wether the main app's entitlements apply to the osascript QProcess launched ? I'm getting access violation errors but I'm not sure if it's because my app is not signed correctly with entitlements, or if maybe it is because I must figure out a way to get the entitlements to apply also to the subprocess...
  • no adapter checked...

    Solved
    1
    0 Votes
    1 Posts
    117 Views
    No one has replied
  • block C++ and waiting for a qml signal to continue execution

    Unsolved
    4
    0 Votes
    4 Posts
    827 Views
    kshegunovK
    @Guigui64 said in block C++ and waiting for a qml signal to continue execution: However I think that, as you recommend, I will turn to another solution, maybe split the code in 2 separate functions and avoid the "blocking" solution.... That's much better, and what you should do, yes. As a side note, QEventLoop is used correctly, as far as your code goes and as far as I can tell, but you should avoid it in principle.
  • How to hide all widgets from a QVBoxLayout with spacer?

    Solved
    5
    0 Votes
    5 Posts
    2k Views
    M
    @Gabber said in How to hide all widgets from a QVBoxLayout with spacer?: The "morph into" function in the QT creator does exactly what you write, doesn't it? There I can also convert the layout into a QWidget. I have hard time to figure out how to convert (morph?) a layout to a widget.
  • Uniquely identify a machine

    Solved
    9
    0 Votes
    9 Posts
    905 Views
    H
    @mrjj said in Uniquely identify a machine: then it should be rare that someone change the mac ID yeah that's what I counting on.
  • Use of undeclared identifier 'inet_pton'

    Solved
    6
    0 Votes
    6 Posts
    805 Views
    Christian EhrlicherC
    As stated in the documentation you gave us, you have to set _WIN32_WINNT to a value greater or equal to Windows 8 and you must not redefine a value defined by the windows headers itself. When you use qmake you can add a compiler definitions with the DEFINE command: https://doc.qt.io/qt-5.12/qmake-variable-reference.html#defines DEFINES += _WIN32_WINNT=0x0602 But since we're here in Qt-forum - why not use QHostAdress?
  • QListView deselect item by clicking on selected Item

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    ?
    @mrjj Thanks for your code example, it works perfectly! I have thought about the whole thing again and will stay for now with a simple select (without shift). Therefore I will mark the thread as solved.
  • How to manage project versions in Linux ?

    Unsolved
    2
    0 Votes
    2 Posts
    158 Views
    mrjjM
    Hi Many use an online code revision system as not to lose code if the system fails. Like https://bitbucket.org/product You don't have to use an online service but if you use it only locally, the safety is lacking. Alternatively, you can use a sync service like pcloud and let it store copies of the projects into the cloud.
  • how to add a suffix to a file after saving it on filedialog in qml

    Unsolved qt5 qml filedialog file
    3
    0 Votes
    3 Posts
    971 Views
    JuniorMLedesmaJ
    Hello, I want to know how to add a suffix to a file after saving it on filedialog in qml and I came here in hope to find my answer. But It makes me sad when I can't find it. I tried filePath = filePath + '.txt' but isn't working for me. Can anyone share a website with me in which I can find the solution? I will be very much thankful to you.
  • why? it shows me these warnings when I generate the slots for my controls.

    Unsolved
    2
    0 Votes
    2 Posts
    287 Views
    C
    These slots are named to take advantage of automatic connections between signals and slots implemented by QMetaObject::connectSlotsByName() and most often used in Qt Designer UIs. This mechanism is not inherently evil. However, if you rename the object in the Designer UI and not the matching slot then the automatic connection will not happen (silently). Conversely (and less likely), if you name a function on_blah_triggered() for a reason unrelated to the UI, but where blah exists and has a triggered() signal, you may find an unexpected connection is made (silently). You will find these at run time. This fragility is the reason for the warning. The alternative is to avoid the automatic connection naming and explicitly code connections in your constructor. If you use new-style connect() then this will fail at compile time in the first case, and the connection will not be present in the second.
  • Is there any official document by Qt for Qt_MVVM or Qt_MVC.

    Unsolved
    2
    0 Votes
    2 Posts
    175 Views
    C
    If you mean official documentation for QtMvvm then no. This is a third-party library, so The Qt Company is not the one to document it. I have no idea what Qt_MVC might be referring to. I suspect the answer is the same.
  • Trying to get records from database with c++ and pass it to listview model

    Unsolved
    4
    0 Votes
    4 Posts
    252 Views
    D
    Text { anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter anchors.leftMargin: 8 font.pixelSize: 12 text: modelData.name color: "#b9b5b5" Component.onCompleted: { console.log(JSON.stringify(modelData.name)) } } so modelData.name does the trick....maybe there are better ways, if someone hve any suggestion, please share