Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Project ERROR: msvc-version.conf loaded but QMAKE_MSC_VER isn't set

    Solved
    4
    0 Votes
    4 Posts
    4k Views
    jsulmJ
    @Ketan__Patel__0011 Exact error please. And also do complete rebuild: delete build folder, run qmake and build.
  • How to code a loading'.' '..' '...' page that redirects to another ui after 2 seconds?

    Unsolved
    6
    0 Votes
    6 Posts
    428 Views
    Pl45m4P
    @itsnotaron said in How to code a loading'.' '..' '...' page that redirects to another ui after 2 seconds?: I don't need a loading page, but to make it more realistic/to get more marks, I want to add a 2 second loading page. You can make a fake loading screen, which simulates loading some stuff by using a QTimer which will increase the QProgressBar by some value. Skip the "task" - part. Just make the timer consecutively increase your progress by some amount of steps or some value or percentage https://doc.qt.io/qt-5/qprogressdialog.html#details
  • Get bool result of qButton when this is pressed

    Unsolved
    2
    0 Votes
    2 Posts
    192 Views
    Pl45m4P
    @Isidro-Perla Use signals & slots to send a signal to your MyOpenGLWidget which will cause a restart. https://doc.qt.io/qt-5/signalsandslots.html Something like this (in your MainWindow) connect(ui->pushbutton_restart, &QPushButton::clicked, myOGLW, &MyOpenGLWidget::restart); Then, make your widget reset / restart itself (in myOpenGLWidget class)
  • Visual Parent vs Object Parent in QML

    Unsolved
    2
    0 Votes
    2 Posts
    334 Views
    Pl45m4P
    @Vinoth-Rajendran4 Use the official Qt docs: Visual Parent https://doc.qt.io/qt-5/qtquick-visualcanvas-visualparent.html#visual-parent Also this https://doc.qt.io/qt-5/qtquick-visualcanvas-topic.html#visual-parent Here is an example of visual (render) parent + childs. (Have a look at the item coordinate systems) https://doc.qt.io/qt-5/qtquick-visualcanvas-coordinates.html#worked-example See: QObject tree https://doc.qt.io/qt-5/qobject.html
  • What is the difference between win7 and win10 compiling static libraries

    Solved
    3
    0 Votes
    3 Posts
    228 Views
    tovaxT
    Hi, I see. Thank you very much for your reply. Best regards!
  • Mixing QT with C++ Standard Library

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    JKSHJ
    @Kent-Dorfman said in Mixing QT with C++ Standard Library: I am generally paranoid of mixing Qt containers with STL containers Why's that? Have you experienced issues? @TauCeti said in Mixing QT with C++ Standard Library: is it feasible to mix QT commands with Standard Library commands? Yes. as far as I know QT Container are compatible with std-<algorithm> and std-iterators. Is this correct? Is this feasible? Does anybody use it? Does one need special considerations? Yes. Yes. Yes. Yes. For your last question, see the Implicitly Shared Iterator Problem: https://doc.qt.io/qt-5/containers.html#implicit-sharing-iterator-problem What std commands do you use in your QT code? Can you provide examples? e.g. std::sort() seems useful for me. Do you also mix std containers with QT container in one project? I quite happily do things like: Put QString in a std::pair Put std::shared_ptr<MyStruct> inside a QVector Use std::sort(), std::copy_if() on my QVector However, I avoid converting a Qt container to an STL container and vice-versa, like @Christian-Ehrlicher said.
  • Insert a character with predefinite settings

    Moved Unsolved
    3
    0 Votes
    3 Posts
    163 Views
    mrjjM
    Hi Use https://doc.qt.io/qt-5/qtextformat.html#setForeground instead of ui->textEdit->setTextColor(color2); then chF.setForeground(color2); [image: cwvveY.png]
  • QTableWidget strange behaviour

    Solved
    6
    0 Votes
    6 Posts
    773 Views
    mrjjM
    @cpper Yeah I also found that odd as sorting on the first should also do it. But we since we create them empty for (int i = 1; i <= 4; ++i) table.setItem(row, i, new QTableWidgetItem()); and then fill them later in step 2, it might be related but i did not look into that further.
  • error: [rec_cuda.o] Error 2 "....\mingw32-make.exe" exited with code 2"

    Unsolved
    3
    0 Votes
    3 Posts
    314 Views
    A
    Hi SGaist. Sorry if my explanations lack experience here. However, I tried installing NVIDIA CUDA toolkit 10.2 Should that be enough to properly setup CUDA? Do I need to add something in my .pro file? Thanks Here is my .pro file (if necessary) #------------------------------------------------- # # Project created by QtCreator 2018-02-20T14:33:13 # #------------------------------------------------- QT += core gui opengl QT += network QT += opengl QMAKE_CXXFLAGS += -std=c++14 greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport TARGET = MGA-GUI TEMPLATE = app INCLUDEPATH += /usr/local/include/opencv /home/tosson/Desktop/root/include /usr/local/include/ LIBS += -L/usr/local/lib -lopencv_core -lopencv_imgcodecs -lopencv_highgui -L/usr/local/lib/ -lhpdf $$system(root-config --glibs) $$system(root-config --libs --cflags) LIBS += -lglut -lGLU SOURCES += main.cpp\ mainwindow.cpp \ recomb.cpp \ qcustomplot.cpp \ singanalysis.cpp \ maianalysis.cpp \ spottrap.cpp \ qq.cpp \ spottrapped.cpp \ energyspectrumauto.cpp \ matrial.cpp \ englimits.cpp \ indexuser.cpp \ livestream.cpp \ frames.cpp \ gpuconnect.cpp \ parsoptimization.cpp \ progress.cpp \ unitcell.cpp \ baseclass.cpp \ dialog.cpp \ maincal.cpp \ glwidget.cpp \ analysisequation.cpp \ rings.cpp OTHER_FILES += rec.cu \ HEADERS += mainwindow.h \ recomb.h \ qcustomplot.h \ singanalysis.h \ maianalysis.h \ spottrap.h \ qq.h \ spottrapped.h \ energyspectrumauto.h \ matrial.h \ englimits.h \ indexuser.h \ livestream.h \ frames.h \ gpuconnect.h \ parsoptimization.h \ progress.h \ pixelstype.h \ spotstypy.h \ unitcell.h \ baseclass.h \ conv_pixel.h \ dialog.h \ pointtype.h \ analysisequation.h \ rings.h \ glwidget.h FORMS += mainwindow.ui \ recomb.ui \ singanalysis.ui \ spottrap.ui \ englimits.ui \ indexuser.ui \ frames.ui \ RESOURCES += \ pics.qrc win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../root/lib/release/ -lGraf3d else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../root/lib/debug/ -lGraf3d else:unix: LIBS += -L$$PWD/../root/lib/ -lGraf3d INCLUDEPATH += $$PWD/../root/include DEPENDPATH += $$PWD/../root/include win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../root/lib/release/ -lSpectrum else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../root/lib/debug/ -lSpectrum else:unix: LIBS += -L$$PWD/../root/lib/ -lSpectrum INCLUDEPATH += $$PWD/../root/include DEPENDPATH += $$PWD/../root/include DEPENDPATH += /usr/local/lib CUDA_SOURCES += rec.cu CUDA_SDK = "/usr/" # Path to cuda SDK install CUDA_DIR = "/usr/" # Path to cuda toolkit install # DO NOT EDIT BEYOND THIS UNLESS YOU KNOW WHAT YOU ARE DOING.... SYSTEM_NAME = unix # Depending on your system either 'Win32', 'x64', or 'Win64' SYSTEM_TYPE = 64 # '32' or '64', depending on your system CUDA_ARCH = sm_21 # Type of CUDA architecture, for example 'compute_10', 'compute_11', 'sm_10' NVCC_OPTIONS = --use_fast_math # include paths INCLUDEPATH += $$CUDA_DIR/include # library directories QMAKE_LIBDIR += $$CUDA_DIR/lib/ CUDA_OBJECTS_DIR = ./ # Add the necessary libraries CUDA_LIBS = -lcuda -lcudart # The following makes sure all path names (which often include spaces) are put between quotation marks CUDA_INC = $$join(INCLUDEPATH,'" -I"','-I"','"') #LIBS += $$join(CUDA_LIBS,'.so ', '', '.so') LIBS += $$CUDA_LIBS # Configuration of the Cuda compiler CONFIG(debug, debug|release) { # Debug mode cuda_d.input = CUDA_SOURCES cuda_d.output = $$CUDA_OBJECTS_DIR/${QMAKE_FILE_BASE}_cuda.o cuda_d.commands = $$CUDA_DIR/bin/nvcc -D_DEBUG $$NVCC_OPTIONS $$CUDA_INC $$NVCC_LIBS --machine $$SYSTEM_TYPE -arch=$$CUDA_ARCH -c -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} cuda_d.dependency_type = TYPE_C QMAKE_EXTRA_COMPILERS += cuda_d } else { # Release mode cuda.input = CUDA_SOURCES cuda.output = $$CUDA_OBJECTS_DIR/${QMAKE_FILE_BASE}_cuda.o cuda.commands = $$CUDA_DIR/bin/nvcc $$NVCC_OPTIONS $$CUDA_INC $$NVCC_LIBS --machine $$SYSTEM_TYPE -arch=$$CUDA_ARCH -c -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} cuda.dependency_type = TYPE_C QMAKE_EXTRA_COMPILERS += cuda } DISTFILES += \ ../streaking/report_Nickel.pdf \ ../streaking/report_Aluminum.pdf \ ../streaking/pole22.jpg \ ../streaking/pole2.jpg \ ../streaking/pole.jpg \ ../streaking/img.jpg \ ../streaking/convimg.jpg \ ../streaking/333.jpg \ ../streaking/3D33_img.jpg \ ../streaking/3D_img2.jpg \ ../streaking/3D_img1.jpg \ ../streaking/3D_img.jpg \ ../streaking/pole2.png \ ../streaking/pole.png
  • Mirroring a Pixmap Item around an axis

    Unsolved qgraphicspixmap transform rotation c++ qt5
    12
    0 Votes
    12 Posts
    3k Views
    SGaistS
    Did you already read the Graphics View Overview in Qt's documentation ?
  • Problems with QNetwork | QNetworkAccessManager

    Locked Unsolved
    6
    0 Votes
    6 Posts
    399 Views
    SGaistS
    @Kris-Revi said in Problems with QNetwork | QNetworkAccessManager: @SGaist i could still see the thread! Because you are the owner. Since you have undone the deletion, I strongly suggest we stay in that thread over there rather than continuing here because it just fragments the information. Closing this one.
  • Problem with resize qml item with opengl texture inside

    Unsolved
    1
    0 Votes
    1 Posts
    184 Views
    No one has replied
  • 0 Votes
    11 Posts
    1k Views
    S
    @Christian-Ehrlicher I understand what you are saying and I agree with you up to a point, but shouldn't that be a decision for the application developer? In my particular case, I don't need async network calls. And I don't need the extra that is needed trying to implement an event loop for a console app to use QNetworkAccessManager which has a very useful methods for POST and GET http requests. If this was a gui-app, then there is no issue, I can utilize the built-in event loop of qt gui app. But with the console app, it seems i have to bend over backwards to do anything with an async API of QNetworkAccessManager. So my choices are build from scratch using QTcpSocket which supports synchronous calls as far as I can tell, or build a glorified logger that spawns its own process with all the extra needed for that. I just wanted a simple logger that logs to a server at an http endpoint. So yes, I agree that is bad practice to block an event loop. BUT, I didn't want it in the first place, QNetworkAccessManager forces it if you want to use it in an console app that is meant to be synchronous.
  • Get bundle of source code used in a project

    Unsolved
    9
    0 Votes
    9 Posts
    573 Views
    mrjjM
    @JonathanA Hi Ah ok but that would assume it should be able to unpack on other pc in same locations and say i have my external project files on E:\ or /home/username Then other pc must have those folders as else unzipping the project would not work. For such super zip to work, creator should be able to unzip in other locations pr zip location that is not possible to re-create and then also change the .pro file pr changed folder so it could be found in new locations. So not sure it would be so simple to add to Creator. But @aha_1980 sounds like GIT can do it so that would be worth checking out! :)
  • QML and Qt handling Qobjects, QQuickItem

    Unsolved
    1
    0 Votes
    1 Posts
    130 Views
    No one has replied
  • 0 Votes
    14 Posts
    5k Views
    M
    @hskoglund Yep. I build everything on realese mode nand worked
  • This topic is deleted!

    Unsolved
    11
    0 Votes
    11 Posts
    15 Views
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    14 Views
  • mouseReleaseEvent not called only with Qt::RightButton

    Solved
    5
    0 Votes
    5 Posts
    564 Views
    UlysseU
    @Christian-Ehrlicher The me knows these things thank you I have found the issue : On mousePressed with RightButton, a QMenu is shown. I am afraid that the mouseRelease was then caught by the menu instead of my canvas.
  • QT 4 sw implicit copy constructor deprecated

    Unsolved
    2
    0 Votes
    2 Posts
    313 Views
    jsulmJ
    @Thisdave said in QT 4 sw implicit copy constructor deprecated: qt is complaining Not Qt is complaining here but the compiler. Why Qt4?! It reached and of life long time ago and I guess you're using a quite up-to-date compiler?