Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • QGraphicsView - move item by non linear value...

    Unsolved qgraphicsview move
    3
    0 Votes
    3 Posts
    595 Views
    D
    @SGaist Its about precision moves, if user wants to move by tiny bit, scaling mouse movement by x value would allow that to happen. Else he would have to type 0.0001 0.0002 0.0003 etc etc. I think I could handle it using itemChange() and record initial mouse click press/release and calculate delta using that.. Yep that seem to do the trick... I can now move my items by tiny amount and doing "Long precise drags" deltaX = (newPos.x() - self.mMousePressPosition.x()) / 2 newPos.setX(newPos.x() - deltaX) deltaY = (newPos.y() - self.mMousePressPosition.y()) / 2 newPos.setY(newPos.y() - deltaY) Small edit, function above works for "simple" items, but as soon as I get to child items with parent it appear to break... sigh. Needs some more math there
  • QSqlQuery weird error

    Unsolved
    3
    0 Votes
    3 Posts
    322 Views
    krzysieklfcK
    Thanks for reply. I managed to solve this problem with the following: auto prepare_string = QString{ "DELETE FROM %1" }.arg(table); auto ok = q.prepare(prepare_string); auto ok = q.exec();
  • Correctly stop QTimer after its QThread has already quit?

    Unsolved
    10
    0 Votes
    10 Posts
    5k Views
    D
    In TestClass, add a method: void moveToThread(QThread *thread) { connect(thread, &QThread::finished, &m_timer, &QTimer::stop); QObject::moveToThread(thread); } This will make sure when the thread the object is moved to terminates, the timer gets stopped by that thread.
  • Drawing Frames arround Widgets

    Solved
    25
    0 Votes
    25 Posts
    5k Views
    S
    @mrjj said in Drawing Frames arround Widgets: setContentsMargins(0,0,0,0); thats it! [image: a6191f58-0af9-4801-9f93-bed0058793e8.png] I thought i tryed it before but i think i tryed: setContentsMargins(0,0,0,0); and not layout->setContentsMargins(0,0,0,0);
  • QToolTip::showText() for tree view

    Unsolved
    16
    0 Votes
    16 Posts
    2k Views
    mrjjM
    @Ayush-Gupta ok, please consult the docs and make sure you are using it as intended. :) also check the index you use is valid etc.
  • Qt5 QGLWidget rendertext problems

    Unsolved
    4
    0 Votes
    4 Posts
    348 Views
    S
    anyone have any ideas or resolution to this issue?
  • QtEndian

    Solved
    4
    0 Votes
    4 Posts
    440 Views
    Pablo J. RoginaP
    @ThMars said in QtEndian: Thanks for the solutions. is your issue solved then? if so please don't forget to mark your post as such! Thanks.
  • can we change the compiler in qmake

    Unsolved
    31
    0 Votes
    31 Posts
    9k Views
    Pablo J. RoginaP
    @Asha please check response on this other post also from you PS: it'd be a good idea if you could stop double posting...
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Error compiling libqsqlmysql.so ( On Ubuntu)

    Solved
    4
    0 Votes
    4 Posts
    356 Views
    C
    Re: Error compiling libqsqlmusql.so ( On Ubuntu) Hi All As i have predicted before, there was a very stupid error! It seems that db.setHostName("localhost:50000"); is not valid using QMYSQL, but is valid for QSQLITE i have replaced it with db.setPort(50000); db.setHostName("localhost"); And now i can connect to the db using the QMYSQL connector Sorry for bothering you! Thanks Cristiano
  • The program has unexpectedly finished. The process was ended forcefully.

    Unsolved
    17
    0 Votes
    17 Posts
    7k Views
    S
    @CroCo I think this is you want it. [image: a0ad8d39-ce34-420f-891f-67c18d770bdb.jpg]
  • QtDataVisualization with OpenGL

    Unsolved
    1
    0 Votes
    1 Posts
    139 Views
    No one has replied
  • 0 Votes
    8 Posts
    3k Views
    jsulmJ
    @SpaceToon said in Dummy backend running. Qt Bluetooth module is non-functional (Bluetooth Low Energy): So is it possible with the MSVC Compiler? No. You will need to build your code for Linux. It is better to do this on a Linux machine as cross compiling from Windows to Linux will be a lot of work. You can have a virtual machine with Linux to build for Linux.
  • Feasibility of embedding a QWidget app in a .NET/WPF project?

    Unsolved
    7
    0 Votes
    7 Posts
    3k Views
    E
    Hi @pmh4514 , did you actually get your project working? We are curious to try just that, embedding a QGraphicsView (or a full QMainWindow) in a WPF GUI. Did it ever work for you?
  • Error in QString.toUInt/Int/Double : Conversion fails

    Solved
    4
    0 Votes
    4 Posts
    443 Views
    K
    @Pablo-J-Rogina Oh that was pretty quick and thank you. That was a bit confusing for me to understand, but the link you've shared is very useful. Thanks.
  • QGraphicsView MousePressEvent keeps looping

    Unsolved
    3
    0 Votes
    3 Posts
    242 Views
    jsulmJ
    @hobbyProgrammer said in QGraphicsView MousePressEvent keeps looping: QGraphicsView::mousePressEvent(event); Why do you call this in a loop? Also, you should call accept/ignore on the event: https://doc.qt.io/qt-5/qevent.html
  • Customizing QDockWidget

    Unsolved
    4
    0 Votes
    4 Posts
    286 Views
    SGaistS
    Ok, I see. Something like the QSplitter handle.
  • QAudioInput Device State Change

    Unsolved qaudioinput qiodevice state changes audio device
    1
    0 Votes
    1 Posts
    505 Views
    No one has replied
  • static build qt with pgsql, but still need libpq.dll

    Unsolved
    2
    0 Votes
    2 Posts
    430 Views
    SGaistS
    Hi and welcome to devnet, If you want to have a full static build, you'll have get the static librairies of all your dependencies.
  • QDomDocument and QPath

    Solved
    4
    0 Votes
    4 Posts
    391 Views
    JonBJ
    @Daniel-Williams From what I can see, it's not like in e.g. MS stuff, you have to some work. See the code in https://stackoverflow.com/questions/56062025/search-for-nodes-in-a-qdomdocument-using-xpath. It's only 5 months ago, so I assume the answer is "current & correct". https://stackoverflow.com/questions/1286842/how-do-i-run-xpath-queries-in-qt looks like more work. As @mrjj said, there's also https://doc.qt.io/qt-5/qxmlquery.html#details, which works with XPath but not with QDomDocument, I think.