Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.3k Topics 455.6k Posts
  • Need some helping making sense of QAbstractItemModel

    Unsolved
    2
    0 Votes
    2 Posts
    407 Views
    SGaistS
    Hi and welcome to devnet, You should take a look at the Simple Tree Model Example. It contains a pretty nice explanation on how to write a tree model.
  • Midi library for Qt (Windows)

    Solved
    5
    0 Votes
    5 Posts
    4k Views
    J
    Maybe I'll be doing this way, calling Win32 API directly. I'll check if RtMidi may be of any help before getting started. Thanks for the link.
  • Full screen makes the screen flickers on Windows 8

    Unsolved
    5
    0 Votes
    5 Posts
    1k Views
    bunjee207B
    This is the workaround I'm using with Qt 4: #ifdef Q_OS_WIN // FIXME Windows: Workaround for opengl full screen flicker. q->setViewportMargins(0, 0, -1, 0); #endif Is there something equivalent with the QQuickWindow ? Note: As far as I can tell this is related to Windows 8 + OpenGL + double buffering. I don't have the issue when using single buffering.
  • How to insert a double quotes in a QString?

    5
    0 Votes
    5 Posts
    3k Views
    kshegunovK
    @aha_1980 said in How to insert a double quotes in a QString?: For some reason, qDebug() escapes inline quotes (that may be intentional, haven't investigated). It's intentional, yes. There was a discussion about it, I think on the mailing list, about a year ago or so, I can't seem to dig it up though. But as far as I remember Thiago was adamant this is intended and correct behavior.
  • Header files and general questions.

    Solved
    21
    0 Votes
    21 Posts
    9k Views
    U
    Woo-hoo! It works! Thank you! So, clearly there is a slight change in the code. This explains why it didn't work beforehand. Many thanks!
  • How disable QMouseMoveEvent of QPushButton in user-defined titlebar ?

    Solved
    4
    0 Votes
    4 Posts
    1k Views
    sonichyS
    @Andeol Under your advice, I solved the problem! TitleBar::TitleBar(QWidget *parent) : QWidget(parent) { ... pushButton_minimize->installEventFilter(this); pushButton_maximize->installEventFilter(this); pushButton_close->installEventFilter(this); ... } bool TitleBar::eventFilter(QObject *obj, QEvent *event) { if ( (obj == pushButton_minimize || obj == pushButton_maximize || obj == pushButton_close) && event->type() == QEvent::MouseMove ) { return true; // filter } else { return false; } // pass the event on to the parent class return QWidget::eventFilter(obj, event); }
  • How to use dynamic plugin libqtiff.so in Qt 5.10.0

    Solved
    7
    0 Votes
    7 Posts
    3k Views
    S
    I've gotten it working! Thanks for your help @SGaist . Much appreciated. It looks like the images I'm working with are actually GeoTIFF, not true tiff, so that is where the issue was. Once I downloaded a .tif, I could see and open it.
  • How to record video in windows using Qt?

    Unsolved
    14
    0 Votes
    14 Posts
    6k Views
    SGaistS
    Hi, Depending on the camera type and how it is seen by the system, you may have to write a small QCamera backend but it's doable.
  • Detecting QCandlestickSet in a QList<QGraphicsItem *>

    Unsolved
    4
    0 Votes
    4 Posts
    857 Views
    M
    @Andeol Hi, Maybe I should have started saying that I have a QCandlestickSeries *series where I store financial data. Each single day in the series is stored in its corresponding QCandelstickSets *set. The series is added to a QChart chart and this one presented in a QChartView view. So far everything works since the date is drawn when I press the button. I even reimplemented the QChartView class to have my own zoom command. And that works also. This is the part of the reimplemented class with respect to the zoom: void ChartView::keyPressEvent(QKeyEvent *event) { QRectF rect = chart()->plotArea(); qreal adjustment = rect.width() / 2; switch (event->key()) { case Qt::Key_Up: { //rect.setX(chart()->plotArea().x() + adjustment); rect.adjust(adjustment, 0, 0, 0); chart()->zoomIn(rect); } break; case Qt::Key_Down: . . . As you can see, the zoom is only in the X axis. I would like to zoom the Y axis as well, but in such a way that it takes into account the maximum value of the different sets (QCandlestickSet) that fall inside the x-zoomed area. That is to say, I would like an autoscale in the Y axis to watch the sets as big as possible. To do that, I was thinking on something like: QGraphicsScene *scene = chart()->scene(); QList<QGraphicsItem *> itemList; itemList = scene->items(rect, Qt::IntersectsItemShape, Qt::DescendingOrder); But this is not working, as you guys said before. Thank you very much for your help,
  • 0 Votes
    22 Posts
    6k Views
    SGaistS
    IIRC, you have QTest;:wait for that kind of stuff.
  • Add QChartView using designer

    Unsolved qchartview designer
    3
    1 Votes
    3 Posts
    3k Views
    B
    I know this is an old questin, but at the time of writing, this is still the first hit on my search so hopefully this will help someone else. Promote it from a QGraphicsView as outlined on Stack Overflow, or compile the plug-in. https://stackoverflow.com/questions/48362864/how-to-insert-qchartview-in-form-with-qt-designer
  • QSqlRelationalTableModel sorting incorrectly after MySQL Update

    Unsolved
    10
    0 Votes
    10 Posts
    795 Views
    SGaistS
    No I'm not (It's Qt by the way) And as @VRonin already wrote, using such an old version of Qt (that has seen numerous bug fixes in between) with the latest version of MySQL is not necessarily a good idea. It might be a bug in Qt's MySQL backend as well as something coming from MySQL. Even if you are not planning an upgrade of Qt, you should try with a more recent version to see if things work better. That is a pretty easy way to check whether it's MySQL or Qt that might be at fault. You can also check the bug report system.
  • Qt positioning requirements for Linux

    Solved
    5
    0 Votes
    5 Posts
    999 Views
    A
    @SGaist I see, thank you.
  • what does encodeHighLighting String() method do in qtrpt

    Unsolved
    3
    0 Votes
    3 Posts
    430 Views
    Pablo J. RoginaP
    @Mahesh-Arrajella it looks like QtRPT project has a forum of its own, so you may want to check there all your concerns regarding such project. As @jsulm mentioned, QtRPT is not an official Qt module.
  • Qt 4.8, How to send signal from different thread?

    Unsolved
    3
    0 Votes
    3 Posts
    497 Views
    AndeolA
    I think your method should work. But I don't see the declaration for your dummy_signal. In timer_class header file, you should have signals: void dummy_signal(); I'm surprised your compiler doesn't complain if that's not the case. Also, you define on_timeout_occur both in the header and the cpp? I guess that's just a copy-paste issue. You put your .cpp content also in the .h
  • QStyledItemDelegate painting problem with QComboBox

    Solved
    6
    0 Votes
    6 Posts
    3k Views
    gde23G
    @raven-worx removing editor->setFrame(false); did the trick. Thanks a lot. Setting a stylesheet was not required. @VRonin: Thaks as well, those were some leftovers from trying out different things..
  • 0 Votes
    2 Posts
    1k Views
    AndeolA
    Hi, If you inherit from QListWidget, you can override the keyPressEvent() function, and handle the press on D however you want. Something like: // Class declaration. Inherit from QlstWidget class MyWidget : public QlstWidget { protected: void keyPressEvent(QKeyEvent *event) ; } // And implement the keyPressEvent method MyWidget::keyPressEvent(QKeyEvent *event) { if(event->key() == Qt::key_D) { //disable item from the list } else { // call the native function in any other case (or don't, if you never care about the QlstWidget receiving other key events) Qlstwidget::keyPressEvent(event); } If you don't want to derive your own class from Qlstwidget, you can also use an eventfilter (http://doc.qt.io/qt-5/qobject.html#installEventFilter). Eventfilters allow you to "intercept" the event destined to another widget. You can then decide to call some methods depending on this event, and then relay the item to its original destination (if desired).
  • QModelIndex selection causes application crash

    Unsolved
    3
    0 Votes
    3 Posts
    645 Views
    SGaistS
    Hi, To add to @mrjj, you are testing if model is equal zero, if so you write some log and then go on using it, that will surely crash. You should stop there. By the way, there's no need for frmPatnient to be allocated on the heap since you destroy it at the end anyway. Just allocate it on the stack.
  • No Service found error for Mediaplayer in Ubuntu 16.04

    Unsolved
    4
    0 Votes
    4 Posts
    642 Views
    raven-worxR
    @Sherlin-N-G see this for example You need to rebuild qtmultimedia with gstreamer-1.0 support (by default it's built against gstreamer-0.10)
  • Take 2 images ImageLayer1.png and ImageLayer2.jpeg and convert to .PSD File with layers

    Unsolved
    4
    0 Votes
    4 Posts
    700 Views
    mrjjM
    Hi Just as a note: If you just need something up and running, you can also use ImageMagick http://www.imagemagick.org/discourse-server/viewtopic.php?t=32083 (not the API, just the commandline tool)