Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.5k Topics 457.3k Posts
  • File Mapping? How can I do it using Qt?

    Solved
    3
    0 Votes
    3 Posts
    3k Views
    F
    @sgaist thank you!
  • QScrollArea and transparent scroll bar

    Solved qscrollarea qscrollbar qt5
    3
    0 Votes
    3 Posts
    1k Views
    AlairionA
    Hi, thanks you for answer. The scroll area in my application is inside another widget, the main window, and it has an illustrated background. The problem is for main window not the content of the scroll area. Anyway, I found a workaround, I set the same background for the main window and the scroll bar, so the scroll bar is opaque but looks transparent. I still wonder why is there this strange behaviour with the scroll bar, but this topic can be considered as solved as I found a way to get around this.
  • Loading JavaScript file from ressources for own WebServer

    Unsolved
    5
    0 Votes
    5 Posts
    356 Views
    fcarneyF
    Well, the resource system does not treat the files any different: #include <QCoreApplication> #include <QFile> #include <QDebug> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QFile html(":/html/index.html"); QFile jquery(":/html/jquery.js"); qInfo() << "html.size" << html.size(); qInfo() << "jquery.size" << jquery.size(); return a.exec(); } However, I did this as a console app. Cannot imagine other types of Qt projects would treat any different. The data I put in each file: jquery.js index.html
  • Differences between qputenv() and specifying env variables in kit

    Solved
    10
    0 Votes
    10 Posts
    3k Views
    Pablo J. RoginaP
    @circuits said in Differences between qputenv() and specifying env variables in kit: now I want to pull them out of main.cpp and specify them in my kit so I set the base enviorment to "System Enviorment" Are you aware that by removing the code from main.cpp you'll need to setup such environment variables yourself if when running your application on its own
  • Qt Plugin function of metadata

    Solved
    4
    0 Votes
    4 Posts
    922 Views
    Gojir4G
    @leon_2001 I never used JSON scheme so I don't know about this point. But depending of the number of the fields in your file, it should not be so difficult to check the format "manually" using Qt JSON api. You could maybe generate the JSON file at compilation. The choice of the method (json + pure virtual, json only, pure virtual only...) is up to you and what you need for your final application.
  • Windows file explorer style window

    Solved
    6
    0 Votes
    6 Posts
    2k Views
    mrjjM
    Hi Super. it looks nice. Please post mark as solved if possible.
  • QByteRef missing documentation

    Unsolved
    2
    2 Votes
    2 Posts
    642 Views
    JKSHJ
    @psnarf said in QByteRef missing documentation: Just a heads-up. QByteRef on https://doc.qt.io/qt-5/classes.html points to https://doc.qt.io/qt-5/qbyteref.html, which does not yet exist. Lots of dangling references in the QByterArray doc. qbytearray.h defines a class QByteRef containing a QByteArray& and an int, so it does indeed exist. Just missing the documentation. Thanks for the heads-up. It looks like previous versions of Qt did not create links (e.g. https://doc.qt.io/qt-5.12/qbytearray.html#back-1 ), but Qt 5.13 now creates dangling links. Could you please submit a report to https://bugreports.qt.io/ ?
  • Configuration of emscripten compiler on Windows

    Unsolved
    2
    0 Votes
    2 Posts
    676 Views
    lorn.potterL
    I tried this on windows and it seems QtCreator will not accept wasm-emscripten mkspec at the kit level. But the QtCreator preview does.
  • How to add decorations (i.e. an icon) to tree view items?

    Solved
    3
    0 Votes
    3 Posts
    2k Views
    R
    @christian-ehrlicher : Thank you ... I needed to add just one line of code to the function which sets up the data in the tree model ... now it is working properly!
  • This topic is deleted!

    Unsolved
    7
    0 Votes
    7 Posts
    37 Views
  • MySQL driver on Windows 10

    Unsolved
    5
    0 Votes
    5 Posts
    910 Views
    SGaistS
    You have to update the example given in the documentation to match what you have on your system.
  • How to override a function QGraphicsScene::items()

    Solved
    15
    0 Votes
    15 Posts
    1k Views
    M
    Added elements in vector and so was able to to them turn.
  • Sort HSL colors

    Unsolved
    3
    0 Votes
    3 Posts
    692 Views
    T
    Hello thanks for your reply. I alreay use this function for sort the QVector<QColor> but the result is not very good. The best result is this comparaison : int compare(const QColor &a, const QColor &b) { return a.rgb() < b.rgb(); } I wrote this code, but the colors the sort does not give a result does not give a gradient. int compare(const QColor &a, const QColor &b) { if(a.hue() == b.hue()) { if(a.saturation() == b.saturation()) { return (a.lightness() <= b.lightness()); } return (a.saturation() <= b.saturation()); } return (a.hue() < b.hue()); }
  • Multiple qRegisterMetaType<T>() result in Binary compatibility break.

    Unsolved
    6
    0 Votes
    6 Posts
    2k Views
    J
    I finally found the trick. Write my own macro that doesn't blindly call qRegisterMetaType #define MYAXTYPE(Class) \ factory = new MyAxType<Class>(typeLibID().toString(), appID().toString()); \ if( !QMetaType::isRegistered(QMetaType::type(#Class"*")) ) \ qRegisterMetaType<Class*>(#Class"*"); \ keys = factory->featureList(); \ for (it = keys.begin(); it != keys.end(); ++it) { \ factoryKeys += *it; \ factories.insert(*it, factory); \ creatable.insert(*it, false); \ }\
  • Use python generated code to display widget

    Unsolved
    3
    0 Votes
    3 Posts
    248 Views
    2
    Finally I solved my problem. In the same directory I created another python file with the following code: MyPyQt.py -- coding: utf-8 -- pylint: disable=missing-docstring pylint: disable=no-name-in-module import sys from PyQt5.QtWidgets import QApplication, QWidget from rgb_controller import Ui_Form app = QApplication(sys.argv) window = QWidget() ui = Ui_Form() ui.setupUi(window) window.show() sys.exit(app.exec_()) When I run the code, the widget appears on screen
  • Scrollbar width is excluded from QListView while preparing grid layout.

    Unsolved qlistview
    1
    0 Votes
    1 Posts
    488 Views
    No one has replied
  • Stop download with QNetworkReply

    Solved qnetworkreply
    20
    0 Votes
    20 Posts
    6k Views
    S
    In my case, disconnecting all signals relating to QNetworkReply from all slots causes to abort() not works. disconnect(m_reply, nullptr, nullptr, nullptr); abort function works normal after commenting this line.
  • 0 Votes
    11 Posts
    7k Views
    JKSHJ
    @goddard said in Qt5.11 VS17 "Object reference not set to an instance of an object" issue: I have this issue as well and nothing works. Just trying to import an existing project. Go to Extensions > Qt VS Tools > Qt Options, and add a valid Qt Version. See https://bugreports.qt.io/browse/QTVSADDINBUG-647
  • QT TcpServer detecting input and correctly replying

    Solved qtcpserver qt5 qtcreator
    8
    0 Votes
    8 Posts
    2k Views
    Christian EhrlicherC
    As @SGaist pointed out you don't fill _sockets anywhere and as I pointed out you don't need to search the socket in _sockets at all since you already cast QObject::sender() to the correct QTcpSocket although qobject_cast or dynamic_cast should be used instead static_cast
  • Can someone reassure me about stdio in a PyQt5 application?

    Unsolved
    1
    0 Votes
    1 Posts
    146 Views
    No one has replied