Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.5k Posts
  • Recognize windows sound

    Unsolved
    6
    0 Votes
    6 Posts
    462 Views
    SGaistS
    You'll have to monitor the audio stream continuously until you get a sample that matches your reference closely enough.
  • Qt5.12.9: Example:OpenGL/Cube doesnt work

    Solved
    24
    0 Votes
    24 Posts
    2k Views
    D
    @SGaist Yes, I think I was a little bit too fast with editing my old post. I really thank you for helping me!
  • How to deploy Qt application with external libraries

    Unsolved
    9
    0 Votes
    9 Posts
    782 Views
    J
    essentially the message being sent is built up as: [length of opcode (in bytes)] - [length of message (in byes)] - [opcode] - [message] where each section above is a utf-8 encoded strings. My original python code was: HEADER = 256 #header length(bytes) OPCODE = 4 PORT = #####REDACTED_FOR_PRIVACY##### FORMAT = 'utf-8' DISCONNECT_MESSAGE = "!DISCONNECT" SERVER = #####REDACTED_FOR_PRIVACY##### ADDR = (SERVER, PORT) class Opcode (str, Enum): WEEK: str = "1" EMAIL: str = "2" COMPETITION_DURATION: str = "3" SPOTIFY: str = "5" SUBMISSION_DURATION: str = "6" RANKING_DURATION: str = "7" DISCONNECT: str = "8" NEW_PLAYLIST: str = "9" NUM_PARTICIPANTS: str = "10" NAME_QUESTION: str = "11" BONUS_QUESTION: str = "12" def connect_to_server(): global client client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect(ADDR) def send(opcode, msg): message= msg.encode(FORMAT) #convert the message to byte format op = opcode.encode(FORMAT) msg_length = len(message) #length of message msg_send_length = str(msg_length).encode(FORMAT) #convert the length of the message to byte format op_length = len(op) op_send_length = str(op_length).encode(FORMAT) # Pad out the length to 64 bytes and the opcode to 4 bytes msg_send_length += b' ' * (HEADER - len(msg_send_length)) op_send_length += b' ' * (OPCODE - len(op_send_length)) client.send(msg_send_length) client.send(op_send_length) client.send(op) client.send(message) return client.recv(2048).decode(FORMAT) send(Opcode.EMAIL, "example@gmail.com") send(Opcode.WEEK, "12") send(Opcode.COMPETITION_DURATION, "7") send(Opcode.SPOTIFY, "https://open.spotify.com/playlist/cyt67ryic657bi")
  • Use of several QCombobox that work together

    Unsolved
    8
    0 Votes
    8 Posts
    642 Views
    SGaistS
    It's going to depend on the solution you choose.
  • Problem with two stage painting

    Unsolved
    5
    0 Votes
    5 Posts
    403 Views
    SGaistS
    That's for your widget which your pixmap has no relation with technically speaking. Personally I am used to explicitly setup the painter so it's not something that "shocks" me.
  • Display tooltip on submenu

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    JonBJ
    @volsa said in Display tooltip on submenu: @JonB Isn't that exactly the opposite, namely show tooltips on QActions? I thought because the code has if (helpEvent->type() == QEvent::ToolTip && activeAction() != 0) you would try it with && activeAction() == 0 to see if that was your situation. However, this is now moot, because @Bonnie obviously has the right answer.
  • Setting Up Qt Creator for MPIC++

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    ModelTechM
    Ok, that is a good idea. What I find strange however is that the g++ linker command on my workstation now actually shows two times "-L/usr/lib/x86_64-linux-gnu/openmpi/lib -lmpi_cxx -lmpi" and I do not see why that is needed. This is the shown message: g++ -pthread -L/usr//lib -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lmpi_cxx -lmpi -Wl,-rpath,/home/user/Qt/5.12.5/gcc_64/lib -o mpi main.o -L/usr/lib/x86_64-linux-gnu/openmpi/lib -lmpi_cxx -lmpi /home/user/Qt/5.12.5/gcc_64/lib/libQt5Gui.so /home/user/Qt/5.12.5/gcc_64/lib/libQt5Core.so -lGL -lpthread
  • Weird characters in file path

    Unsolved
    11
    0 Votes
    11 Posts
    1k Views
    S
    Wow, if I use F11 to jump into the code, I get the sequence Q_REQUIRED_RESULT QByteArray toUtf8() const & { return toUtf8_helper(*this); } QByteArray QString::toUtf8_helper(const QString &str) { return qt_convert_to_utf8(str); } inline int size() const { return d->size; } template <typename String, if_compatible_qstring_like<String> = true> QStringView(const String &str) noexcept : QStringView(str.isNull() ? nullptr : str.data(), qsizetype(str.size())) {} static QByteArray qt_convert_to_utf8(QStringView str) { if (str.isNull()) return QByteArray(); return QUtf8::convertFromUnicode(str.data(), str.length()); } and so on. I guess I am a little behind the times. I'm not sure what all the reinterpret_cast and const_cast was about. This is some fancy coding :) I thought pqString.toUtf8() is suppose to return UTF-8 which should contain my path to the file /home/john/bla bla and I could just pass that to fopen(). isn't UTF-8, the first 0 to 127 values encoded just like ASCII? In other words, a array that contains /home/john/bla bla whether encoded in UTF-8 or ASCII, they would be exactly identical.
  • QToolBar not using QIcon::Mode

    Solved
    5
    0 Votes
    5 Posts
    320 Views
    PerdrixP
    Yes indeed. Once I'd corrected an error in the name of the Active bitmap it works for me too!! Thanks a lot! David
  • "coding " slots and signals in QtCreator

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    A
    SOLVED user error - RTFM
  • The inferior stopped because it received a signal from the operating system

    Unsolved
    2
    0 Votes
    2 Posts
    2k Views
    Pl45m4P
    @terrysweqwe said in The inferior stopped because it received a signal from the operating system: when I click PushButton second time the program will stop and show these two error: The program has unexpectedly finished. The process was ended forcefully. Some people say it's because Py_Initialize(); and Py_Finalize(); only can run one time Are you sure, that finalize() is done, when clicking your button a second time? Because it will definitely crash, if some stuff is still running and you press that button a second time. Why do you use Qt / C++, when you pass your C++ controls to Python? Why don't you use PyQt directly, so you can create your GUI and everything else with Python code? In addition, you can use every additional Python module. So you don't have to worry about any handlers or script calls that might fail.
  • 0 Votes
    4 Posts
    299 Views
    H
    @Bonnie said in QAudioDeviceInfo::availableDevices(QAudio::Mode::AudioInput) returning output devices: Are you talking about those "alsa_output......monitor" devices? Those are not output devices. They are monitor sources that can use whatever comes from the output as input, something like "What-U-Hear" or "Stereo Mix" in Windows. Sorry for not being clear. That was I was wondering about. Thanks.
  • What is type of gui.currentPageWidget() ?

    Unsolved
    4
    0 Votes
    4 Posts
    273 Views
    N
    @JonB Thank you. I missed it.
  • Trying to make Toolbar Corners curved, and make it semi-tranparent.

    Unsolved
    3
    0 Votes
    3 Posts
    351 Views
    PerdrixP
    A good thought and a bug well spotted! But sadly makes no difference: What I want is for the toolbar to look like this: [image: c59d3237-3629-415f-9248-44bba0dc138f.png] But what I'm getting is this: [image: d88fd04e-d184-4e95-8a8d-ad4d76afdc00.png] Thanks, David
  • Restrict user to change value of a Qradiobutton

    Unsolved
    2
    0 Votes
    2 Posts
    201 Views
    Chris KawaC
    The easiest would be to disable it i.e. setDisabled(true). By default this grays it out, but since you're customizing the look anyway you might as well do it like that.
  • QSerialPort, communicating through RS485

    rs485 qserialport
    17
    0 Votes
    17 Posts
    19k Views
    E
    @joaopagotto http://www.simcore.com.br/downloads/QtForum/53877/ this link is not available
  • Is it possible with QT Installer framework?

    Unsolved
    2
    0 Votes
    2 Posts
    348 Views
    J.HilkJ
    Hi @narae the Qt InstallerFramework is not a very widely used Framework in the community. From what you show so far, you're most likely one of the most knowledgeable person on this forum about it. I doubt you will find any normal user that can help in your partial situation. The only thing that comes to my mind, if you'r not a commercial license owner, is posting on the mailing list https://lists.qt-project.org There are more developer active than on this forum, and one may be able to help you more
  • Inconsistent QHostAddress behavior

    Unsolved
    1
    0 Votes
    1 Posts
    151 Views
    No one has replied
  • [SOLVED] How to set an item in a QTreeView as selected?

    9
    0 Votes
    9 Posts
    47k Views
    jsulmJ
    @QtTester What about https://doc.qt.io/qt-5/qtreewidget.html#setCurrentItem ?
  • Generate xml file with encoding "UCS-2 LE BOM"?

    Solved
    7
    0 Votes
    7 Posts
    2k Views
    A
    I have found the solution. When using QTextStream, use setGenerateByteOrderMark(true) and codec to "UTF-16LE", the output will then show as "UCS-2 LE BOM".