Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.5k Posts
  • QUdpSocket: has no more pending datagrams

    Solved
    11
    0 Votes
    11 Posts
    2k Views
    A
    Hello, hello, I have tried to manage the audio stream with another library (ASIO) and the result is the same as I got with QtNetwork. I conclude the problem comes from the device, not from the software I develop. Sorry for wasting your time and thank you for trying to help me...
  • use color scheme in qtextedit

    Solved
    4
    0 Votes
    4 Posts
    556 Views
    raven-worxR
    @saber see the Syntaxhighlighter example I am not aware of any predefined schemes though. But since QtCreator is open-source you may want to check it's source.
  • PySide2 without drivers QSql

    Unsolved
    3
    0 Votes
    3 Posts
    399 Views
    A
    I`m install using anaconda conda install -c conda-forge pyside2
  • How can I set the vertical spacing between widgets / layouts in a main window?

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    jsulmJ
    @Guerrian Since you're using designer you can do this there. Select the central widget and go to "Layout" part - you will see many *Margin entries there, change them as needed.
  • QTableView and Image

    Unsolved
    16
    0 Votes
    16 Posts
    5k Views
    M
    @hjohn I came across this , maybe it could be helpful.
  • QAction, QToolButton, QToolBar & drag n drop

    Unsolved
    2
    0 Votes
    2 Posts
    1k Views
    D
    Bump bump bump help :- )
  • Execute program on raspbian from GUI

    Unsolved
    2
    0 Votes
    2 Posts
    354 Views
    sierdzioS
    Is your gui application going to work on the same machine as the program you want to run? If that's the case, then your can run that program using either QProcess or openUrl(). If, however, your gui app will be executed on different machine, then you need to communicate with your raspbery pi, for example using QtNetwork module, or QtRemoteObjects module.
  • Minimizing (hiding) top window (e.g. QDialog) without affecting the main window

    Solved
    2
    0 Votes
    2 Posts
    680 Views
    deisikD
    Okay, it seems that I was able to get what I wanted by creating the top window without a parent and setting a Qt::WindowStaysOnTopHint flag on it Problem solved
  • Change color of QProgressBar.

    Solved
    6
    0 Votes
    6 Posts
    3k Views
    A
    @raven-worx said in Change color of QProgressBar.: s no cross platform way to change the color of a progressbar via QPalette, only via stylesheets Thanks, I will check with setStyleSheet only.
  • Deep copy of QTabWidget pages advise/workaround?

    Unsolved
    3
    0 Votes
    3 Posts
    754 Views
    jsulmJ
    @TonyB123 Simply create so many of your widgets as you need, there is no need for deep copy. C++ version: MyWidget *widget1 = new MyWidget(this); MyWidget *widget2 = new MyWidget(this); ...
  • Proper way to open a QDialog

    Solved
    6
    0 Votes
    6 Posts
    3k Views
    C
    SGaist, yes this approach is even better. It solved problem with dialog centering (alignment relative to parent) and initial dialog 'active' status. I wouldn't come up with '0' argument in a lifetime. I thought about very small numbers but not '0'. :) I guess '0' works because (if I recall) timer events are processed in event loop only when there are no other events (in win32 at least). void WMain::showEvent(QShowEvent *event) { QMainWindow::showEvent(event); QTimer::singleShot(0, [this]() { WNew window(this); window.exec(); }); }
  • Call PaintEvent in for loop

    Solved
    10
    0 Votes
    10 Posts
    2k Views
    T
    @Asperamanca thank you ..yes exactly this is what I did this helps for purpose of testing of course ty
  • QSqlDatabase connection issue

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    Cobra91151C
    @SGaist I have added setConnectOptions("MYSQL_OPT_RECONNECT=TRUE"); and now it automatically reconnects. Thanks.
  • Porting from QT4.6 to QT5

    Unsolved
    44
    0 Votes
    44 Posts
    15k Views
    M
    setStyle(QStyleFactory::create("Fusion")); // without new For me (OSX), it works only with QApplication, not with QWidget
  • How to use QDomDocument to change the svg attribute?

    Solved
    2
    0 Votes
    2 Posts
    1k Views
    mrjjM
    Hi text tag is inside svg tag and the 10 text is actually inside a text element. void change() { QDomElement root = m_domDoc.firstChildElement(); qDebug() << "root=" << root.tagName(); QDomNodeList text = root.elementsByTagName("text"); if (text.size() && text.at(0).isElement() ) { QDomElement elem = text.at(0).toElement(); qDebug() << "text value " << elem.nodeValue(); qDebug() << " text child" << elem.childNodes().at(0).nodeValue() << "type " << elem.childNodes().at(0).nodeName() ; elem.childNodes().at(0).setNodeValue("60"); // change it } output root= "svg" text value "" text child "10" type "#text"
  • 0 Votes
    8 Posts
    3k Views
    mrjjM
    Hi You are mixing old syntax with lambda which it cannot do. With lambdas you cannot use the SIGNAL() macro. Has to be the new syntax. I used QObject::connect(&but_submit, &QPushButton::clicked, [&]() {... which compiled fine and did show the entered string. But you seems to be using Qt-4.8.5 at and new syntax first came in Qt5 so i guess that is why you get errors. So basically, with that old Qt , you cannot do it in main. You need a QOBJECT based object to send signals to. In that old Qt, its not possible to connect to functions. Only to member slots in a class. You must use that so old Qt ?
  • Is it possible to secure software so that limitations can't be hacked?

    Solved
    4
    0 Votes
    4 Posts
    608 Views
    kshegunovK
    "Security" through obfuscation is as useful as a fish has need for a bicycle. A half-decent c/c++ programmer should already know enough to dissasemble the code, run it through the debugger, break at the system calls (like reading a resource file, or opening a window) and with minimal effort trace it back to that particular conditional jump. Changing the conditional jump to an unconditional then is a matter of seconds. Even the more sophisticated systems that do in-memory loading and decoding of binaries can be broken by a decent programmer in a couple of days to a week. Don't forget the code is already there, the difference from what you wrote is that it's just assembly. The commercial products and versions are tracked by the crackers, that's why you get the latest software cracked basically the day after it was released.
  • Detect connection of certain bluetooth device

    Unsolved
    6
    1 Votes
    6 Posts
    2k Views
    M
    @Gojir4 Thanks for answer, sadly still no services discovered and errorString is empty, no error is emitted through error signal. But I think it is because my device (and all available bluetooth devices in range) are Low Energy as documentation says: The service discovery may find Bluetooth Low Energy services too if the target device is a combination of a classic and Low Energy device. Those devices are required to advertise their Low Energy services via SDP. If the target device only supports Bluetooth Low Energy services, it is likely to not advertise them via SDP. The QLowEnergyController class should be utilized to perform the service discovery on Low Energy devices. But it seems to me, that getting QLowEnergyController of already connected device is not possible. So how am I supposed to do that?
  • Can't connect to remote MySQL instance

    Unsolved mysql connect remote qt5.10 lost connection
    14
    0 Votes
    14 Posts
    5k Views
    SGaistS
    I may have misunderstood the case that doesn’t work. Can you maybe do a small picture with the setup ?
  • How to assign an icon to a file type of a Qt program using the installscript file

    Unsolved
    18
    0 Votes
    18 Posts
    6k Views
    Pranit PatilP
    @tomy Can you share full process bz im facing same problem. Thank You