Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • custom model isn't completely working

    Solved
    30
    0 Votes
    30 Posts
    4k Views
    mzimmersM
    Hi all - Thanks for all the assistance. I'm going to close this topic, even though it's not solved, because I've come to realize that my model is overly complicated, and it make it difficult for me to explain here (there are parts of it that I still don't understand). So, I'm going to make the following changes to my model: use an internal QList instead of using a separate class (currently EquipmentList) for my data list. replace the EquipmentItem class with a struct, and eliminate all the now-unnecessary getters and setters. Hopefully these changes will make it a lot easier to follow what's happening. If I run into trouble, I'll start a new topic...thanks again.
  • 0 Votes
    8 Posts
    329 Views
    JoeCFDJ
    @nen777w Good for you. Interesting. No sure how this flag is related to jittering.
  • How to keep rectangle name to its center ?

    Unsolved
    3
    0 Votes
    3 Posts
    200 Views
    T
    @JoeCFD Thanks.
  • Getting SIGSEGV when using external lib after upgrade to Qt 6.4

    Unsolved
    7
    0 Votes
    7 Posts
    455 Views
    JonBJ
    @odriscog said in Getting SIGSEGV when using external lib after upgrade to Qt 6.4: just .lib. Does that mean we should strictly be using MSVC with these libs? Yep, that is the implication. .lib is the MSVC++ library file extension, .a is the MinGW one (unless a C-only library, not C++). You cannot mix MSVC & MinGW compiled elements. Having said that, I am surprised that anything ever linked if this was the case.
  • Custom push button try

    Solved
    3
    0 Votes
    3 Posts
    210 Views
    V
    @JonB hi, It works now! I forgot that I have setFocusPolicy in the mypushbutton class. So I need to click the widget and press A.
  • Qt Virtual Keyboard - move a different screen.

    Unsolved qt5.15.2 qtvirtualkeyboa qtwidgets arm64
    1
    0 Votes
    1 Posts
    428 Views
    No one has replied
  • Gamepad is connected but not displaying the name

    Unsolved
    3
    0 Votes
    3 Posts
    187 Views
    V
    @Pl45m4 It's a read-only property
  • This topic is deleted!

    Moved Unsolved
    16
    0 Votes
    16 Posts
    43 Views
  • Why reading file in a separate thread is slowing down GUI?

    Solved qthread gui lagging
    7
    0 Votes
    7 Posts
    1k Views
    CJhaC
    @SimonSchroeder Thank you! That is really good advice, I will try it out now :)
  • How to include a COM tlb library in my console project

    Unsolved axcontainer console kompas-3d
    4
    0 Votes
    4 Posts
    826 Views
    hskoglundH
    Hi, .tlb-files cannot be added to your project via an #include. One way is to use Qt's dumpcpp utility, for example: C:\Qt\5.15.2\msvc2019\bin\dumpcpp C:\Program Files\ASCON\KOMPAS-3D v20\Bin\kAPI5.tlb" then with a bit of luck you'll have 2 new files: kAPI5.h and kAPI5.cpp, Add these files to your project. And then try #include the kAPI5.h file in your main.cpp.
  • How to reference multiple variables in a selector?

    Unsolved
    3
    0 Votes
    3 Posts
    210 Views
    C
    Check if the widget contains a and b property independent of true or false? No way I can see of doing this. Check if the widget contains a and b and both are true See your first example.
  • QToolBox page header alligment

    Unsolved
    4
    0 Votes
    4 Posts
    415 Views
    SGaistS
    @JoeCFD to be tested. It's not necessarily only an option issue. Each style can render things differently with the same options applied.
  • Lose webp support on QT6.5.1 MINGW

    Unsolved
    2
    0 Votes
    2 Posts
    196 Views
    cristian-adamC
    See https://bugreports.qt.io/browse/QTBUG-113726 Please reopen the bug report and add new information there.
  • serial Communication using Threading

    Solved
    30
    0 Votes
    30 Posts
    3k Views
    V
    @jsulm ok..I understand. I'll try. If any issue occurs..I'll post that error. Thank you
  • QPushButtons Not Resizing

    Unsolved
    6
    0 Votes
    6 Posts
    277 Views
    A
    @SGaist Instead of adding buttons on the header i directly added to treeview. still the same issue. below are the new files and code. mainwindow.cpp #include "mainwindow.h" #include "ui_mainwindow.h" #include <QHBoxLayout> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) , m_pTabWidget(new QTabWidget(this)) , m_pTreeView(NULL) , m_pButtonOne(NULL) , m_pButtonTwo(NULL) , m_pHBoxLayout(NULL) { ui->setupUi(this); Init(); connect(m_pTabWidget, SIGNAL(currentChanged(int iIndex)), this, SLOT(OnCurrentTabChanged(int iIndex))); } MainWindow::~MainWindow() { delete ui; } void MainWindow::Init() { if(m_pTabWidget) { // Tab 1 m_pTreeView = new QTreeView(m_pTabWidget); if(m_pTreeView) { m_pButtonOne = new QPushButton("Button One"); m_pButtonTwo = new QPushButton("Button Two"); m_pHBoxLayout = new QHBoxLayout(); m_pHBoxLayout->addWidget(m_pButtonOne, 0, Qt::AlignLeft); m_pHBoxLayout->addWidget(m_pButtonTwo, 0, Qt::AlignRight); m_pTreeView->setLayout(m_pHBoxLayout); m_pTabWidget->addTab(m_pTreeView, "Tree View Tab"); // Tab 2 m_pTabWidget->addTab(new QWidget(this), "Tab 2"); } this->setCentralWidget(m_pTabWidget); } } void MainWindow::UpdateButtonText() { if(m_pButtonOne && m_pButtonTwo) { QString strButtonTxt = ""; QFontMetrics fm(font()); // Update Button 1 text strButtonTxt = "Button One"; strButtonTxt = fm.elidedText(strButtonTxt, Qt::ElideRight, m_pButtonOne->width()-20); m_pButtonOne->setText(strButtonTxt); // Update Button 2 text strButtonTxt = "Button Two"; strButtonTxt = fm.elidedText(strButtonTxt, Qt::ElideRight, m_pButtonTwo->width()-20); m_pButtonTwo->setText(strButtonTxt); } } void MainWindow::OnCurrentTabChanged(int iIndex) { switch (iIndex) { case 0: { UpdateButtonText(); } break; case 1: { } break; default: break; } } void MainWindow::resizeEvent(QResizeEvent* pEvent) { Q_UNUSED(pEvent); m_pTabWidget->resize(frameSize()); UpdateButtonText(); } mainwindow.h #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QTabWidget> #include <QTreeView> #include <QHBoxLayout> #include <QPushButton> #include <QHeaderView> QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE class MainWindow : public QMainWindow { Q_OBJECT public: MainWindow(QWidget *parent = nullptr); ~MainWindow(); private: void Init(); void UpdateButtonText(); protected slots: void OnCurrentTabChanged(int iIndex); protected: void resizeEvent(QResizeEvent* pEvent); private: Ui::MainWindow *ui; QTabWidget* m_pTabWidget; QTreeView* m_pTreeView; QPushButton* m_pButtonOne; QPushButton* m_pButtonTwo; QHBoxLayout* m_pHBoxLayout; }; #endif // MAINWINDOW_H This issue has been bugging me while. Kindly help. thanks in advance.
  • This topic is deleted!

    Unsolved
    6
    0 Votes
    6 Posts
    32 Views
  • End QSerialPort open attempt on timeout

    Unsolved
    19
    0 Votes
    19 Posts
    1k Views
    JonBJ
    @Dummie1138 You might move the serial port to a thread and do the open() there. (I believe you can move it back to another thread if you want.) That would mean the call would only block that thread, not the UI. (Personally) I would not try to destroy the port object while it is executing an open(). It probably won't abort it anyway, and likely leave things in a bad state.
  • How to update the value of a struct using Q_PROPERTY and stylesheet?

    Unsolved
    7
    0 Votes
    7 Posts
    984 Views
    SGaistS
    I currently don't know if it's possible to use stylesheets to change the value of a gadget from a property. However, can you please explain why you want to start altering such complex properties from within a stylesheet ?
  • SimpleCrypt changing binary data after encryption/decryption

    Solved
    7
    0 Votes
    7 Posts
    537 Views
    SGaistS
    @imfp hi, QDataStream does write "metadata" along whatever you send through it so you can easily read and write your custom types from it (see the corresponding operators you have to implement).
  • Propagation of Material style properties in Qt 6.5

    Unsolved
    2
    0 Votes
    2 Posts
    169 Views
    B
    I created a bug report https://bugreports.qt.io/browse/QTBUG-115287