Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • why? it shows me these warnings when I generate the slots for my controls.

    Unsolved
    2
    0 Votes
    2 Posts
    287 Views
    C
    These slots are named to take advantage of automatic connections between signals and slots implemented by QMetaObject::connectSlotsByName() and most often used in Qt Designer UIs. This mechanism is not inherently evil. However, if you rename the object in the Designer UI and not the matching slot then the automatic connection will not happen (silently). Conversely (and less likely), if you name a function on_blah_triggered() for a reason unrelated to the UI, but where blah exists and has a triggered() signal, you may find an unexpected connection is made (silently). You will find these at run time. This fragility is the reason for the warning. The alternative is to avoid the automatic connection naming and explicitly code connections in your constructor. If you use new-style connect() then this will fail at compile time in the first case, and the connection will not be present in the second.
  • Is there any official document by Qt for Qt_MVVM or Qt_MVC.

    Unsolved
    2
    0 Votes
    2 Posts
    175 Views
    C
    If you mean official documentation for QtMvvm then no. This is a third-party library, so The Qt Company is not the one to document it. I have no idea what Qt_MVC might be referring to. I suspect the answer is the same.
  • Trying to get records from database with c++ and pass it to listview model

    Unsolved
    4
    0 Votes
    4 Posts
    252 Views
    D
    Text { anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter anchors.leftMargin: 8 font.pixelSize: 12 text: modelData.name color: "#b9b5b5" Component.onCompleted: { console.log(JSON.stringify(modelData.name)) } } so modelData.name does the trick....maybe there are better ways, if someone hve any suggestion, please share
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • does anyone have oauth1 hmac-sha256 working on Qt 6+ ??

    Solved
    2
    0 Votes
    2 Posts
    253 Views
    testmonkeyT
    @testmonkey o2 was updated yesterday with qt6 goodness, included that into the .pro file, changed about 6 lines of code and managed to spit out sha256 signatures. legacy lines of codebase using older o2 had to be changed to from O1RequestParameter to O0RequestParameter. created a patch for the differences to o2 -- https://github.com/pipacs/o2/issues/156 still don't know how to do it natively through qnetworkauth route....
  • This topic is deleted!

    Unsolved
    6
    0 Votes
    6 Posts
    25 Views
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Help with timer and JavaScript slot.

    Solved
    43
    0 Votes
    43 Posts
    6k Views
    KroMignonK
    @SPlatten said in Help with timer and JavaScript slot.: right now before trying your suggestion the output is: setupForm() !!!! S000000000029E000000003405T09:32:06.594W:QObject::startTimer: Timers cannot be started from another thread Same issue, you are trying to start a QTimer from the wrong thread. QTimer::singleShot(0, myTimer, [myTimer]() { myTimer->start(); } ); will solve this.
  • converting excel sheet to pdf in qt cpp

    Unsolved
    5
    0 Votes
    5 Posts
    942 Views
    JonBJ
    @harsha123 I do not think there is a C++ library for Qt which can read a .xlsx and understand enough about it to actually render/print/export to PDF. I think at best it can parse it. There may be a library for Python which can accomplish this, but not C++. I stand to be corrected by someone more knowledgeable, I may be mistaken. Maybe I am wrong. What about https://qtexcel.github.io/QXlsx/ ? I see it has Qt-Table-Printer is under BSD 3-Clause license. https://github.com/T0ny0/Qt-Table-Printer at https://github.com/T0ny0/Qt-Table-Printer. Maybe that can leveraged to produce PDF file (which is why I talked abour "printing" earlier, do print-to-PDF-file).
  • Is it possible to fill color in bounding rectangle?

    Solved
    13
    0 Votes
    13 Posts
    2k Views
    Swati777999S
    @JKSH said in Is it possible to fill color in bounding rectangle?: @Swati777999 said in Is it possible to fill color in bounding rectangle?: I wanted to just fill colors to a textbox, so tried with this one. ... Is it possible to fill color to a textbox ? or just do as the above and then put a QLabel inside it? ... It's not a Qt class, in general how text-box is represented in [Untitled] By default Paint Application of Windows OS. I'm afraid I don't fully understand your descriptions or what you're trying to do. Can you please describe what you have already implemented, and what changes you want to make? If you just want to fill the background colour of a QLabel, you can apply a stylesheet to the label: https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qframe For example, label->setStyleSheet("background-color: red;"); Thanks. This works for me.
  • adding subwindow to MDI area

    Moved Solved
    7
    0 Votes
    7 Posts
    1k Views
    A
    @ChrisW67 Before I read the last reply , I did this . Works as required Form_SYSTEM *FS = new Form_SYSTEM(); mdiArea->addSubWindow(FS)-> setWindowState(Qt::WindowMinimized) ; //modify current / last addition mdiArea->currentSubWindow()->showNormal(); mdiArea->currentSubWindow()->resize(400,400); SOLVED
  • Statically linked executable requires dll

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    C
    @Korsarq said in Statically linked executable requires dll: KERNEL32.DLL and MSVCRT.DLL Any Windows application will depend on the first (directly or indirectly): it is the Windows base API (along with USER32.dll, GDI32.dll etc.). Almost any Windows application with components built in C/C++ will depend on the Microsoft Visual C Run Time (MSVCRT): it is the C standard library. MinGW also uses this library. Both are part of Windows, not part of your application. I thought that those libraries are build statically, but it appears that's not the case. In the default Qt build those libraries (e.g. libQt6Widgets.a) are stubs that provide the linker with information to connect your application to the corresponding dynamic library at run time. If you build Qt statically (which you are not doing) then these libraries will contain the actual Qt executable code. Your linked application binary will include this code directly and grow substantially in size. These static Qt libraries will still have dependencies on dynamically loaded (shared) Windows components like KERNEL32.dll.
  • Bug: QSGTextureMaterial MirroredRepeat invalid.

    Unsolved
    2
    0 Votes
    2 Posts
    140 Views
    SGaistS
    Hi, Looks like there might be an error in these variable declaration. Did you already check the bug report system for something like it ?
  • Problems loading plugins

    Solved
    4
    0 Votes
    4 Posts
    299 Views
    D
    I got it. Just as a dumb test I copied the plugin from plugandpaint sample into plugindir of my app and that got loaded. This showed me that the loader failures had nothing to do with my programming, but that there was a problem with the plugin files. So I investigated further in that direction and found out that no link errors are output at building the plugins. So if you think everything is error free, that is far from true for the plugins. Was then still a tough piece of work, but in the meantime all plugins get loaded.
  • Qt 6.2.2 macOS 12.1 aarch64 - Unable to run OOTB BLE Heart Rate Server Example

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

    Unsolved
    2
    0 Votes
    2 Posts
    7 Views
  • How to modify Qt variable (QKmsOutput.mode) from application level?

    Unsolved
    1
    0 Votes
    1 Posts
    179 Views
    No one has replied
  • 0 Votes
    12 Posts
    2k Views
    AitorQtA
    Yeah, done!
  • Changing cursor in QTabBar

    Solved
    6
    0 Votes
    6 Posts
    646 Views
    M
    Hey, I solved this problem. This is my last code //maingui.h #include <QTabBar> ... private slots: ... void mouseMoveEvent(QMouseEvent *event); private: QList<QTabBar *> tabBar ; This is the CPP File //maingui.cpp MainGUI::MainGUI(QWidget *parent) : QDialog(parent, Qt::WindowTitleHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint | Qt::WindowMaximizeButtonHint), ui(new Ui::MainGUI) { ui->setupUi(this); setMouseTracking(true); ... } void MainGUI::mouseMoveEvent(QMouseEvent *event){ tabBar = this->ui->tabWidget->findChildren<QTabBar *>(); tabBar.at(0)->setCursor(Qt::PointingHandCursor); } But sometimes its not initialize for the first time. Thank you
  • setAccessibleDescription() on tooltip window

    Unsolved
    4
    0 Votes
    4 Posts
    377 Views
    AndyBriceA
    Hi @SGaist I am on Qt 5.15.2 and testing on macOS 10 and 11. Just Press Cmd-f5 to enter voice over mode and hover over any QWidget with tooltip text (e.g. a QPushButton). It just says 'new window' when the tooltip window appears. This is not helpful for users. It should probably say nothing.