Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Setting the value of a user defined property

    Solved
    9
    0 Votes
    9 Posts
    2k Views
    J.HilkJ
    @ofmrew hey, I'm glad you made it work. One more question: Why the inline for tval()? Well,... habid. I believe a function defined entirely inside a class is implicitly an inline function.
  • Any insights into the effect Chromium moving to clang will have on Qt downstream?

    Unsolved
    2
    0 Votes
    2 Posts
    374 Views
    JKSHJ
    @VRHans Do you mean on Windows? Chromium has been using Clang for Linux and macOS for many years now: https://www.phoronix.com/scan.php?page=news_item&px=MTg0MTk On Windows, the switch from MSVC to Clang happened 8 months ago: https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/Y3OEIKkdlu0 I'm not sure what it means for Qt. It would be nice if there's an easy way for Clang to produce binaries that are compatible with GCC -- then we could get Qt WebEngine for MinGW compilers too. In broader terms, Clang for Chromium might be an extra motivator for the Qt Project to make Clang/LLVM a Tier 1 toolchain on Windows. However, this would require dropping a at least one version of MSVC or even MinGW, so I doubt we will see this in the near future.
  • QUrl methods

    Unsolved
    2
    0 Votes
    2 Posts
    416 Views
    SGaistS
    Hi, Because the first one has been obsoleted and QUrlQuery should be used and the second one has also been obsoleted and should be replaced by query(QUrl::FullyEncoded).toLatin1().
  • QWidget PaintEvent CompositionMode "masking" issue

    Solved
    3
    0 Votes
    3 Posts
    866 Views
    SGaistS
    Hi, Depending on what you need, you can draw on a QImage and then draw that image in your custom widget. What is it that you want to achieve ?
  • QTextToSpeech utterance listener

    Unsolved
    4
    0 Votes
    4 Posts
    940 Views
    SGaistS
    Hi, Can you share your code ? What about the stack trace ?
  • [SOLVED]FMOD does not play a sound from qresource?

    10
    1 Votes
    10 Posts
    4k Views
    L
    For anyone else stuck here. I give you the gift of working code. m_system is a pointer to the FMOD system m_sound is a pointer to the FMOD sound void Sound::createSoundFromResource(std::string filePath) { // get the file based on the path QFile resourceFile(QString::fromStdString(filePath)); Q_ASSERT_X(resourceFile.exists(), "createSoundFromResource", "the filepath does not exist"); // open the file and read all the data from it if (resourceFile.open(QIODevice::ReadOnly)) { auto data = resourceFile.readAll(); // set metadata about the file so FMOD can read it FMOD_CREATESOUNDEXINFO* exinfo = new FMOD_CREATESOUNDEXINFO(); exinfo->length = static_cast<unsigned int>(data.length()); exinfo->cbsize = sizeof(FMOD_CREATESOUNDEXINFO); // the unmentioned line which was killing me auto result = FMOD_System_CreateSound(m_system, data.data(), FMOD_OPENMEMORY, exinfo, &m_sound); SoundWrapper::CheckError(result); } else { Q_ASSERT_X(false, "createSoundFromResource", "opening the files failed"); } }
  • Size of text in Widgets

    Solved
    2
    0 Votes
    2 Posts
    376 Views
    SGaistS
    Hi, QApplication::setFont comes to mind for that.
  • QLabel not loading image after changing computers

    Unsolved qlabel qwidget qicon
    6
    0 Votes
    6 Posts
    2k Views
    SGaistS
    Hi, What do you mean by regular string ? If it comes from the Windows API, you should then consider using QDir:: fromNativeSeparators.
  • Very strange bug with Qt-MinGW32 using x264 and FFmpeg libraries

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    SGaistS
    What is the stack trace of the crash ?
  • QSqlDatabase with MYSQL management in the app

    Solved
    22
    0 Votes
    22 Posts
    5k Views
    SGaistS
    The correct way is described in the documentation of the function: void someFunction() { { QSqlDatabase db = QSqlDatabase::database("sales"); QSqlQuery query("SELECT NAME, DOB FROM EMPLOYEES", db); } // Both "db" and "query" are destroyed because they are out of scope QSqlDatabase::removeDatabase("sales"); // correct }
  • Modbus timeout errors with Modbus Master (Client)

    Solved
    5
    0 Votes
    5 Posts
    3k Views
    J
    Thank you guys. For now I solved it with semaphore, and a queue to which I am putting all the variables, which gonna be sent. This is not the nicest design, but it works as it should. Maybe I will try to do it with local QEventLoop as you recommended @beecksche, when I will get more understanding of it. For now, problem solved :)
  • Investigating a segmentation fault running minimal-qml (wayland compositor example)

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

    Unsolved
    1
    0 Votes
    1 Posts
    16 Views
    No one has replied
  • How to manage Qt installation components?

    Solved
    2
    0 Votes
    2 Posts
    430 Views
    raven-worxR
    @Qt_crazyer Just run the Qt Maintenance tool again and select the missing components. Then add the kits to QtCreator (in the Options screen)
  • Can't remove widget from layout

    Solved
    3
    0 Votes
    3 Posts
    760 Views
    raven-worxR
    @El3ctroGh0st said in Can't remove widget from layout: for some reason it doesn't remove it from the layout on what test is your assumption based? I guess you are confused that you still see it in the parent widget? After removing the widget from the layout it is still a child of the parent widget (as also stated in the docs) So you either need to hide it and/or give it a new parent widget. If you want to show the widget again, you do not need to remove it from the layout, but just toggle it's visibility (show()/hide()).
  • Slowness cv2

    Unsolved
    2
    0 Votes
    2 Posts
    404 Views
    SGaistS
    Hi, First post your PyQt5 version, Qt version and OpenCV version. The show the code you are using, the video specification. Explain exactly what your application does while the video is playing. Try the same using OpenCV's highgui library to see if the bottleneck's also there.
  • Linking against DLL and calling function in DLL at run-time

    Solved
    11
    0 Votes
    11 Posts
    6k Views
    kahlenbergK
    I solved the problem. The problem was, I was using wrong library file :). I used library file (.lib) in dll/ directory not in lib/ directory. It worked. Maybe I can update wiki at the end of https://wiki.qt.io/How_to_link_to_a_dll . @jsulm No, I downloded them from microchip website. Thanks for all answers.
  • QListView prefilled with items on call?

    Unsolved
    10
    0 Votes
    10 Posts
    2k Views
    J.HilkJ
    @becht hi, first of you shouldn't modify the ui.h file. that one is generated on the fly each time you hit qmake!!! For your class/struct you simply create it like any other cpp class and whereever you want to use it you include the header file. That could be your main.cpp or any other class. If your class does not have any UI-elements but you want to use Qt's MetaOjectSystem and/or use Signal and Slot let your calss inherit from QObject. If your calss describes a part of your UI and you want to display it directly than inherit - generally speaking - from QWidget. For a simple Data/Property storage, create a normal cpp class or use a struct - its quit litteraly the same. Do decide what you should use, really depends on how you want to display and interact with the data.
  • Cannot read GL_DEPTH_COMPONENT using QOpenGLWidget

    Solved
    2
    0 Votes
    2 Posts
    475 Views
    A
    The issue is solved. See https://www.opengl.org/discussion_boards/showthread.php/200495-Cannot-read-GL_DEPTH_COMPONENT-using-QOpenGLWidget-outside-of-paintGL()-function?p=1290643#post1290643 for explanations
  • 0 Votes
    9 Posts
    2k Views
    G
    Problem solved. Since windows 10 sole user is the administrator, he has write access everywhere. Simply changing permission of the C:\Qt\Examples directory solved the problem. Please remove write access for administrator and any user on that drectory.