Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.3k Posts
  • where is the qt5.9.5-qtactiveqt example project download address?

    Unsolved
    2
    0 Votes
    2 Posts
    198 Views
    JonBJ
    @mirro What is your question/problem? That link shows a number of examples.
  • Misleading QSqlField type of MYSQL database

    Solved
    3
    0 Votes
    3 Posts
    317 Views
    D
    Hi @Christian-Ehrlicher , Thank you for your comment. Perfectly understood. Have a nice day, Davide
  • What does this qt_GetMessageHook(Qt5.6.3) do?

    Unsolved
    1
    0 Votes
    1 Posts
    191 Views
    No one has replied
  • Qt\QML Q_PROPERTY() REQUIRED syntax issue

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    JonBJ
    @simone-malvezzi Always a good idea to state your Qt version when asking a question like this! :)
  • QProcess waitForFinished crashed

    Unsolved
    2
    0 Votes
    2 Posts
    505 Views
    JonBJ
    @terryGGG It doesn't crash every time, the crash possibility may lower than 0.1%. I don't think anyone will be able to solve this for you from what you show. And you do not say what version of Qt you are using, which might be relevant. Write yourself a standalone program, as minimal as possible [~20 lines?], which just does your code, 10,000 times in a loop. Make the command something simple & harmless, say dir or echo hello. Does it crash? Does it matter what the command is? If you do get a crash: get rid of both cmd->waitForStarted(); cmd->waitForFinished(-1); and replace with the QProcess signal/slots equivalent, so no waitFor...() calls, which can be "dodgy", especially potentially under Windows. Does that crash?
  • QtWebSockets and custom Signals

    Solved
    13
    0 Votes
    13 Posts
    875 Views
    JonBJ
    @Kris-Revi said in QtWebSockets and custom Signals: Socket is MySocket constructor (MySocket is a class) Sorry, but "Socket is MySocket constructor" just does not mean anything. Nor do I know what your earlier "i've put Socket(this) under the init of MainWindow" means. If Socket is indeed a class, then you cannot write connect(Socket, ...) in any situation. connect() connects the signal of one object/instance to a slot of another object/instance. Not classes. I think you are wanting to achieve the following: You have a class MySocket. It is a QObject, so it can use signals/slots. It has a member QWebSocket m_webSocket;. So it contains/encapsulates a QWebSocket, but it is not a QWebSocket itself. You define a custom signal whenConnected(), which you want emitted when the socket is connected. You define a custom slot in MainWindow, to connect to that signal. So... Inside MySocket you want to connect m_webSocket's connected signal to a slot, also inside MySocket, which goes emit whenConnected(), to raise/emit that signal to the outside world. And inside MainWindow you want to define a slot which you connect there to the MySocket::whenConnected() signal. Is that right?
  • How to enable mouse tracking for QGraphicsItem?

    Unsolved qgraphicsitem
    3
    0 Votes
    3 Posts
    1k Views
    Alex SUNPPA
    @SGaist yes, hovering will be okay too. I just didn't think that constant mouse tracking is such a problem.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    7 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    14 Views
    No one has replied
  • How can I show 3D points and lines within a 3D coordinate system

    Unsolved
    1
    0 Votes
    1 Posts
    181 Views
    No one has replied
  • QCompleter popup does not immediately reflect model changes

    Solved
    2
    0 Votes
    2 Posts
    406 Views
    D
    For anyone also having this problem, I've discovered the cause of the issue I observed, as well as a workaround. The completion prefix can have a stale value even if the text entry field is cleared, and this prefix can prevent any completion matches from being found, causing the size hint to return 0. To get around this, manually clear the completion prefix before querying for the size hint. If the text entry field isn't being cleared as well at the same time, the prefix can be stored before it is cleared and restored after the size hint is retrieved, keeping the prefix and entered text synchonised. QObject::connect(&button, &QPushButton::clicked, [&completerModel, secondStringList, &completer]() { QString cachedPrefix = completer.completionPrefix(); completer.setCompletionPrefix(""); completerModel.setStringList(secondStringList); completer.popup()->setFixedWidth(completer.popup()->sizeHintForColumn(0)); completer.setCompletionPrefix(cachedPrefix); });
  • Is what I'm wanting to do even possible with QT and C++

    Solved
    10
    0 Votes
    10 Posts
    831 Views
    T
    @Pl45m4 In 99% of all cases, there actually IS a similar question and you can find the answer on your own. The thing I've often found is that, when being new, the hardest part of solving a problem is actually knowing how to frame your question. If you knew exactly what to ask, then a lot of the times you'd already have your answer. If not, a simple google search would give it to you. I get that people get tired of the same questions over and over, but when you're a noob, sometimes it takes an actual human being who can hear what you're saying and get the actual question out of it even if google fails to do so.
  • MenuBar issue on macOS

    Unsolved
    4
    0 Votes
    4 Posts
    329 Views
    SGaistS
    Then you should check the bug report system. It this issue has not already been reported please consider opening a new report providing a minimal compilable exemple that reproduces the behaviour.
  • Google oAuth invalid QOAuthHttpServerReplyHandler

    Solved
    5
    0 Votes
    5 Posts
    609 Views
    O
    had the same problem, trying to solve it in a different way . if you don't care using the consent screen each time you can try : QOAuth2AuthorizationCodeFlow oauth ;// (not sure about syntax) ... ... .. connect(oauth , &QOAuth2AuthorizationCodeFlow::authorizeWithBrowser, [=](QUrl url) { QUrlQuery query(url); query.addQueryItem("prompt", "consent"); // Param required to get data everytime query.addQueryItem("access_type", "offline"); // Needed for Refresh Token (as AccessToken expires shortly) url.setQuery(query); QDesktopServices::openUrl(url); }); found it at stackoverflow cant find the link now.
  • QOAuth2AuthorizationCodeFlow - who is responsible to call refreshAccessToken?

    Unsolved
    1
    0 Votes
    1 Posts
    129 Views
    No one has replied
  • Qt 15.5.0 DPI scaling touch screen problem (EGLFS)

    Unsolved
    1
    0 Votes
    1 Posts
    362 Views
    No one has replied
  • Independent scroll areas for separate vertical horizontal scrolling

    Solved
    3
    0 Votes
    3 Posts
    506 Views
    S
    @SGaist I looked at the code and there was a connect() function, which got my attention. So I looked into it and found PyQt (I didn't mention this before) equivalent. So basically by adding an external scrollbar and connecting to the hidden scrollbar of the scrollArea did the trick. Thanks a lot! self.horizontalScrollBar.valueChanged.connect(self.scrollArea.horizontalScrollBar().setValue) [image: 070fd0a0-e85a-4d13-9de4-c3ec90ccac61.png]
  • Day view calendar

    Solved
    7
    0 Votes
    7 Posts
    767 Views
    S
    @SGaist I accepted @mrjj's answer for simplicity at the moment. I am looking into Korganizer's code to figure out how they did it. So far I am close to a solution with Qt layouts with a caveat: https://forum.qt.io/topic/119150/independent-scroll-areas-for-separate-vertical-horizontal-scrolling
  • scope of variables in slots

    Solved
    9
    0 Votes
    9 Posts
    723 Views
    Chris KawaC
    @tannhaus Yeah, all class members need to be in the class declaration. This is because the compiler needs to know the size of the class just by reading its declaration. Basically when you include the header the sizeof(YourClass) needs to be calculable. Imagine if you could declare a class member anywhere in its methods. It would be impossible to determine the size of the class. What if the function was never called. Does the variable inside still count to the size of the class? What if you declared a variable in a if statement? Sometimes counts and sometimes not? C++ is statically typed and all types have a constant size calculated at compile time from their type declaration.
  • What is this symbol //! ?

    Unsolved
    5
    0 Votes
    5 Posts
    460 Views
    sierdzioS
    @AnneRanch said in What is this symbol //! ?: So far seems like magic, but I will RTFM to get used to it. Better focus on Doxygen. It uses the same syntax and is focused on generating project documentation. qdoc is intended as an internal thing in Qt to generate Qt documentation only.