Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • How do I use Qt headers in a CMake sub-project?

    Solved cmake windows msvc2017 msvc visual studio
    6
    0 Votes
    6 Posts
    4k Views
    Christian EhrlicherC
    @tuzepoito said in How do I use Qt headers in a CMake sub-project?: I think I have a solution, or maybe a workaround. Why workaround? If you want to use a library, you have to link against it what you're doing now - how should this be a workaround?
  • qtmqtt build error on windows

    Solved
    1
    0 Votes
    1 Posts
    172 Views
    No one has replied
  • Qt3.12 with MSVC2015

    Unsolved
    2
    0 Votes
    2 Posts
    279 Views
    jsulmJ
    @Vipen If you really used Qt3 then I suggest to port to Qt4 first. Porting from Qt4 to Qt5 is not that hard then.
  • 0 Votes
    6 Posts
    318 Views
    SGaistS
    Use a dirty flag when one of the value has changed. Don't touch the model at all.
  • This topic is deleted!

    Unsolved
    6
    0 Votes
    6 Posts
    45 Views
  • Using a custom QGraphicsEffect

    Unsolved
    3
    0 Votes
    3 Posts
    900 Views
    A
    Calling drawSource() from draw() will do the job. void PreviousFrameOverlayEffect::draw(QPainter *painter) { drawSource(painter); } Another way, which should do the same, but in my case I'm experiencing some rendering glitches with this one: void PreviousFrameOverlayEffect::draw(QPainter *painter) { QPoint offset; const QPixmap pixmap = sourcePixmap(Qt::LogicalCoordinates, &offset); painter->drawPixmap(offset, pixmap); }
  • Customize items in QCombobox (not using QML)

    Unsolved
    1
    0 Votes
    1 Posts
    150 Views
    No one has replied
  • QComboBox with groups?

    Unsolved
    2
    0 Votes
    2 Posts
    703 Views
    JonBJ
    @Dan203 Not that I know of. You would have to roll your own code. A QComboBox uses a QListView for the items: QComboBox uses the model/view framework for its popup list and to store its items. By default a QStandardItemModel stores the items and a QListView subclass displays the popuplist. and that does not support these "categories". You might be able to use setView() (and maybe setModel()) to introduce your own view, with either your own layout (QStyledItemDelegate) and/or perhaps a QTreeView.
  • How to animated QProgressbar

    Unsolved
    3
    1 Votes
    3 Posts
    451 Views
    T
    @jsulm I want the PE_IndicatorProgressChunk is a animation, like QMovie or QPropertyAnimation. Qt had implemented a animated QProgressbar in windowsvista QStyle(The ProgressChunk has a streaming light animatin), I want to implement it in my custom QStyle.
  • QLabel won't update from Slot

    Unsolved
    12
    0 Votes
    12 Posts
    1k Views
    JonBJ
    @rahulb1218 Depends whether these "scripts" were for Qt or not. Qt's TCP/socket code is inherently asynchronous, whereas other examples/toolkits are likely to be synchronous and so require threads. I did not say using threads was necessarily wrong (depends exactly what you have to do in your proposed thread). What I did say is that if I were new to both Qt & C++ I would not choose to use threading if I could possibly help it! :)
  • Are there any special rules with plugins?

    Unsolved
    13
    0 Votes
    13 Posts
    647 Views
    D
    Thank you very much for the pointer! I already read that page before, but I overlooked the object part obviously. May be I'm too outdated for that - I used lots of libraries with that decl_import/decl_export thingi and most if not all had extern "C" included in that macro. So for me, that decl-stuff was synonym for C-usage. Luckily that is wrong, so good times will arise ;) I'll gonna rethink my stuff for that new perspective. Actually I got a bigger problem. But that's worth to start a new thread.
  • error: Variable QMAKE_CXX.COMPILER_MACROS is not defined.

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    jsulmJ
    @luoluo MinGW? MSVC? What does "completed project" mean? Did you do a complete rebuild (delete build folder, run qmake, build)?
  • How to change QPushButton hover area?

    Unsolved
    2
    0 Votes
    2 Posts
    571 Views
    SGaistS
    Hi, There's no "move the hover entry points" concept applicable. What you could do is generate a synthetic event or use an overlay widget.
  • Cannot create QT Quick application (because no Supported platforms)

    Unsolved
    7
    0 Votes
    7 Posts
    1k Views
    W
    @sierdzio + @KroMignon: Thank you very much, seems I'm a step further now. Although the first screen doesn't report any availability of >>Desktop<< for >>Quick application<<, I can add MinGW support on one of the next wizard pages. Compilation and start of generated application successful. Thanks for this awsome and swift response. Wolle22
  • I want to change the selected word

    Unsolved
    2
    0 Votes
    2 Posts
    184 Views
    SGaistS
    Hi and welcome to devnet, Check: QTextEditor QCompleter QTextDocument The Qt rich text editor example in Qt's documentation
  • Application does not exit after mpv_set_wakeup_callback

    Solved
    3
    0 Votes
    3 Posts
    370 Views
    A
    Yes. The problem was with Qt internals conflicting with mpv library's way of multi threading. I have solved the problem by using a QT alternative to mpv_set_wakeup_callback. My solution is available at: https://github.com/aario/qtible/blob/main/mediaplayer/mpveventloop.cpp void MPVEventLoop::eventLoop() { qInfo() << "Started event loop"; while (1) { if (mustShutdown) break; mpv_event *event = mpv_wait_event(mpv, 0.01); switch (event->event_id) { case MPV_EVENT_NONE: break; case MPV_EVENT_FILE_LOADED: emit fileLoaded(); break; case MPV_EVENT_END_FILE: emit endFile(); break; case MPV_EVENT_PROPERTY_CHANGE: { mpv_event_property *property = (mpv_event_property *)event->data; if (strcmp(property->name, "time-pos") == 0) { if (property->format == MPV_FORMAT_DOUBLE) { emit timePosChanged(*(double *)property->data); } } break; } default: qDebug() << "Ignoring MPV event: " << event->event_id; } } } And then: mpvEventLoop = new MPVEventLoop(mpv); mpvEventLoop->moveToThread(&mpvEventLoopThread); connect(&mpvEventLoopThread, &QThread::finished, mpvEventLoop, &QObject::deleteLater); connect(this, &MediaPlayer::startMPVEventLoop, mpvEventLoop, &MPVEventLoop::eventLoop); connect(mpvEventLoop, &MPVEventLoop::fileLoaded, this, &MediaPlayer::onMpvFileLoaded); connect(mpvEventLoop, &MPVEventLoop::endFile, this, &MediaPlayer::onMpvEndFile); connect(mpvEventLoop, &MPVEventLoop::timePosChanged, this, &MediaPlayer::onMpvTimePosChanged); mpvEventLoopThread.start(); emit startMPVEventLoop();
  • Connect sqlserver 2019 to qt

    Unsolved
    2
    0 Votes
    2 Posts
    225 Views
    JonBJ
    @quangdong01 Hello and welcome. From the error message, is your MS SQL Server even running? Nobody can say anything if you do not even tell us what your ODBC connection string is.... (And I assume you mean this message comes from running your application, not from anything in Qt Creator itself, which is just an IDE.)
  • How do I setup Qt 6.2 on Linux Mint to use GLEW / GLFW

    Solved
    4
    0 Votes
    4 Posts
    592 Views
    C
    @MrShawn It's all working fine now, thanks for your help. I do search online before posting questions but sometimes the little nugget that makes the penny drop is difficult to find.
  • Need a filemanager written in C++/QML for windows plateform

    Unsolved
    2
    0 Votes
    2 Posts
    216 Views
    jsulmJ
    @pingal KDE is written using Qt and it features a file manager (Dolphin, https://apps.kde.org/dolphin/).
  • Disable toplevel item of QTreeWidget

    Unsolved
    11
    0 Votes
    11 Posts
    2k Views
    M
    @JonB Yes, I believe what we are saying is: disabling a QTreeWidgetItem means disabling its descendants, which seems pretty reasonable. It is therefore not possible to have descendants which are themselves enabled. Yes this seems pretty reasonable and expected as a behavior. That's why I suggested all you can use would be selectability (Qt::ItemIsSelectable) as that is allowed to vary such that a parent may be unselectable itself while a descendant is still selectable. I was already playing with this flag (and overriding mouse and keyboards events) for various reasons so my original problem was solely a visual one, so to simulate the graying i used QTreeWidgetItem->setForeground() with a gray color. So far it does what i need (the checkbox of my QTreeWidgetItem isn't grayed out but this detail is so minor that i'm not bothering with that). So i'm calling it quit now.