Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • 0 Votes
    2 Posts
    310 Views
    jsulmJ
    @vovery Please stop double posting! You already asked same question here: https://forum.qt.io/topic/146436/qt6-5-2-qt_creator-run-coffee-example-get-uncaught-runtimeerror-memory-access-out-of-bounds
  • File changed in QFileSystemWatcher is never triggered

    Solved
    6
    0 Votes
    6 Posts
    1k Views
    C
    @AkshayFP As the docs say, fileChanged() is triggered if path is not a directory. You cannot watch a file that does not exist. If you create or modify a file in a directory that is monitored then directoryChanged() is emitted. On Linux this looks like: /tmp/test$ cat main.cpp #include <QCoreApplication> #include <QDebug> #include <QFileSystemWatcher> int main(int argc, char **argv) { QCoreApplication app(argc, argv); QFileSystemWatcher w; w.addPath("/tmp/test"); QObject::connect(&w, &QFileSystemWatcher::fileChanged, &app, [](QString file){qDebug() << "file:" << file;}); QObject::connect(&w, &QFileSystemWatcher::directoryChanged, &app, [](QString file){qDebug() << "dir: " << file;}); return app.exec(); } /tmp/test$ make make: Nothing to be done for 'first'. /tmp/test$ ./test & [1] 4227 /tmp/test$ touch . # modify the directory directly dir: "/tmp/test" /tmp/test$ touch anewfile # new file in the directory dir: "/tmp/test" /tmp/test$ touch main.cpp # an existing file is modified dir: "/tmp/test" /tmp/test$ rm anewfile # delete the file we created dir: "/tmp/test" I imagine that Windows behaviour is the same.
  • Making desktop app with 2 sections "swipeable" on mobile app

    Solved
    3
    0 Votes
    3 Posts
    201 Views
    O
    @Pl45m4 OK, thanks for the pointers !
  • 0 Votes
    9 Posts
    2k Views
    SGaistS
    Unless you have a commercial license, the offline installer won't be available for recent versions of Qt.
  • stdafx not found - Qt and Visual Studio

    Solved
    2
    0 Votes
    2 Posts
    383 Views
    R
    I have solved it by following an answer found here: https://stackoverflow.com/questions/12434123/how-to-include-the-stdafx-h-from-the-root-directory Adding $(ProjectDir) to properties, it now compiles correctly.
  • QT stylesheet not getting applied randomly

    Unsolved
    2
    0 Votes
    2 Posts
    257 Views
    Chris KawaC
    Hi, welcome to the forum. Can anyone help to tell what could be the case How? "I made an app and it doesn't work like I want it to. Can someone tell me what's wrong" - is basically what you've given us. There's a bug in your app, that's all I can say. Please provide more information, like the code you use to apply the stylesheet. Where do you do it? Where does the stylesheet come from (file, resource, code)? Do you have any code that changes stylesheets after that? Do you set a stylesheet that could've overridden what you set? What does the stylesheet() method on the app return when it's not applied? What does it mean that it is "not fully applied"? Does it apply to some widgets and not others? If so what's different about them? Does it apply only some properties and not others? What are they? Do you have any branches in the code that applies the stylesheet? What have you already tried to diagnose the problem? What Qt version are you using? On which platform? Does it happen on your computer or others too? Are you able to cut your app down to have a minimal code example that exhibits this behavior?
  • how to make videos from images on Android?

    Unsolved
    3
    0 Votes
    3 Posts
    207 Views
    S
    @SGaist Well,I have found a way to make video with avilib on Android, thought it supports avi only.Anyway, thanks for your help. static bool makeAVIVideo(QStringList pathlist,QString filepath,int frame,QString encoder = "MJPG") { if(pathlist.size() <= 0 || !hasFilePermission(filepath) || frame <= 0) return false; avi_t* avi = AVI_open_output_file(QByteArray(filepath.toLocal8Bit()).data()); AVI_set_video(avi, QImage(pathlist.at(0)).width(), QImage(pathlist.at(0)).height(), frame, QByteArray(encoder.toLocal8Bit()).data()); for(int i = 0;i < pathlist.size();i++) { QFile* file = new QFile(pathlist.at(i)); if(file->exists() && file->open(QIODevice::ReadOnly)) { AVI_write_frame(avi,file->readAll().data(),file->size(),0); file->close(); } delete file; } AVI_close(avi); if(QFile::exists(filepath)) return true; else return false; }
  • Extracting the Qt Designer Gradient Editor

    Solved
    3
    0 Votes
    3 Posts
    333 Views
    R
    Thank you now it compiled correctly!
  • Changing QtabWidget tabbar color in paint event

    Unsolved qtabbar colors palette paintevent qtabwidget
    11
    0 Votes
    11 Posts
    2k Views
    SGaistS
    Hi, System styles such as those from Windows and macOS ignore certain hints and draw controls as expected for these platforms. Qt follows the platform user interface guidelines closely to ensure that applications looks as expected.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Styled background color of QScrollBar is tinted white

    Solved
    2
    0 Votes
    2 Posts
    366 Views
    M
    Nevermind I figured it out. I had to clear the background on ::add-page and ::sub-page: QScrollBar::add-page, QScrollBar::sub-page { background: none; }
  • "Cannot find file: mysql.pro" while building MySQL driver in Qt

    Solved
    34
    0 Votes
    34 Posts
    16k Views
    SGaistS
    @Saad02 there was an issue with the archive at some points and this version of Qt is available in a different subfolder. You seem to be following Qt 6 instructions to build for Qt 5. It won't work as Qt 6 is using cmake and Qt 5 is using qmake.
  • 0 Votes
    2 Posts
    255 Views
    Christian EhrlicherC
    Looks fine for me: See the documentation: "The function takes the data and salt, and then hashes it repeatedly for iterations iterations using the specified hash algorithm. If the resulting hash is longer than dkLen then it is truncated before it is returned." auto key1 = QByteArray::fromHex("04b72ee92a8850bfdbe7cf801348a6701d11931702dcecad52f0b3351bedd01c"); auto key2 = QByteArray::fromBase64("BLcu6SqIUL8="); auto key2Hex = key2 .toHex(); // --> 04b72ee92a8850bf = 8 bytes
  • Steps for moving a section from the bottom of the interface to the right?

    Moved Unsolved
    4
    0 Votes
    4 Posts
    319 Views
    Pl45m4P
    @Clone45 Maybe you what to have a look at QDockWidget. https://doc.qt.io/qt-6/qdockwidget.html#details
  • Porting QMacPasteboardMime derived class to Qt 6

    Unsolved
    8
    0 Votes
    8 Posts
    664 Views
    SGaistS
    You should also consider opening a ticket for improving the documentation, that would likely help speed things up in that area.
  • How include. Ui file qt chart??

    Unsolved
    1
    0 Votes
    1 Posts
    84 Views
    No one has replied
  • QtConcurrent::run for loading HTML page crashes app

    Unsolved qtconcurrency threading html
    4
    0 Votes
    4 Posts
    664 Views
    Christian EhrlicherC
    @MH24 I don't know but a thread will (when it would work) also not speed it up.
  • QTextDocument large distance between images

    Solved
    2
    0 Votes
    2 Posts
    179 Views
    M
    @Mihaill If I merge 2 pictures into one, and add one picture, then it works fine
  • 0 Votes
    7 Posts
    3k Views
    D
    @Flashcap20 said in Make scroll area fit added widgets horizontally, but have a vertical scrollbar if needed: Re: [Make scroll area fit added widgets horizontally](but have a vertical scrollbar if needed) Thank you, that was a great tip. I managed to do it by setting the following: I set both scrollArea_subclips and scrollArea_subclipsContent's Size Policy to Preferred for both Horizontal and Vertical. Then set the custom widget's (multiple of which is added to scrollArea_subclipsContent) Size Policy to Preferred for Horizontal and Maximum for Vertical. Also set the left and right margins of my custom widget to 10 instead of 5, just to make sure the widget is not touching the scrollbar once it appears. Any chance you can drop a snippet or something? I'm not quite sure what scrollArea_subclips is :/ I want to do the same scroll logic as you do. Thanks!
  • Qt 6.5.1 Virtual Keyboard does not show

    Solved
    2
    0 Votes
    2 Posts
    730 Views
    P
    Determined this issue to be my import statement in my qml file for keyboard style. I was including the version which was no available in 6.5.1 I had this: import QtQuick 2.1 import QtQuick.VirtualKeyboard 2.7 import QtQuick.VirtualKeyboard.Styles 2.3 and by dropping the version in my style.qml file i got it show import QtQuick import QtQuick.VirtualKeyboard import QtQuick.VirtualKeyboard.Styles