Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.3k Topics 455.8k Posts
  • QML - SpinBox - how to know if it's UP or DOWN pressed

    Unsolved
    3
    0 Votes
    3 Posts
    231 Views
    V
    Well, I have a number, for example, 1. If you will press the UP button is going to become 2, 3, 4, and so on. But If you will press the DOWN button it will become 0.9, 0.8, 0.7 .... 0.1 if you will press again the DOWN button it will become 0.09, 0.08, ... 0.01. The problem that I have is that I don't know how can I achieve something like this without knowing whether is going to go UP or DOWN. I mean for example if my value is 1 I want that if I will press UP my stepSize to be 1, but if I will press DOWN to be 0.1 The same if my value will be 0.1, if I will press UP then my stepSize should be 0.1 but if I will press DOWN should be 0.01. Because of this problem I need to know which button is pressed at each time. Also if I am trying to write maximumSpeed.up.pressed is going to give me this error message: Cannot read property 'pressed' of undefined Also if I am going to define my property insider of CustomSpinBox for example something like this property bool isUp: root.up.pressed then this is never going to be updated so I will always have a false over there.
  • Using QTimer with signal

    Unsolved
    11
    0 Votes
    11 Posts
    1k Views
    J.HilkJ
    @Alpkan said in Using QTimer with signal: I now singleshot is working but i want to send message every 10 second with qtimer :) then you'll need a QTimer as a class member and/or one created on the heap and you need to change your timeout from 2 seconds to 10, of course :D
  • Migrate from MFC visual studio 2008 to Qt5

    Moved Unsolved
    21
    0 Votes
    21 Posts
    3k Views
    Chris KawaC
    @willkom said: so using qtwinmigrate library mean convert all the MFC dependency of the project to Qt5 dependency right? qtwinmigrate is a stopgap solution that allows MFC and Qt to coexist in a single app and embed widgets in MFC windows so you can port all your MFC classes one by one. When you're done qtwinmigrate is no longer used and can be removed from your project. So if you decide to use it the steps are: Port your app to VS2019 (still with just MFC) If you want to use Qt Creator you'll probably want to port your solution from .sln to qmake or CMake. Add qtwinmigrate to your project and use it to create a Qt event loop inside your MFC application Using qtwinmigrate start porting your MFC classes one by one to Qt When you're done remove qtwinmigrate from your project Remove MFC dependencies from your project (libs, includes etc.)
  • How to use CSS Vars?

    Solved
    4
    0 Votes
    4 Posts
    370 Views
    L
    Thanks for the fast response. I will go on with my style.css without using variables.
  • QJSEngine evaluate giving a syntax error when script source contains class keywork

    Unsolved
    1
    0 Votes
    1 Posts
    161 Views
    No one has replied
  • This topic is deleted!

    Solved
    5
    0 Votes
    5 Posts
    41 Views
  • How to add selected items from table widget into a queue?

    Unsolved table widget qt5
    11
    0 Votes
    11 Posts
    1k Views
    D
    @jsulm thank you. I changed the selection behavior and it works.
  • Adding right click menu on QTableWidget

    Unsolved qt5 widget table widget
    9
    0 Votes
    9 Posts
    5k Views
    D
    @nagesh said in Adding right click menu on QTableWidget: @suslucoder if you want to create the chart only during right click, comment above lines from constructor. grafik_olustur(); //create chart first timer->start(500); //adds values to chart this was the answer im searching for. Sorry for, i couldnt explain my question clearly.
  • Best way to display and print a form document

    Unsolved
    3
    0 Votes
    3 Posts
    254 Views
    Q
    Hum that's might be what I m looking for ! Thanks a lot mate !
  • QThread: Destroyed while thread is still running

    Solved
    4
    0 Votes
    4 Posts
    711 Views
    JKSHJ
    @Wang-xiaohu said in QThread: Destroyed while thread is still running: I thought it would be OK to use QThread::quit() function. QThread::quit() causes the thread to begin shutting down. QThread::wait() waits for the thread to finish shutting down.
  • Create my widget from HWND?

    Unsolved
    3
    0 Votes
    3 Posts
    400 Views
    kshegunovK
    @Taytoo said in Create my widget from HWND?: Is it possible? Not easily and involves some really nasty tricks. My advice: don't! See what @Chris-Kawa wrote, try to work around the issue. Why do you require this anyway?
  • QThreadpool/QRunnable blocking

    Unsolved
    13
    0 Votes
    13 Posts
    1k Views
    kshegunovK
    @John-Howe the qDebug stream is serialized internally, which is what @nagesh is alluding to, I imagine. That notwithstanding, you should just interrupt the debugger when the program hangs, and extract a complete stack trace. Upload it somewhere/post it here, so we can take a look.
  • Pass in static constants from c++ to qml

    Unsolved
    2
    0 Votes
    2 Posts
    320 Views
    fcarneyF
    Just instance your object somewhere in main or function called from main. ConstantObject constobj; engine->rootContext()->setContextObject(&constobj); Set QObject* as contextObject. The members are now values that appear as standalone values. I would just do q_property with read though. Member I think implies being able to be modified.
  • Qt usage in thesis

    Locked Solved licensing
    6
    0 Votes
    6 Posts
    863 Views
    U
    @JKSH Thanks for your response. I made sure to satisfy the points which you've mentioned and I think that it's OK this way. Sorry for the delayed response, last weeks were pretty busy haha.
  • Programatically adding custom widget to a layout

    Solved
    5
    0 Votes
    5 Posts
    882 Views
    A
    OK, solved. My code posted is fine as is. I was using a 3rd party SDK that redefined TCHAR which set off an unfortunate chain of events. I think as long as you make a class that extends QWidget the code in my example is a perfectly fine way of plopping it in the GUI.
  • What does the ellipsis (...) mean in the text QString of QAction objects?

    Solved
    7
    0 Votes
    7 Posts
    1k Views
    W
    @Yuta said in What does the ellipsis (...) mean in the text QString of QAction objects?: But in any case, why would you put an ellipsis at the end of the descriptive text of the action anyways? Does it serve some function? It's just a convention that implies a menu entry will open a dialog box. It's a hint to the user, not something the API cares about. Like, "Open..." will trigger a file requester dialog. But "Bold" will just make the selected text bold with no additional interaction. Look at a lot of the apps you use, and you'll see the pattern now that you know what to look for.
  • Title bar messing dialog layout

    Unsolved
    3
    0 Votes
    3 Posts
    221 Views
    A
    SOLVED The items in group box are code controlled (normal ) and the box is build in code too which makes the box "invisible " as initially set in the example. Little confusing. The text is replaced during run , and the test copy does not obviously get replaced by original code. [image: d0c3c40e-d090-4f8c-83a3-7c5ab15dd7e5.png]
  • 0 Votes
    1 Posts
    439 Views
    No one has replied
  • No member named 'stackedWidget' in Ui::MainWindow

    Solved stackedwidget qmake
    8
    1 Votes
    8 Posts
    4k Views
    A
    @Christian-Ehrlicher Thank you, I had a typo in the widget name in the ui file which I was able to find in the ui_mainwindow.h file.
  • QToolButton clicked signal emitted several times

    Solved
    13
    0 Votes
    13 Posts
    1k Views
    Match0umM
    Hi guys, it's been a while but I found the issue. As my signal was on a loop, it was emitted each time the program went on the loop. I don't know why I didn't see that sorry for that. The topic is now closed.