Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • Compare two images for similarity

    Unsolved image image processin
    6
    0 Votes
    6 Posts
    3k Views
    raven-worxR
    @sush this is actually outside of the scope of Qt. You should use a graphics processing library (like OpenCV - i don't know if it offers such functionality) to do such stuff. Or you need to implement an appropriate algorithmn yourself which uses the Qt API to access the pixel data. This is by far a complicated topic. You may want to read the following links: Overview Perceptual Image Diff lib QGoImageComapre
  • QMenu shortcut

    Solved
    5
    0 Votes
    5 Posts
    1k Views
    ?
    @yuvaram Oh, I tested again and it works! I also connected signal, activated() with QMenu's slot, close(). Thanks.
  • How can one have two or more active windows at the same time?

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    B
    @jsulm said in How can one have two or more active windows at the same time?: @bask185 said in How can one have two or more active windows at the same time?: help->setModal(true); help->setGeometry(0,0,1024,668); help->exec(); You should not set modal to true and you should use show() instead of exec(). exec() is a blocking call - the caller will be blocked until the new window was closed. Modal windows/dialogs block other windows/dialogs until they are closed. See http://doc.qt.io/qt-5.9/qdialog.html This works ;) @SGaist said in How can one have two or more active windows at the same time?: Hi, What about using a QStackedWidget and switch between the widgets you want to show ? I'll read it for usage in the feature. For now Jsulms simple solution suffices.
  • Queries regarding the running the init-repository after downloading the Qt source code

    Unsolved
    31
    0 Votes
    31 Posts
    16k Views
    jsulmJ
    @Pradeep-Kumar In the same terminal: call "env" and see whether any of those variables is in the output. Or just do: echo $QMAKESPEC
  • csharp with qt

    Unsolved
    8
    0 Votes
    8 Posts
    3k Views
    jsulmJ
    @Rameshguru What should I explain clearly? You should explain clearly the problem. For that I asked you to post the whole error messages instead of the numbers LNK2020 and LNK2001. Can you please do so? And what do you want to add actually? Source code files or a library? For library @VRonin already explained how to do it.
  • Get uninstall application path by name issue

    Solved
    6
    0 Votes
    6 Posts
    2k Views
    A
    @Cobra91151 So basically your code worked fine you just didn't have any applications installed for the current user only. That would have been the reason for the test to see if allCurrentUserKeys.isEmpty() was true. :)
  • How to get namespaces in the root QDomElement?

    Unsolved
    1
    0 Votes
    1 Posts
    317 Views
    No one has replied
  • QImage doesn't take in a JPG

    Solved
    30
    0 Votes
    30 Posts
    14k Views
    R
    It's working with jpegs now. I had reference to a non-existant directory in the link statement. Sorry Charlie, but doing it with this resources dance makes it all too complicated. Doing baby steps here. Maybe later. It wasn't the jpeg plugins.
  • How to keep screen on ? ( Not android )

    Unsolved
    4
    0 Votes
    4 Posts
    855 Views
    J
    @koahnig @raven-worx Hi All Thanks, for giving answer about that! I will try to check API and QScreenSaver class Thanks,
  • Expert System Course with Qt and C++

    Unsolved
    1
    1 Votes
    1 Posts
    312 Views
    No one has replied
  • Reading text file to specific sign in each line

    Unsolved
    3
    0 Votes
    3 Posts
    712 Views
    C
    @emdoa You can use a variety of Objects (QTextStream for example) even from standard (StringStream). Please look deeply at this types and some simple statements will work fine for you. It would be so easy as a loop with a inner if (or flag). Thank you.
  • QRegularExpressions not matching

    Solved
    4
    1 Votes
    4 Posts
    986 Views
    SGaistS
    Hi, You can use the regular expression example tool to check your regexp as well as get the escaped version for your code.
  • Collecting dimensions of translatable text labels in Qt Quick

    Unsolved translations lupdate tools size
    7
    0 Votes
    7 Posts
    3k Views
    SGaistS
    What kind of text do you have that might be big enough to become a problem for your UI ?
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    3 Views
    No one has replied
  • Nearest line point for a given point

    Solved
    13
    0 Votes
    13 Posts
    5k Views
    Y
    Thank you for all this answers! I I agree understanding and doing all the maths is way better than using a blackbox that do all the stuff for you! but... My trigo lessons are old and I don't want taking too much time re-learning it :) I solved it like this: QPointF pt = mapFromParent(point); QLineF trackLine((m_angles.at(i-1)->pos()),(m_angles.at(i)->pos())); double APx = pt.x() - trackLine.x1(); double APy = pt.y() - trackLine.y1(); double ABx = trackLine.x2() - trackLine.x1(); double ABy = trackLine.y2() - trackLine.y1(); double magAB2 = ABx*ABx + ABy*ABy; double ABdotAP = ABx*APx + ABy*APy; double t = ABdotAP / magAB2; QPointF newPoint; if ( t < 0) { newPoint = trackLine.p1(); }else if (t > 1){ newPoint = trackLine.p2(); }else{ newPoint.setX(trackLine.x1() + ABx*t); newPoint.setY(trackLine.y1() + ABy*t); } return newPoint; ( used an algo found on the internet and adpat it a little before seeing all your answers :)
  • QDialog and Inheritance

    Unsolved
    9
    0 Votes
    9 Posts
    4k Views
    artwawA
    @webzoid More or less, yes. If you know what size the dialog should have after the change you can always call resize() to set the expected size. Going further I think that in theory you could compute expected size based on sizeHint() methods of the child items however I never did that personally.
  • scrollTo not working properly

    Solved
    4
    0 Votes
    4 Posts
    2k Views
    MegamouseM
    So: after the hint with toScroll delay we noticed that the table layout/state might not be fully up to date with its contents. I went through the table-filling code step by step and found that one of our devs used setRowCount(0); to clear the table without losing the headers . I replaced it with clearContents(); and now it seems to be working. If it still has issues I may try the schedule . Thanks for the inspiration!
  • How can I load big text file into QPlainTextEdit?

    Solved
    7
    0 Votes
    7 Posts
    6k Views
    ?
    @artwaw I also noticed that if I disable wordwrap with ui->plainTextEdit->setWordWrapMode(QTextOption::NoWrap); it loads 10MB text file without newline well. I think the problem was based on Qt's word wrap.
  • How can i save data (with the same tag) from an xml to a qmap?

    9
    0 Votes
    9 Posts
    6k Views
    Z
    @annatz Hi: how did you use qmultimap for resolve your problem? at this moment , I am in that issue, i don't know how I will resolve that writing qmap into xmlFile. thanks
  • QMessageBox style anomaly - Qt Widgets 5.7 - Windows 10

    Solved
    10
    0 Votes
    10 Posts
    3k Views
    David.ReznicekD
    Ok, so the problem is caused by the thirdparty code 'CodeJock'. Sorry guys about your time. Thank you, David.