Skip to content

General and Desktop

This is where all the desktop OS and general Qt questions belong.
83.6k Topics 457.7k Posts
  • [SOLVED] Conversion from 'QByteArray' to 'const uchar*' is ambiguous?

    10
    0 Votes
    10 Posts
    10k Views
    ?
    Yes, it was in the paint event... anyway... Thanks the color table really did the trick for me. My goal was basically this: !http://i41.tinypic.com/2cp9tw7.jpg(this)! Using a grayscale image as a brush stencil prototype and colorizing it with a user selected color, creating another pixmap that uses the prototype for alpha. I really didn't expect this to take two hours LOL :D
  • [Solved] Qt text rendering issue on windows xp korean version

    8
    0 Votes
    8 Posts
    5k Views
    J
    did my first bug report. "here":https://bugreports.qt-project.org/browse/QTBUG-24924 feels good no matter it could help or not. thanks.
  • QTableView/QAbstractTableModel Text disappears after double click

    6
    0 Votes
    6 Posts
    7k Views
    J
    My solution so far: @// views is a of type QTableView* QAbstractItemDelegate *itemDelegate = view->itemDelegate(); // Not sure why this is QStyledItemDelegate and not just QItemDelegate. // But QStyledItemDelegate also offers setItemEditorFactory(..) so this // is fine. assert(typeid(QStyledItemDelegate) == typeid(*itemDelegate)); QStyledItemDelegate *styledItemDelegate = dynamic_cast<QStyledItemDelegate *>(itemDelegate); QItemEditorFactory *editorFactory = new QItemEditorFactory; // "plainText" is the name of the property of the QPlainTextEdit which // contains the editing data. QItemEditorCreatorBase *creator = new QItemEditorCreator<QPlainTextEdit>("plainText"); editorFactory->registerEditor(QVariant::String, creator); styledItemDelegate->setItemEditorFactory(editorFactory);@ Now I also need to figure out how to place the cursor correctly, right now it is always before the beginning of the string.
  • How to properly clear and change layouts?

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Regarding mouse move events

    2
    0 Votes
    2 Posts
    2k Views
    A
    To get mouse move events without having a button pressed, you need to enable mouseTracking. See [[doc:QWidget]] for details.
  • 0 Votes
    2 Posts
    2k Views
    A
    You'll need to somehow expose in your model that a cell is considdered 'changed'. That probably means using a data role for that. You can then let your delegate handle that data role, or just a simple proxy model to set the background role for these cells as well.
  • 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
    777 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.