Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.4k Posts
  • How to apply Raspbian splash screen

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

    Unsolved
    7
    0 Votes
    7 Posts
    471 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
    889 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
    360 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
    3k 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
    402 Views
    C
    @SGaist I'll read up on using aliases. Thank you for the help.
  • 0 Votes
    2 Posts
    469 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
    126 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
    337 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
    112 Views
    No one has replied
  • QTextStream reading line by line works only once

    Solved
    3
    0 Votes
    3 Posts
    248 Views
    S
    Hi @JonB, I've realised, that I forgot to add something to my code, so it works now. Thanks for the help anyway.
  • Add QPushButton to QTableWidget cell without using QTableWidget::setCellWidget

    Unsolved
    14
    0 Votes
    14 Posts
    1k Views
    JonBJ
    @VRonin As he pleases, if he sees this (unless you want to refer him to that from there). He doesn't seem to want to change, and thinks other things are at fault too, so it's probably a losing battle...
  • Avoid dealing with QString::normalized when converting to and from std::string

    Solved
    5
    0 Votes
    5 Posts
    772 Views
    J
    ok, too bad. Thanks for your help
  • Language translation with hot keys...

    Unsolved
    3
    0 Votes
    3 Posts
    258 Views
    SPlattenS
    @Pablo-J-Rogina , of course, thank you.
  • After Changing location of projects. QT creator isn't starting in ubuntu

    Solved
    3
    0 Votes
    3 Posts
    248 Views
    HeerokNewbieH
    @jsulm I accidentally also changed the Qt folder location.But after changing the Qt folder location it crashed and my OS become disable to detect QT. but after reinstalling it my problem is solved. i installed it using terminal. sorry for my bad English.
  • Calling a lineEdit value from one form to another form

    Unsolved
    4
    0 Votes
    4 Posts
    352 Views
    JonBJ
    @LT-K101 said in Calling a lineEdit value from one form to another form: I declared it as a global variable and it worked. I know, but that is so not the way to do it! I don't begin to have the time to show & teach you what you should be doing, I'm afraid....
  • Avoid "Not Responding" when adding rows to QTableWidget

    Unsolved
    29
    0 Votes
    29 Posts
    3k Views
    H
    @JonB said in Avoid "Not Responding" when adding rows to QTableWidget: It sounds like your slowness is to with many widgets on a QTableWidget. Not only widgets, adding rows to database also causes slowness. To solve the slowness, having the unsolved delegate topics (Add widget right aligned to a QTableWidget cell and Add QPushButton to QTableWidget cell without using QTableWidget::setCellWidget) answered solves the problem since all I will have to do is to add rows to database in a thread. Right now longuitask solves the problem described in the OP, but @jeremy_k pointed out that it's not the ideal solution so I am trying to understand why he said that and trying out his sugestions.
  • Qt app on mac

    Solved
    12
    0 Votes
    12 Posts
    1k Views
    T
    Edit: I solved it. Or better said, the problem is gone. I made the application executable by using pyinstaller. I used to just give the command my path to the application. However, my application runs in a virtual environment. Installing pyinstaller in said virtual environment and executing the command while still in the virtual env, the problem with the double-click was resolved.