Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.6k Posts
  • QSvgRenderer using an external CSS file

    Unsolved
    10
    0 Votes
    10 Posts
    630 Views
    JonBJ
    @KSierens But that is true for all CSS on any HTML element: any property set explicitly on any element overrides any rule in CSS, which is only used for defaults if nothing explicitly, and always has been like that. Full CSS in HTML allows you to use the !important directive in a CSS rule (stroke: red !important;) and that would actually override even matching style explicitly placed on an element. But Qt's CSS is a subset of full CSS and does not support !important, so you can't do that.
  • Urdu RTL language inter-word space character in Scrivener

    Unsolved
    2
    0 Votes
    2 Posts
    297 Views
    I
    @bush46 Scrivenger appears to be a commercial product, it is best that you contact their support. This forum is for questions by programmers who write software using Qt, not so much for end users of that software.
  • Subclassing QMessageBox

    Solved
    10
    0 Votes
    10 Posts
    630 Views
    S
    @posktomten said in Subclassing QMessageBox: The reason for me to make my own messagebox is that I often want more width. I feel you. Sometimes we have error messages that include the full path to a file. It doesn't fit inside the message boxes...
  • How to create a custom-styled Qt window with non-native menu and title bar?

    Unsolved
    3
    0 Votes
    3 Posts
    480 Views
    S
    I am not even sure if Windows itself allows to style the title bar. By default the title bar belongs to the OS and you can only set the title and the icon. I guess the most common way (especially with Qt) is to create a Window without a title bar (by setting the proper window flags) and then providing your own title bar. This also means that you need to provide the 3 buttons on the top right yourself. You also have to implement the behavior of these 3 buttons and you have to implement dragging the window by dragging the title bar.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Building QtWebEngine invariably fails: failing qpa-xcb support??

    Unsolved
    6
    0 Votes
    6 Posts
    1k Views
    Axel SpoerlA
    [image: 5ac861fb-2124-4d4c-9540-05a8821b3a72.png]
  • QCompleter::currentIndex issue

    6
    0 Votes
    6 Posts
    4k Views
    U
    A bit late here, but this was a top google response when I had the same issue. A clean and elegant solution I found was to use QCompleter::popup(), which is a QAbstractItemView*, then used QAbstractItemView::currentIndex(). This method was used to get the user selected model index after QLineEdit::editingFinished() signal. My QCompleter was assigned a QTableView popup widget upon construction; I do not know if that is what enabled getting a currentIndex by way of the popup() QAbstractItemView....
  • Try to set my camera fps to 60

    Unsolved
    5
    0 Votes
    5 Posts
    584 Views
    F
    Hello, Sorry for delay :) I've try something else, this is the new code: #include "MainWindow.h" #include <QCameraDevice> #include <QMediaMetaData> #include <QCameraFormat> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { // Setup camera and video widget camera = new QCamera(this); videoWidget = new QVideoWidget(this); captureSession = new QMediaCaptureSession(this); captureSession->setCamera(camera); captureSession->setVideoOutput(videoWidget); // Layout QVBoxLayout *layout = new QVBoxLayout; layout->addWidget(videoWidget); // Combobox for video formats formatComboBox = new QComboBox(this); // Populate the combo box with supported formats populateFormats(); layout->addWidget(formatComboBox); // Current format label currentFormatLabel = new QLabel("Current Format: ", this); layout->addWidget(currentFormatLabel); // Connect combobox to slot connect(formatComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &MainWindow::onFormatChanged); QWidget *centralWidget = new QWidget(this); centralWidget->setLayout(layout); setCentralWidget(centralWidget); // Start the camera camera->start(); } MainWindow::~MainWindow() { } void MainWindow::populateFormats() { const QList<QCameraFormat> formats = camera->cameraDevice().videoFormats(); for (const QCameraFormat &format : formats) { QString formatDescription = QString("Resolution: %1x%2, Pixel Format: %3, Frame Rate: %4 fps") .arg(format.resolution().width()) .arg(format.resolution().height()) .arg(format.pixelFormat()) .arg(format.maxFrameRate()); formatComboBox->addItem(formatDescription, QVariant::fromValue(format)); } } void MainWindow::onFormatChanged(int index) { QCameraFormat selectedFormat = formatComboBox->currentData().value<QCameraFormat>(); camera->setCameraFormat(selectedFormat); QString formatDescription = QString("Resolution: %1x%2, Pixel Format: %3, Frame Rate: %4 fps") .arg(selectedFormat.resolution().width()) .arg(selectedFormat.resolution().height()) .arg(selectedFormat.pixelFormat()) .arg(selectedFormat.maxFrameRate()); currentFormatLabel->setText("Current Format: " + formatDescription); } With this code, if I selected format with 60fps, nothing change, it's seems the video saty on 30 fps
  • Unable to load icon image

    Unsolved
    7
    0 Votes
    7 Posts
    443 Views
    A
    Thanks for your reply. I will convert my image to png only to avoid this issue
  • when is a QFile::copy() finished ?

    Unsolved
    8
    0 Votes
    8 Posts
    612 Views
    S
    On Windows (local filesystem) you cannot delete a file that is open by another process. And copying should, in a way, keep the file open. Linux behaves differently as described before. So, if your file lives locally on your computer I'd say the copy has been finished when QFile::copy returns (minus some buffering, but that also would keep the file open, I hope). From my experience I suspect that this is different when the file is on a network drive (still Windows). I think (haven't checked, though) that copying a file on a samba mount just issues a command to the remote server to do the copy. The local view of the network drive can also become out of sync with the file server. There is a lot of room for error (even though it is only for very short periods of time). I have seen some behavior that suggests that QFile::copy can return before the copy is finished when doing the copy on a samba mount. I'm also not sure what you expect from a copy (finished or not) followed by a delete to happen. Certainly, not allowing to delete a file while it is being copied leaves the system in a reasonable state. But, if you allow to delete a file while being copied it is quite nice if the copy still finishes as it does on Linux.
  • QProgressbar chunk

    Unsolved
    5
    0 Votes
    5 Posts
    3k Views
    I
    @bitlife I think to keep the moving effect, you should use this updated stylesheet for the chunk: ui->progressBar->setStyleSheet( "QProgressBar {" " border: 1px solid gray;" " border-radius: 5px;" " text-align: center;" " background: #EEE;" "}" "QProgressBar::chunk {" " background: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, " " stop:0 #CD96CD, stop:1 #EEA9B8);" " width: 20px;" " margin: 0px;" "}" ); This restores the animated effect by simulating it with a gradient. For native animations, avoid customizing the chunk style.
  • Strange box around my custom QGraphicsObject subclass

    Solved
    2
    0 Votes
    2 Posts
    119 Views
    enjoysmathE
    @enjoysmath I googled around and there are no solutions. So what I've done is changed by boundingRect() definition to be childrenBoundingRect().adjusted(-1,-1,1,1) so it's hidden. I previously needed a larger bounding rect so that I could render a circle to connect arrows (connect arrow button). It will have to be a half-circle now :'(
  • BUG? Mingw 6.7.0 & Mingw 6.8.0 builds crash on windows

    Unsolved qtimer qtime mingw 6.7.0 mingw 6.8.0 bug
    7
    0 Votes
    7 Posts
    1k Views
    S
    @Pl45m4 Yes im using a plain windows 10 system. And yes the linked bug is with MSys2 as i searched for a similar problem and this was the only thing related i could find. Found it odd myself that i worked inside qt creator but crashed outside (as said i tried windeploy and run dependency walker but haven't found a problem there) As said using llvm solves it for me but still wanted to point it out for others may experiencing something simlar. @Christian-Ehrlicher i posted all code above simply create a new project and add in my code for maindwindow.h and .cpp. There is nothing else in my project.
  • 0 Votes
    5 Posts
    269 Views
    JonBJ
    @kuqipair As @Pl45m4 says adding widgets to QListWidget is costly and to be avoided for preference. the ability to switch between multiple different lists within the same QListWidget This sounds like a reason not to use a QListWidget, which has its own internal data model. Rather a QListView where you can swatch underlying model at will.
  • QtGraphs ScatterSeries reverse axis

    Unsolved
    1
    0 Votes
    1 Posts
    106 Views
    No one has replied
  • Loading .FBX file with QT

    Unsolved
    10
    0 Votes
    10 Posts
    6k Views
    K
    No wrong on ubuntu 24,but i meet same error on windows.
  • Translate strings with HTML tags

    Solved
    5
    0 Votes
    5 Posts
    270 Views
    S
    @IgKh I was initially using lupdate, but didn't since last few translations. And I understood my mistake, the context has to be the class emitting the signal, not the one containing the slot.
  • Qt 6.8 QML resize Jitter, bad performance

    Unsolved
    1
    0 Votes
    1 Posts
    184 Views
    No one has replied
  • 0 Votes
    2 Posts
    155 Views
    Pl45m4P
    @Deckhead said in How do manage a large data structure manipulated by tonnes of widgets, with logic applied throughout: I looked at Model/View, but I can't see that this is what I want. Or if it is I don't see how it would work Not sure if I understood everything above but this sounds like a case for a proper data model. One model to hold all the information and then you have multiple widget across your app to modify bits of it... And to update you just have to make sure the model/view/editor is consistent. No need to manually tell 100 widgets that option X has changed if they all refer to the same data
  • QML Resize Jitter

    Unsolved
    2
    0 Votes
    2 Posts
    143 Views
    JoeCFDJ
    Better to tell your OS and add more code for other people to test it.