I'm trying to use it, but, <QWinHost> <qwinhost.h> can't be found, how i can include it ?
Printable View
I'm trying to use it, but, <QWinHost> <qwinhost.h> can't be found, how i can include it ?
That is not part of the Qt framework, it's from Qt solutions, source can be found here.
Thanks ^^, I'm using it, but now, with another problem.
Code:
QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const { qgl->setMargin(0); HotKeyEditor* e = new HotKeyEditor(w); qgl->addWidget(e); return w; }
And, the hotkey command finally loaded, but, it's messages isn't responding
I can press any key, or click, and it's only lose focus and the TableWidget stops the editing of the cell.
Why this is happening ?
The class code:
Code:
class HotKeyEditor : public QWinHost { Q_OBJECT public: virtual ~HotKeyEditor(); protected: virtual HWND createWindow(HWND parent, HINSTANCE instance); };
Code:
QWinHost(parent) { this->resize(100, 20); } HotKeyEditor::~HotKeyEditor() { } HWND HotKeyEditor::createWindow(HWND parent, HINSTANCE instance) { HWND wnd = CreateWindowExA(0, HOTKEY_CLASSA, "", WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, parent, 0, instance, 0); HFONT font = CreateFontA(14, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_OUTLINE_PRECIS, CLIP_DEFAULT_PRECIS, CLEARTYPE_QUALITY, VARIABLE_PITCH, 0); SendMessageA(wnd, WM_SETFONT, (WPARAM)font, 0); SendMessageA(wnd, WM_SETFOCUS, 0, 0); return wnd; }
EDIT:
The code works if the host is outside the delegate in TableWidget, but, i need it for editing the cell