Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.3k Posts
  • How to use cut/copy/paste QKeySequence actions?

    Unsolved
    6
    0 Votes
    6 Posts
    579 Views
    SGaistS
    Use actions and connect them to the cut, copy, paste slots.
  • macOS Monterey 12.1, broken builds after update.

    Solved
    9
    0 Votes
    9 Posts
    1k Views
    artwawA
    @SPlatten I don't know, really. It works on my iMac. I would, however, recommend to reinstall the command line tools - this would trigger reinstallation of the SDK
  • problem with QNetworkAccessManager

    Unsolved
    7
    0 Votes
    7 Posts
    616 Views
    Christian EhrlicherC
    @millo98 said in problem with QNetworkAccessManager: the program build but don't run with 'Process finished with exit code -1073741515 (0xC0000135)' Use a debugger to see where it crashes... /edit: 0xC0000135 looks like a missing dll, can you start debugging at all?
  • How to add data to SignalTransition in StateMachine

    Unsolved
    3
    0 Votes
    3 Posts
    450 Views
    P
    in my example i have 3 states, so i need make something like: connect(state1, &MyState::transitionToState2Required, state2, &MyState::onTransitionExecuted); connect(state1, &MyState::transitionToState3Required, state3, &MyState::onTransitionExecuted); connect(state2, &MyState::transitionToState1Required, state1, &MyState::onTransitionExecuted); connect(state2, &MyState::transitionToState3Required, state3, &MyState::onTransitionExecuted); connect(state3, &MyState::transitionToState1Required, state1, &MyState::onTransitionExecuted); connect(state3, &MyState::transitionToState2Required, state2, &MyState::onTransitionExecuted); but if i have about 10 states I'll need to create about 100 such connections. may be there is any general mechanism? as i understand, if make like this: connect(state1, &MyState::transitionToState2Required, state2, &MyState::beforeTransitionExecuted); state1->addTransition(state1, &MyState::transitionToState2Required, state2); slot beforeTransitionExecuted will called before transition and i can save data in target slot? and if i make: state1->addTransition(state1, &MyState::transitionToState2Required, state2); connect(state1, &MyState::transitionToState2Required, state2, &MyState::onTransitionExecuted); transition will be executed early and only then onTransitionExecuted will be called? so it's better to use first variant?
  • Addressbook example: separation of concerns

    Unsolved
    11
    0 Votes
    11 Posts
    812 Views
    Christian EhrlicherC
    @nouwaarom said in Addressbook example: separation of concerns: Then the view will call TableModel::setData for these columns when they are double clicked and their value is updated. So what's different from the example then? That a separate widget instead a view updates the data? Who says that 'the view' must be a single widget?
  • [CMake] Linking errors using MSVC

    Solved
    13
    0 Votes
    13 Posts
    4k Views
    D
    Oh right, thanks for the heads up. EDIT : So the best solution I think would be to use the PATH by default, or set CMAKE_PREFIX_PATH through CMakeUserPresets.json on another machine if necessary
  • 0 Votes
    9 Posts
    6k Views
    JKSHJ
    @grazia88g said in How to compile QT open-source for windows 64 bit using visual studio 2012: has anyone ever done the same for Visual Studio 2010? Qt 5.7 and newer cannot be built with Visual Studio 2010
  • How to enable RootIsDecorated in QTreeView if the first column is hidden

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    JonBJ
    @AndreasF Given the behaviour it apparently has, maybe you could insert a QIdentityProxyModel-derived class between the view and your model to "map" the first visible column to be the first one if that is required?
  • Invoke a function after main

    Solved
    25
    0 Votes
    25 Posts
    3k Views
    JonBJ
    @jenya7 That's more like it, and makes sense now :) So you never did want to execute something after a.exec()! Don't forget to be careful about what you put in the thread(s) (SetupRun() etc.). You are not allowed to access anything in the main thread, especially the whole UI, directly. Subtle bugs lie if you do....
  • Naming columns for QTableWidget

    Solved
    12
    0 Votes
    12 Posts
    3k Views
    Swati777999S
    @AxelVienna said in Naming columns for QTableWidget: Trial 1 does not display anything because you hide your headers explicitly. Read my previous post and remove the respective line. I thought myTable->horizontalHeader()->hide(); for hiding numerical headers. Trial 2 fails because you use Qt 4.8. Got it. It works like a charm!
  • Adding a virtual function causes strange result...

    Solved
    31
    0 Votes
    31 Posts
    3k Views
    SPlattenS
    @jsulm , fixed with: clsXMLinterface* pobjInterface(dynamic_cast<clsXMLinterface*>(pobjButton));
  • unique_ptr for RAII?

    Solved
    7
    0 Votes
    7 Posts
    419 Views
    HoMaH
    @kshegunov Q_ASSERT! That's it! I feel stupid now - Thank you !
  • This topic is deleted!

    Solved
    18
    0 Votes
    18 Posts
    14 Views
  • Text box is not refreshing content on window.

    Unsolved
    14
    0 Votes
    14 Posts
    910 Views
    jsulmJ
    @jenya7 said in Text box is not refreshing content on window.: code will never be executed Well, it is really not hard to change this code in a way it does what you want. But I will let this simple exercise to you...
  • Auto-generate a map of all signal-slot connections

    Unsolved
    3
    0 Votes
    3 Posts
    1k Views
    Chris KawaC
    @cdwijs said in Auto-generate a map of all signal-slot connections: As far as I can tell, it should be possible to extract the above diagram from the source of the Qt program Not really, no. the signals and slots can be extracted from the class declarations That's true, although keep in mind that C++ is pretty complex language. You can obscure stuff behind macros and templates. You'd have to pretty much use a compiler to get an accurate listing or at least mimic what Qt's moc tool does. There's also stuff like QUiLoader which create objects dynamically at runtime from text files. You can't track that just from source. You could use a QMetaObject to inspect a class, but that's a runtime inspection, not a static code analysis. (...) and the lines in between them can be gathered from the connect () statements in the program. Connections are made at runtime. You can't extract them from source code. They can be disconnected and reconnected multiple times in response to events that may or may not happen and objects are created and destroyed during runtime too. Also, imagine a function like this: void doConnection(QObject* src, const char* src_signal, QObject* dst, const char* dst_slot) { QObject::connect(src, src_signal, dst, dst_slot); } and function parameters are runtime user input. Analyzing this source tells you nothing about the objects or signals/slots. The best you could do is get a runtime snapshot of app state at a specific point in time and objects and connections existing at that time. That's what tools like GammaRay mentioned by @mchinand do.
  • QWidget with toolbar buttons navigae to next line on reduction of size

    Solved
    8
    0 Votes
    8 Posts
    367 Views
    SGaistS
    Great ! Since that fixed your issue, please mark the thread as solved using the "Topic Tools" button or the three dotted menu beside the answer you deem correct so that other forum users may know a solution has been found :-)
  • modifying a variable from a different thread

    Unsolved qthread multithread variable varaiablehandl
    7
    0 Votes
    7 Posts
    1k Views
    SGaistS
    Hi and welcome to devnet, From the looks of it, you are likely accessing the QPushButton directly from your custom thread which is forbidden. GUI element manipulation shall happen in the main thread.
  • Buffer and parse management for data from serial

    Unsolved
    5
    0 Votes
    5 Posts
    714 Views
    JonBJ
    @KARMA Not sure why you have selected a 512-byte buffer, or indeed any particular limited size, since you can just e.g. allow a QByteArray to grow with append. Nothing should "get stuck" in any case. If you do your parsing --- and more particularly whatever you do with the result of the parsing --- from the readyRead signal's slot then your code would "get stuck" if your parsing gets stuck or what you do with it takes forever. readyReads should not "lose" data because you don't read that data fro a while. But you might pick up the next 7/16 bytes from the buffer and raise your own "complete packet received" signal which the outside world connects to.
  • Error:undefined reference to..

    Solved
    15
    0 Votes
    15 Posts
    16k Views
    S
    @JonB sorry for updating this late i was not doing well my problem solved by deleting the Filter myfilter (in the other .cpp file) and defining it again i don't know what was the problem ( i dint change anything just defined it again) but i am really thankfull for all of your help
  • How to set Client CA List on server QSslSocket?

    Unsolved
    4
    0 Votes
    4 Posts
    701 Views
    SGaistS
    The bug report system is for doing both feature requests and bug reports. You have to select the correct type when you fill the report. Note that since it's a new feature, it can only go into Qt 6 as there will be no new minor releases of Qt 5. That said, if the internals have not changed too much you should be able to patch Qt 5.15 for your own build.