Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.4k Topics 456.4k Posts
  • 0 Votes
    4 Posts
    2k Views
    R
    Yes that's it, and only re-enable it once an actual read or an actual write occurs. You can easily do in the proper read/write methods.
  • SetIcon for QTreeWidgetItem

    2
    0 Votes
    2 Posts
    3k Views
    A
    In second code I replace @item->setIcon(1,QPixmap(":/Images/New.png"));@ by @item->setIcon(1,QIcon(":/Images/New.png"));@ and now it's begin to work. But what that was ? All these two piece of code is in on class and currently used. Second piece I add after upgrading to MSVS 2010. But even when I change image in first piece(writed in MSVS 2008) to different from resources it still works.
  • Qt QNetworkRequest::RedirectionTargetAttribute can't detect redirection

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • QDir with nameFilters

    3
    0 Votes
    3 Posts
    1k Views
    P
    Try: QFileInfoList QDir::entryInfoList ( Filters filters = NoFilter, SortFlags sort = NoSort ) const; and set filters to: QDir::Files and then You can use filter on file list I'm not sure if this shows files from 'recursive' directories, but might work. rob
  • QSpinBox doesn't emit valueChanged signal when value is 0 [SOLVED]

    3
    0 Votes
    3 Posts
    4k Views
    M
    Your point is right... there is no way to correct the value before leaving the focus out of the spinbox and without interfering with the user... I subclassed the SpinBox and handled the keyboardevents myself to achieve this, in a similar way to your suggestion. Thank you for your answer.
  • If ((parent = newParent)) - seriously?

    3
    0 Votes
    3 Posts
    1k Views
    A
    Thanks. In the meantime, I found that when changing the boundingRect prior to setParentItem, setParentItem fails (the new parent isn't set). I don't understand it, and couldn't even see the issue when debugging. However, setting the boundingRect after setParentItem is good enough for me. Also, setting a new parent that has ItemClipsChildrenToShape set causes repaint issues.
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    3 Posts
    2k Views
    K
    If you're working with QThreads for the first time you should have a look at "the new QThread documentation":http://doc-snapshot.qt-project.org/5.0/qthread.html which has been updated for Qt 5. You don't need to use Qt 5 for your code to work like this. The way to work with QThreads as described in the new documentation works with all Qt versions starting from 4.4. Most important thing to consider is: if you can avoid it DO NOT SUBCLASS QTHREAD.
  • Unit Conversion in Table-Model link?

    8
    0 Votes
    8 Posts
    4k Views
    A
    You are right, the class QProxyModel is obsolute, but it's cousins are not. Proxy model is a bit of a generic term. I'd recommend you base your proxy off [[doc:QIdentityProxyModel]] if you're using Qt 4.8 or up, and QSortFilterProxyModel otherwise. I usually #ifdef the base class for such proxies based on the Qt version, so the class will work in either case. If a whole column represents the same PQ, then I'd considder giving that (and the unit) information as a role for the header, as well as as a role for each individual item. The latter may seem a duplication, but it will make it easier to get the PQ and unit if you just have a QModelIndex to your data. In your proxy, you can use the knowledge to set up a simple mapping per column. Perhaps something like this: if the source model for the proxy provides a PQ and unit for the header of a column, use that for all items in that column; if the source model does not provide a PQ and unit for the header, try and see if there is a PQ and unit for the item itself. If so, use that; if not, do not convert. That way, you can set up a default mapping for basically all your data by iterating over the headers of the source model once, avoiding endless calls to find out the PQ and unit for each item every time. However, you're still flexible to change in case you decide that your source data for a particular column is not uniform. For using multiple views on the same data, using proxy models is perfect. You'd give each view its own proxy model, set the unit system on it you want, and set the same base (SI) model on each of the proxies. That way, all views view the same data, just with their units converted. Multiple header rows is going to be complicated to achieve.
  • Solved: time measurement

    12
    0 Votes
    12 Posts
    12k Views
    R
    It works well using utcenter's comment, better than using cv::gettickcount and cv::gettickfrequency in my case. Thanks.
  • MySQL Database Connection Problem on Linux

    6
    1 Votes
    6 Posts
    8k Views
    Q
    hi. my problem is this: QSqlDatabase: QMYSQL driver not loaded QSqlDatabase: availabe driver: QSQLITE and I installed. libqt4-sql-mysql but nothing happens I'm working on Ubuntu 11.04. thanks.
  • Is it a bug on QTimeEdit?

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Removing dependency for mingwm10.dll & libgcc_s_dw2.dll

    4
    0 Votes
    4 Posts
    2k Views
    X
    [quote author="Gerolf" date="1351065253"]You can only link the mingw redist. stuff statically, if you also use Qt statically linked. Otherwise the Qt dll do not find the stuff out of that libs.[/quote] Alright, thank you for your answer! :)
  • Different behaviors code compiled against Qt5 and Qt4

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Hover events are not recognized correctly on Mac OS X

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • QWidget The specified module could not be found QObject

    6
    0 Votes
    6 Posts
    3k Views
    U
    Should any unfortunate soul be cursed to wander this path know there is victory in adding the dll of the offending library (in my case it was Timer.dll, which was never present in the error message) to the QTCreator/bin directory. Regards,
  • Runtime Translation of Multiple Inheritance Approach Dialog

    4
    0 Votes
    4 Posts
    2k Views
    G
    You have to do it in every dialog I think.
  • 0 Votes
    9 Posts
    6k Views
    R
    To follow utcenter's advice, I did implement a new widget. See http://richelbilderbeek.nl/CppExerciseQtHideAndShow3Answer.htm for the QtHideAndShowDialog class.
  • 0 Votes
    1 Posts
    1k Views
    No one has replied
  • QextSerialPort CommEvent overlapped write error: 170

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied