Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • Build Qt Static Make Error - [SOLVED]

    18
    0 Votes
    18 Posts
    32k Views
    D
    @Mihir i think problem is in your gcc version. i also had that problem and i change my gcc version to gcc 9.5.0 sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa -y sudo apt install g++-9 gcc-9 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 80 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9 sudo update-alternatives --config gcc and try again with configuration
  • How to display my String or Qstring in QLabel using button?

    Unsolved
    2
    0 Votes
    2 Posts
    179 Views
    jsulmJ
    @JacobNovitsky Well, connect a slot to https://doc.qt.io/qt-6/qabstractbutton.html#clicked and in that slot set the string in QLabel using https://doc.qt.io/qt-6/qlabel.html#text-prop
  • QOpcUa: inspecting the cause of a connection error

    Unsolved
    1
    0 Votes
    1 Posts
    116 Views
    No one has replied
  • Unexpected blank line before QTextFrame

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

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Pagination of a QTextDocument

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

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Q_ARG return type in Qt 6.5

    Unsolved
    4
    0 Votes
    4 Posts
    685 Views
    M
    I reviewed the old code and added the following definition: #define Q_ARG_OLD(type, data) QArgument<type >(#type, data)
  • How to include my project B with Project A

    Unsolved
    2
    0 Votes
    2 Posts
    150 Views
    jsulmJ
    @JacobNovitsky said in How to include my project B with Project A: I believe I need to make some kind of Library? Yes, you can make the project you want to include a library. Or you can simply add the code of that project to your other project. It really depends what you want/need. See https://doc.qt.io/qt-6/sharedlibrary.html for shared libraries.
  • How to add a text label with every shape I draw using QPainter

    Unsolved
    11
    0 Votes
    11 Posts
    2k Views
    W
    Thank you so much for sharing your answer it was very helpful to me again.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    59 Views
    No one has replied
  • liniking in macOS to precompiled libraries ERROR

    Solved
    5
    0 Votes
    5 Posts
    642 Views
    MesrineM
    @hskoglund Actually in the linker message, one can see they are .so and Mac use .dylib.
  • How to call secondary window from MainWindow class function

    Unsolved
    2
    0 Votes
    2 Posts
    148 Views
    M
    @JacobNovitsky void MainWindow::on_pushButton_clicked() { QuickPaste* quickpaste=new QuickPaste(); quickPaste->setAttribute(Qt::WA_DeleteOnClose); quickpaste->show(); }
  • inherited from QWidget class does not render

    Unsolved
    4
    0 Votes
    4 Posts
    319 Views
    SGaistS
    It's a tricky one. Since you added the Q_OBJECT macro to your subclass, you need to re-implement the paintEvent method to render your widget with style sheet support. #ifndef MATRIZ_H #define MATRIZ_H #include <QWidget> class QHBoxLayout; class Matriz : public QWidget{ Q_OBJECT private: QHBoxLayout* lay {nullptr}; public: explicit Matriz(QWidget* parent = nullptr); virtual ~Matriz() = default; void paintEvent(QPaintEvent *paintEvent) override; }; #endif #include "matriz.h" #include <QHBoxLayout> #include <QPainter> #include <QStyle> #include <QStyleOption> Matriz::Matriz(QWidget* parent) : QWidget(parent){ lay = new QHBoxLayout; setLayout(lay); //apply layout to this widget } void Matriz::paintEvent(QPaintEvent *paintEvent) { Q_UNUSED(paintEvent); QStyleOption option; option.initFrom(this); QPainter painter(this); style()->drawPrimitive(QStyle::PE_Widget, &option, &painter, this); }; On a side note, next time you post code, ensure that it properly builds.
  • This topic is deleted!

    Unsolved
    4
    0 Votes
    4 Posts
    20 Views
  • Problem with DPI and QIcon

    Unsolved
    4
    0 Votes
    4 Posts
    409 Views
    Christian EhrlicherC
    @Kattia said in Problem with DPI and QIcon: what rect the QPainter path rect? The one you pass to QIcon::paint() and how do you multiply a rect? only its width/height? rect().size() * devicePixelRatio()
  • StyleSheet - disable coloring of selected text

    Solved
    3
    0 Votes
    3 Posts
    834 Views
    C
    Not specifying selection-color made the text invisible for me so I had to set it to the same color as color: QSpinBox { color: white; selection-background-color: transparent; selection-color: white; } I didn't have to set any stylesheet for the QSpinBox's QLineEdit.
  • MacOS: Program built, but can't find Qt5 framework

    Unsolved
    3
    0 Votes
    3 Posts
    794 Views
    R
    @jsulm Thanks!
  • The binary 'C:/Program Files (x86)/QT Designer/bin\assistant.exe' does not exist

    Unsolved
    8
    0 Votes
    8 Posts
    2k Views
    G
    I hase the same problem in python3.8 venv installation, assistant is located as .venv\Lib\site-packages\PySide6\assistant.exe and pyside6_qtdesigner lookfor .venv\Lib\site-packages\PySide6\bin/assistant.exe I use Python3.8.10 onWindows 10 Professionnel PySide6 vesion 6.5.2
  • plugion xcb can't be loaded

    Unsolved
    3
    0 Votes
    3 Posts
    606 Views
    JonBJ
    @fabiopires10 In addition to @Abderrahmene_Rayene, the starting move is to set environment variable QT_DEBUG_PLUGINS to value 1 and then run your program. You can do that from a terminal/shell or from Qt Creator. Then look at diagnostic output, near the end where it is failing.