Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Load image in custom QGraphicsView

    Unsolved
    5
    0 Votes
    5 Posts
    822 Views
    jsulmJ
    @hobbyProgrammer https://doc.qt.io/qt-5/qgraphicsview.html#mousePressEvent
  • what window flag to set for qdialogbox?

    Unsolved
    6
    0 Votes
    6 Posts
    467 Views
    jsulmJ
    @rafael said in what window flag to set for qdialogbox?: QT 5.9.1 I would try with recent Qt version to see whether this issue is already fixed.
  • cant find QLocaleData

    Unsolved
    5
    0 Votes
    5 Posts
    676 Views
    Christian EhrlicherC
    Why not simply calling the base implementation and doing the check afterwards? Apart from this you're missing a return value.
  • Strange Crash When Widgets show() is called

    Solved
    11
    0 Votes
    11 Posts
    3k Views
    Christian EhrlicherC
    Simply fix the signature to pass a reference to int and all is working as expected.
  • Qt platform plugin not initialised

    Unsolved
    2
    0 Votes
    2 Posts
    263 Views
    jsulmJ
    @DrZod said in Qt platform plugin not initialised: I just Installed Qt 5.12 How? "But when i run" - do you start the app from VS or QtCreator, or manually?
  • 0 Votes
    3 Posts
    549 Views
    D
    It appears that QGraphicsScene checks if position of item is visible in view and then draws/dont draws it... returning qgraphicsScene->sceneRect() as boundingRect on my curve "solved" the issues but its a problem for selectable items... hmmm
  • How do i Create a Custom Validator?

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    N
    how do i get around this? https://forum.qt.io/topic/108103/cant-find-qlocaledata
  • QComboBox: Bold Font for selected item in drop down list

    Unsolved
    7
    0 Votes
    7 Posts
    2k Views
    Christian EhrlicherC
    At least it looks like, but did not look at the style plugins though.
  • 0 Votes
    11 Posts
    903 Views
    aha_1980A
    Hi @majorpr13 not yet, please see QTCREATORBUG-22956 for the discussion (and maybe comment there). Regards
  • QtTest Testing Class with delayed event

    Solved
    11
    0 Votes
    11 Posts
    1k Views
    S
    i solved the issue. I found out that only when I add two press statements with a delay after the second the method works correctly. I fixed the bug like this: void Cell::handleMousePressEvent(QMouseEvent *event) { if(!(event->buttons().testFlag(Qt::LeftButton) || event->buttons().testFlag(Qt::RightButton))) { return; } if(event->buttons().testFlag(Qt::LeftButton)) { mSingleMouseTimerLeft.start(); } else if (event->buttons().testFlag(Qt::RightButton)){ mSingleMouseTimerRight.start(); } const auto elapsedTime = mElapsedTimer.restart(); if(elapsedTime < QApplication::doubleClickInterval() && event->buttons().testFlag(Qt::LeftButton) && event->buttons().testFlag(Qt::RightButton)) { if(!isPressed()) { pressIfReleased(); mNeighboursPressed = true; emit pressNeighbours(); } for(QTimer* timer : { &mSingleMouseTimerRight, &mSingleMouseTimerLeft }) { timer->stop(); } return; } } Before we always slided into elapsedTime < QApplication::doubleClickInterval and then the first time: for(QTimer* timer : { &mSingleMouseTimerRight, &mSingleMouseTimerLeft }) { timer->stop(); } was triggered erasing the passed time. only with two nice delays i could get it to work. Now after fix it works as expected: void TestCell::flagged() { constexpr auto delayClickRightAndLeftTogether = 50; QFETCH(Cell::State, cellState); QFETCH(int, result); CellInputHandler filter; Cell obj{ cellState }; obj.installEventFilter(&filter); QSignalSpy spy(&obj, &Cell::flagged); QTest::mousePress(&obj, Qt::RightButton, Qt::NoModifier, obj.rect().center()); spy.wait(delayClickRightAndLeftTogether); QCOMPARE(spy.count(), result); } So i already found a bug. Thats great. Note: I used spy.wait but i think its like QTest::qWaitFor Without condition right?
  • SQL Transport Security Dropped in v5.3 ??????

    Unsolved
    2
    0 Votes
    2 Posts
    113 Views
    SGaistS
    Hi and welcome to devnet, Since it's in the lower levels, I'd recommend bringing this question to the interest mailing list. You'll find there Qt developers/maintainers. This forum is more user oriented.
  • Transmitting Values via UDP to change QML-UI doesn't work.

    Solved
    6
    0 Votes
    6 Posts
    450 Views
    Pablo J. RoginaP
    @J_Weihele said in Transmitting Values via UDP to change QML-UI doesn't work.: It worked pretty well. if your issue is solved, please don't forget to mark your post as such! Thanks
  • how to echo directly from dynamic input

    Solved
    22
    0 Votes
    22 Posts
    4k Views
    SGaistS
    Hi, You can't open two files at the same time like that. You can use a loop and open one after the other.
  • Qt Run setting : specifying run commands to my qt application not working correctly

    Solved
    4
    0 Votes
    4 Posts
    239 Views
    JonBJ
    @Maarouf-Med-Mahdi :) That's why the argv[i] syntax is probably less confusing. With your original *argv + i, which binds as (*argv) + i, I believe you will find you don't quite get the path to to your executable back. What you actually get is always the executable (*argv == argv[0], which is the program name it was invoked under), + i characters on from the first character. So in your case it skipped the very first character of the exe path :)
  • could not find qtplatfom plugin eglfs

    Unsolved
    81
    0 Votes
    81 Posts
    25k Views
    SGaistS
    You don't even need to modify the QT variable content based on your code. However, as @jsulm wrote, your SOURCES line is wrong. In any case it should rather be QT += core gui SOURCES += sample.cpp Casing is important.
  • drawing shapes onto QPixmap with QPaintEvent

    Unsolved
    24
    0 Votes
    24 Posts
    5k Views
    H
    @mrjj Okay so I tried to make a new graphicsview and this is the code. It doesn't seem to load the pixmap. It's probably a stupid mistake (I make them a lot), since I've wasted way too much time on this. #include "graphicsview.h" GraphicsView::GraphicsView(QWidget *parent) : QGraphicsView(parent) { scene = new QGraphicsScene(this); setScene(scene); } void GraphicsView::open() { filename = QFileDialog::getOpenFileName(this,tr("Open File"), QDir::currentPath(), tr("Image Files(*.png *.jpg *.jpeg)")); qDebug() << filename; QGraphicsPixmapItem *pixmap = scene->addPixmap(QPixmap(filename)); update(); }
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • 0 Votes
    3 Posts
    229 Views
    M
    yes but with QtConcurrent. i am facing other problems please refer to https://forum.qt.io/topic/108088/how-to-replace-qthread-with-qtconcureent
  • QEventDispatcherWin32::processEvents freezes in DispatchMessage

    Solved
    4
    0 Votes
    4 Posts
    559 Views
    UlysseU
    My bad, i had forgotten to unlock a mutex in that early return... :/ However the cause of the DispatchMessage invalid call i spotted in the debugger remains unclear to me. Thanks anyway
  • General design help

    Unsolved
    4
    0 Votes
    4 Posts
    324 Views
    P
    @Padgaus Found the layouts, thanks for your help, i'll try some stuff out!