Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • QStyledItemDelegate - Update paint after state change

    Solved
    4
    0 Votes
    4 Posts
    991 Views
    eyllanescE
    @hbatalha I think ui->tableWidget->update(); should be enough.
  • how to generate EAN-8 barcode with QT

    Unsolved
    3
    0 Votes
    3 Posts
    304 Views
    A
    @eyllanesc Thanks
  • QLineEdit how to detect every keypress?

    Solved
    8
    0 Votes
    8 Posts
    2k Views
    jeremy_kJ
    @Publicnamer said in QLineEdit how to detect every keypress?: @jeremy_k All of the above. I'm looking for something like iOS's UITextViewDelegate's method textField:shouldChangeCharactersInRange:replacementString: https://developer.apple.com/documentation/uikit/uitextfielddelegate All of the above in response to something else doesn't clarify anything. What does QLineEdit::textChanged() or QLineEdit::textEdited() miss?
  • QTreeView, are pos in customContextMenuRequested and pos in indexAt the same?

    Solved
    2
    0 Votes
    2 Posts
    354 Views
    eyllanescE
    @jronald The first is the correct one: QModelIndex QAbstractItemView::indexAt(const QPoint &point) const Returns the model index of the item at the viewport coordinates point. In the base class this is a pure virtual function.
  • macdeployqt warning and errors on BigSur (11.5.2) with sql module (Qt 5.15.2)

    Unsolved
    4
    0 Votes
    4 Posts
    445 Views
    SGaistS
    Frameworks are changing between macOS releases so you may have found something new.
  • This topic is deleted!

    Solved
    4
    0 Votes
    4 Posts
    33 Views
  • QWizard loses all fields

    Solved
    5
    0 Votes
    5 Posts
    344 Views
    HoMaH
    Well, technically speaking you have two different wizard one after the other. Yes, well - so...? Do you argue, that my expectation is a misuse of the class? Why would there be the feature of the "commit page", if not for this case? So I would not agree on that. Anyways: What is so strange to me: someone took the time to program the deletions of the fields - and that is really strange to me. Why on earth would you do that? Just close the thing and be done ... Bit thx for your ideas.
  • QQuickWindow::tabletEvent() no longer works in Qt6

    Unsolved
    3
    0 Votes
    3 Posts
    530 Views
    Ben SB
    I filed a bug report that has some sample code illustrating the issue: https://bugreports.qt.io/browse/QTBUG-97859
  • How to apply Raspbian splash screen

    Unsolved
    1
    0 Votes
    1 Posts
    92 Views
    No one has replied
  • Is there something like a "cursorForPosition" for QLineEdits?

    Unsolved
    7
    0 Votes
    7 Posts
    485 Views
    Pl45m4P
    @ZeHgS This is where the cursor is, but you asked for mouseClicks to detect words? The current cursor position is easy to determine like @eyllanesc wrote above.
  • Using a thermal camera in qt

    Solved
    11
    0 Votes
    11 Posts
    925 Views
    Negar_mgN
    I solved my problem and I share it here, In order for the camera image to be displayed like a mirror using qcamera, the code is as follows: #include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); menu = new QMenu; QActionGroup *videoDevicesGroup = new QActionGroup(this); videoDevicesGroup->setExclusive(true); const QList<QCameraInfo> availableCameras = QCameraInfo::availableCameras(); for (const QCameraInfo &cameraInfo : availableCameras) { QAction *videoDeviceAction = new QAction(cameraInfo.description(), videoDevicesGroup); videoDeviceAction->setCheckable(true); videoDeviceAction->setData(QVariant::fromValue(cameraInfo)); if (cameraInfo == QCameraInfo::defaultCamera()) videoDeviceAction->setChecked(true); menu->addAction(videoDeviceAction); videoItem = new QGraphicsVideoItem; videoItem->setSize(QSizeF(640, 480)); scene = new QGraphicsScene(this); graphicsView = new QGraphicsView(scene); scene->addItem(videoItem); } connect(videoDevicesGroup, &QActionGroup::triggered, this, &MainWindow::updateCameraDevice); setCamera(QCameraInfo::defaultCamera()); ui->verticalLayout_2->addWidget(menu); } MainWindow::~MainWindow() { delete ui; } void MainWindow::updateCameraDevice(QAction *action) { setCamera(qvariant_cast<QCameraInfo>(action->data())); } void MainWindow::setCamera(const QCameraInfo &cameraInfo) { m_camera.reset(new QCamera(cameraInfo)); QTransform xForm; xForm.scale(-1,1); xForm.translate(-( scene->sceneRect().width() ), 0); m_camera->setViewfinder(videoItem); videoItem->setTransform(QTransform(xForm)); ui->verticalLayout_3->addWidget(graphicsView); m_camera->start(); }
  • QGroupBox, QScrollArea, QFormLayout

    Solved
    41
    0 Votes
    41 Posts
    8k Views
    SPlattenS
    @mpergand , Thank you, works a treat...now to port to my main application: ui->setupUi(this); QVBoxLayout* pvbxLayout(new QVBoxLayout); mpsa = new QScrollArea; pvbxLayout->addWidget(mpsa); QWidget* pContainer(new QWidget); mpsa->setWidget(pContainer); int intFixedHeight(fontMetrics().height() * 3); mpsa->setFixedHeight(intFixedHeight); mpsa->setWidgetResizable(true); mpFormLayout = new QFormLayout; mpFormLayout->setContentsMargins(0,0,0,0); mpFormLayout->setSpacing(0); mpFormLayout->setHorizontalSpacing(10); pContainer->setLayout(mpFormLayout); for( int i=1; i<=10; i++ ) { mpFormLayout->addRow(QString::number(i), new QLabel(QString("Hello World: %1").arg(i))); } pvbxLayout->addWidget(new QPushButton("HELLO")); ui->centralwidget->setLayout(pvbxLayout);
  • QSqlDatabase: QPSQL driver not loaded

    Solved
    16
    0 Votes
    16 Posts
    12k Views
    3
    @nkbartc Pointing to the dll in the bin library solved the issue for me. Change the path from D:\psql\lib to D:\psql\bin
  • Unable to move OK button in QMessageBox

    Solved
    4
    0 Votes
    4 Posts
    372 Views
    Pl45m4P
    @vijaychsk Then maybe try a QDialog instead of a QMessageBox
  • What could cause clang to error, but gcc compiles it anyway?

    Solved
    19
    0 Votes
    19 Posts
    4k Views
    fcarneyF
    I am gonna say this is solved. I am tired of wasting time on this. Thanks for your help everyone. If I figure this out later I will post something here. I am going to be reevaluating my arm compiler installation later. Maybe that will find something.
  • Correct qrc resource file path?

    Solved
    5
    0 Votes
    5 Posts
    431 Views
    C
    @SGaist I'll read up on using aliases. Thank you for the help.
  • 0 Votes
    2 Posts
    508 Views
    SGaistS
    Hi and welcome to devnet, AFAIK yes. I am currently unsure about native M1 pre-built package being available but even with the x86_64 you should be able to get started.
  • Help needed in making a tcp server confused in connectrun and Qrunnable part.

    Unsolved
    2
    0 Votes
    2 Posts
    134 Views
    SGaistS
    Hi and welcome to devnet, From the code you posted, you don't have a server running so that might be the issue. The other thing is that you don't print what error happened in case the connection failed. That would help your diagnose the issue.
  • Qt Creator 6.2.0 crashes after startup on ubuntu 16.04

    Unsolved
    4
    0 Votes
    4 Posts
    341 Views
    SGaistS
    Hi, There are already quite a lot of threads regarding issues at startup. Did you check them ?
  • How to reduce QToolBar height?

    Unsolved
    1
    0 Votes
    1 Posts
    115 Views
    No one has replied