Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • Qt Style Sheets versus setFont function.

    Solved
    3
    0 Votes
    3 Posts
    282 Views
    C
    @mrjj Thank you so much. This takes some worry off my mind.
  • How to access the parent thread's vriable from child QThread

    Unsolved
    2
    0 Votes
    2 Posts
    622 Views
    jsulmJ
    @Mohammadreza99A Why do you want to access a private variable from another class? Don't do that, use getter/setter. When using threads you would need to synchronise the access to avoid race conditions. Better would be to use signals/slots to exchange data between MyClass and Worker.
  • QString::section() NO bug

    Solved
    10
    0 Votes
    10 Posts
    567 Views
    G
    Finally I have found error in my code. It was hard because of weird processing. QString::split() works fine. But what about QRegExp - I do not remember why I used it instead of QRegularExpression. May be it looked simpler. This code was redesigned and regular expression was much more complex at beginning.
  • How to check if a resource exists?

    Solved
    7
    0 Votes
    7 Posts
    4k Views
    sierdzioS
    Nice! Happy coding
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    29 Views
    No one has replied
  • How to set the current index of a tree view to the selected row?

    Unsolved
    13
    0 Votes
    13 Posts
    2k Views
    SGaistS
    From the looks of it, you only want a copy of the content of the tree item.
  • qmake question

    Unsolved
    2
    0 Votes
    2 Posts
    171 Views
    SGaistS
    Hi, Modify the protobuf_decl.output, protobuf_impl.output and protobuf_impl.depends paths to point to where you want.
  • Excessive memory use in QNetworkAccessManager after network disruption

    Unsolved
    11
    0 Votes
    11 Posts
    823 Views
    N
    After a lot more testing and comparing between systems with and without the issue, is does not seem to be related to network reliability after all. System sending regularly and constantly are OK systems spending sporadically take up ever more memory. When about a 100K is sent every 10-20 minutes and additional 40Mb is used up daily compared to sending ever minute. This memory in not released if QNetworkAccessManager is destroyed. Memory is taken during QnetworkAccessManager::post() and the amount can be anything between 2-300K to 3MB at a time and is not related to the amount of data sent. Does anyone have experience with cacheing in QNetworkAccessManager? What is cached by default and how to control it?
  • 0 Votes
    6 Posts
    1k Views
    K
    I can open this port by: So, as I said, the problem is not in O_LARGEFILE. There are just a few codes in QSP sources in github link This is not a sources, the sources is in.
  • what does the rssi of bluetoothdeviceinfo mean

    Solved
    13
    0 Votes
    13 Posts
    1k Views
    MihanM
    @jsulm Oh, I didn't notice that the example the link said "For example, Manufacturer A could have an RSSI max value of 100 while Manufacturer B will return RSSI values anywhere from 0 to 127. " So,maybe rssi() == 127 means this signal is the best. Thank you so much!
  • 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
    781 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 ?