Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • 0 Votes
    1 Posts
    330 Views
    No one has replied
  • Qt 6.5: accessing QML file from C++

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    jeremy_kJ
    From a high level, the module API looks like a nice thing to use. When I've directly instantiated QML from C++, it's only ever been to load a single top level Item. As @mzimmers suggests, I've found it better to keep the presentation layer pretty much to itself. The interaction that is necessary should be via signals and slots, or events and event handlers. A C++ slot might be the right place to instantiate an instance of a QQuickComponent provided by a QML caller. This is how containers such as Repeater and ListModel work.
  • Qt6.5.0 issues

    Unsolved
    3
    0 Votes
    3 Posts
    545 Views
    posktomtenP
    @JoeCFD Thanks! You put me on the right track. (QT += core-private) I've just learned how to use CMakeLists.txt (or am doing, to be honest) I made a *.pro file and it worked! Without QT += core-private. Strange that it works with Ubuntu 20.04 but not with 22.04. I'll have to go through my CMakeLists.txt and try to understand what's going on.
  • QMovie for each button displaying a gif in the json file

    Solved
    4
    0 Votes
    4 Posts
    292 Views
    K
    i found the "problem"... the first button has a .gif image BUT it is not animated... just named .gif so i figured that is why the QMovie is NOT showing it :)
  • Using QNetworkReply multiple times

    Solved
    3
    0 Votes
    3 Posts
    223 Views
    C
    @Christian-Ehrlicher I am sorry, I have realized that I have used QNetworkReplys wrongly. Someone has mentioned the correct way to connect signals and slots on it and now my problem does not persist anymore
  • Qt 6.5.0 Error connecting colorSchemeChanged signal

    Unsolved
    12
    0 Votes
    12 Posts
    1k Views
    PerdrixP
    @Axel-Spoerl Using the new syntax for connect, it does work. I'm unclear why the old syntax wasn't working for me. Thank you.
  • Set QImage as background image of label?

    Unsolved
    9
    0 Votes
    9 Posts
    1k Views
    C
    @Taytoo by show I meant post a screenshot of it, and the stylesheet you're applying to it, and it would help to mention your use case, as in what are you using this label for and so on, we could possibly offer a better approach based on that.
  • Qudpsocket connect in Lan,

    Unsolved
    7
    0 Votes
    7 Posts
    460 Views
    JonBJ
    @DQUY05 No (not that I am aware of), you have to go into your firewall software and make sure it allows through the port you wish to use. For Windows firewall, say, I think you can restrict to particular application(s).
  • Error : Multiple definition of eventFilter

    Unsolved
    4
    0 Votes
    4 Posts
    339 Views
    jeremy_kJ
    Please copy and paste the actual code and include a complete example, rather than retyping a snippet. The process of creating a minimal working example might be enough to clarify the problem. If not, at least it gives other readers a good chance of understanding. The class declarations class myView :: public QDockWidget and class myBrowser :: public QDockWidget aren't valid C++, and don't contain enough information for anything beyond guessing. Using them should result in a compilation error along the lines of: a.cpp:2:13: error: 'public' cannot be a part of nested name specifier; did you mean ':'? struct d :: public b {}; ~~ ^
  • Qt6 Multimedia QVideoFrame: native handle?

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    W
    @Bonnie The sort of transitional state of Qt Multimedia is pretty entertaining when you try to read the documentation. It mentions things like "The return value of the handle() function" in the text but then doesn't document a handle() as existing in the Public Functions section. https://doc.qt.io/qt-6/qvideoframe.html It's all a bit dusty, and no longer really works the way the docs say, or how it was apparently intended,
  • QListWidget::itemEntered signal is not working properly

    Unsolved
    11
    0 Votes
    11 Posts
    703 Views
    SGaistS
    It has been made public for Qt 6. In between, you can do a subclass and add a method to be able to call it.
  • Issue running Qt WebAssembly examples in Android WebView in Xamarin application

    Unsolved
    1
    0 Votes
    1 Posts
    201 Views
    No one has replied
  • NetShareEnum in Qt5core.dll?

    Unsolved
    14
    0 Votes
    14 Posts
    4k Views
    S
    THIS THE REAL SOLUTION Before installation: Uninstall the previous version before installing the new version! If you have Avid – Sibelius Ultimate 2019.4.1 build 1408 installed, be sure to manually delete this “netapi32.dll” file from the C:\Program Files\Avid\Sibelius\ folder, otherwise you will get an error when starting the new version “The entry point to the NetShareEnum procedure is not found in DLL C:\Program Files\Avid\Sibelius\Qt5Core.dll.”
  • What is the reason behind below crash of QT application ?

    Unsolved
    5
    0 Votes
    5 Posts
    377 Views
    Pl45m4P
    @Qt-embedded-developer said in What is the reason behind below crash of QT application ?: how to use downsampling into qcustomplot to reduce the datapoints ? It's not a Qt thing. It's mathematical (data science/signal processing). There are many algorithms/approaches possible. But from its crash strace i don't know which is the technical reson of crash of it ? The technical reason is "QTApp" received signal SIGSEGV, Segmentation fault. Why it happens, we can't tell.
  • QT Virtual Keyboard in QT Widget

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    Axel SpoerlA
    @aim0d I apologize, but I don't quite understand. The example mentioned here is QML, the application you mentioned is using widgets. Two different ball games. To launch the virtual keyboard when a QLineEdit is clicked or receives focus, the best thing is to intercept a suitable event, which would be QEvent::FocusIn, QEvent::MouseClick or QEvent::MouseButtonPress. That can be done by installing an event filter or subclassing QLineEdit and reimplementing e.g. focusInEvent. Calling QGuiApplication::inputMethod()->show() raises the virtual keyboard (and crashes if there is none, so better check before...). Connecting QLineEdit::textEdited to QGuiApplication::inputMethod()->hide() hides the virtual keyboard once the editing has been finished by pressing return and/or moving focus to another object.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Determine mouse press on dialog or child widget?

    Solved
    5
    0 Votes
    5 Posts
    368 Views
    T
    @JonB I tried the eventfilter approach. The problem with it is that it layouts and spacers receive input events as well, and its quite a lot of controls that I have to filter through. Is it possible to disable mouse input being sent to all layouts and spacers?
  • About Qt Virtual Keyboard

    Unsolved
    6
    0 Votes
    6 Posts
    788 Views
    A
    @SGaist I tried adding this line qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); and then a QML script for a only number keyboard, but how can I implement that everytime that i click on a QLineEdit it opens?
  • QWidget with QTabWidget

    Unsolved
    14
    0 Votes
    14 Posts
    1k Views
    M
    @JonB said in QWidget with QTabWidget: I have only used Qt on Linux. My impression was that it never auto-grows a top-level window, at least when you put more content into it, i.e. like the left-hand one. Since on linux, the length of the tab titles are not taken into account, the overall size of the tab widget reflects the widest element present in the tab pages. On mac, the minimum size of the tab widget depends of the length of the tab titles. Otherwise the tab titles are troncated with ellipsis, very ugly.
  • QStringLiteral: be or not to be!

    5
    0 Votes
    5 Posts
    5k Views
    R
    @rkhaotix As @ckakman said, QStringLiteral is encoded with utf-16, so QStringLiteral is very useful while dealing with non-english charset, such as Arabic charset or EastAsian chartset etc. In my case, I wanted to generate a QRcode Image with QByteArray, so I needed to transform my QString to QByteArray. some code like follows: QString eastAsiaString1 = "中文"; QString eastAsiaString2 = QStringLiteral("中文"); qDebug() << "eastAsiaString1:" << eastAsiaString1.toUtf8(); qDebug() << "eastAsiaString2:" << eastAsiaString2.toUtf8(); QImage image; QRcode* qr = QRcode_encodeString(eastAsiaString2.toUtf8(), 1, QR_ECLEVEL_Q, QR_MODE_8, 0); The results I got from the console: eastAsiaString1: "\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD\xEF\xBF\xBD" eastAsiaString2: "\xE4\xB8\xAD\xE6\x96\x87" eastAsianString1 was different from eastAsianString2, And the result transformed from eastAsianString2 was what I needed.