Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.8k Posts
  • How to detect key press from outside of Qt program ?

    13
    0 Votes
    13 Posts
    8k Views
    A
    MSDN is a good starting point: http://msdn.microsoft.com/en-us/library/windows/desktop/ms645536(v=vs.85).aspx In "using raw input", there are a few examples.
  • 0 Votes
    3 Posts
    6k Views
    K
    Thanks, that suggestion worked well. Here's a code sample in case anyone else wants to do something similar: @class custom_table(QtGui.QTableWidget): def __init__(self, parent=None): QtGui.QTableWidget.__init__(self, parent) self.chkbox1 = QtGui.QCheckBox(self.horizontalHeader()) def resizeEvent(self, event=None): super().resizeEvent(event) self.chkbox1.setGeometry(QtCore.QRect((self.columnWidth(0)/2), 2, 16, 17))@ The "(self.columnWidth(0)/2)" keeps the checkbox in the middle of the column header.
  • QTreeView drag&drop question

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • How can I use QX11Info to make a custom dock bar. (like KDE)

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • [SOLVED] Color Gradient for QBrush customization (Qwt Plot Background)

    3
    0 Votes
    3 Posts
    4k Views
    V
    exactly what i was looking for, even lets you do multiple colors! and unfortunately google was of no help with pointing me to this gold mine. Thanks!
  • [SOLVED] QTcpSocket Threading issue...

    10
    0 Votes
    10 Posts
    15k Views
    V
    Right, well thank you. my problem is solved! Much appreciated.
  • My widget is always “invisible” although it's “alwaysOnTop”

    1
    0 Votes
    1 Posts
    778 Views
    No one has replied
  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • Problem in masking the widget?[solved]

    3
    0 Votes
    3 Posts
    1k Views
    M
    Glad you were able to find a solution! Please edit your title post and add [Solved]. Thanks!
  • QTableWidgetItem and setCheckState

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Warning: No relevant classes found. No output generated.

    8
    0 Votes
    8 Posts
    16k Views
    A
    Thanks! Your short list is a better documentation than anything I have found so far. "qws" sounds promising, maybe this is exactly what I need.
  • [Solved] Customizing QRadioButton

    2
    0 Votes
    2 Posts
    9k Views
    M
    See "here.":http://qt-project.org/doc/qt-4.8/stylesheet-examples.html#customizing-qradiobutton
  • What is the best way to show in progress bar the progress of file upload?

    4
    0 Votes
    4 Posts
    5k Views
    JeroentjehomeJ
    If you use a file you might want to use this: sendProgress->setValue( (fileToSend->pos() * 100) / fileToSend->size()); The pos() functions comes from the QIODevice class, but it is inherited by QFile.
  • Debugging Qt - Only Qt and Windows functions/dlls in the stack trace

    5
    0 Votes
    5 Posts
    4k Views
    J
    bq. I guess you have checked already some ms fora for a solution? Well I checked stackoverflow.com. So if you are debugging on a Mac or Linux with gdb and type bt you will get always a useful stack trace? I have to point out, that in my case we develop extensions for an already existing application. Qt and the extension are loaded via dll into another program. Because of this I think the call stack is even larger, than it would be for a "normal" Qt app.
  • [SOLVED] QSignalMapper and QComboBox

    2
    0 Votes
    2 Posts
    3k Views
    L
    QSignalMapper is used to combine multiple signals from different widgets into one signal, for example if you want to change the text of a label from the values of multiple combo boxes. If you just want to set the label to the value of a combo box use the currentIndexChanged signal instead. @ connect(comboBox, SIGNAL(currentIndexChanged(QString)), label, SLOT(setText(QString))); @ In addition to the documentation you might read "this article":http://doc.trolltech.com/qq/qq10-signalmapper.html featuring the purpose and usage of QSignalMapper.
  • QFileInfo::isExecutable() returns true for dirs

    4
    0 Votes
    4 Posts
    2k Views
    M
    You could try changing the permission on a directory to see if I'm right but I'm quite sure that this is the expected behavior.
  • QSqlTableModel column to QStringList

    6
    0 Votes
    6 Posts
    3k Views
    G
    What do you gain, if you method is fast, but wrong? Nothing than pain in the future! Premature optimization is the cause of many evil! Make your method work correctly first, and then do optimizations and only if you run into performance issues! ++r or r++ is negligible in that case. Ask Google for the myriads of performance discussions on this topic please.
  • QLabel text

    7
    0 Votes
    7 Posts
    6k Views
    L
    There are various ways - depending on the design of your application. The obvious one is passing the label to TextController in the constructor, using a setter or a combination of both. @ class TextController { public: TextController(QLabel *label) : label_(label) { } void setLabel(QLabel *label) { label_ = label; } QLabel *label() const { return label_; } void Print() { if(label_ != 0) { cout << label->text().toStdString(); } } private: QLabel *label_; } .... TextController myTextController(myLabel); .... myTextController.setLabel(myLabel); @
  • QTableView and Checkable data

    11
    0 Votes
    11 Posts
    13k Views
    G
    [quote author="Sidny Sho" date="1332273888"]Ok, I set setCheckable(true) for first column and how I get namber or index of checked?[/quote] UseQStandardItemModel::findItems() or QAbstractItemModel::match().
  • Toast messages as in Android

    2
    0 Votes
    2 Posts
    3k Views
    J
    You can create a custom widget with desired text/progress bar etc, and add a thread to process, or process without a thread ( OS will treat program as not responding, if there is a lot to process). Hope it helped. Regards, Jake