Merge branch 'qt-fixes'
See https://github.com/wxWidgets/wxWidgets/pull/589 Closes https://github.com/wxWidgets/wxWidgets/pull/319
This commit is contained in:
commit
c212941ad5
121 changed files with 1232 additions and 579 deletions
20
Makefile.in
20
Makefile.in
|
|
@ -5036,6 +5036,7 @@ COND_TOOLKIT_QT___LOWLEVEL_SRC_OBJECTS = \
|
|||
monodll_qt_msgdlg.o \
|
||||
monodll_qt_notebook.o \
|
||||
monodll_qt_palette.o \
|
||||
monodll_qt_nonownedwnd.o \
|
||||
monodll_qt_pen.o \
|
||||
monodll_qt_popupwin.o \
|
||||
monodll_qt_printdlg.o \
|
||||
|
|
@ -5744,6 +5745,7 @@ COND_TOOLKIT_QT___LOWLEVEL_SRC_OBJECTS_1 = \
|
|||
monodll_qt_msgdlg.o \
|
||||
monodll_qt_notebook.o \
|
||||
monodll_qt_palette.o \
|
||||
monodll_qt_nonownedwnd.o \
|
||||
monodll_qt_pen.o \
|
||||
monodll_qt_popupwin.o \
|
||||
monodll_qt_printdlg.o \
|
||||
|
|
@ -7060,6 +7062,7 @@ COND_TOOLKIT_QT___LOWLEVEL_SRC_OBJECTS_2 = \
|
|||
monolib_qt_msgdlg.o \
|
||||
monolib_qt_notebook.o \
|
||||
monolib_qt_palette.o \
|
||||
monolib_qt_nonownedwnd.o \
|
||||
monolib_qt_pen.o \
|
||||
monolib_qt_popupwin.o \
|
||||
monolib_qt_printdlg.o \
|
||||
|
|
@ -7768,6 +7771,7 @@ COND_TOOLKIT_QT___LOWLEVEL_SRC_OBJECTS_3 = \
|
|||
monolib_qt_msgdlg.o \
|
||||
monolib_qt_notebook.o \
|
||||
monolib_qt_palette.o \
|
||||
monolib_qt_nonownedwnd.o \
|
||||
monolib_qt_pen.o \
|
||||
monolib_qt_popupwin.o \
|
||||
monolib_qt_printdlg.o \
|
||||
|
|
@ -9228,6 +9232,7 @@ COND_TOOLKIT_QT___LOWLEVEL_SRC_OBJECTS_4 = \
|
|||
coredll_qt_msgdlg.o \
|
||||
coredll_qt_notebook.o \
|
||||
coredll_qt_palette.o \
|
||||
coredll_qt_nonownedwnd.o \
|
||||
coredll_qt_pen.o \
|
||||
coredll_qt_popupwin.o \
|
||||
coredll_qt_printdlg.o \
|
||||
|
|
@ -9936,6 +9941,7 @@ COND_TOOLKIT_QT___LOWLEVEL_SRC_OBJECTS_5 = \
|
|||
coredll_qt_msgdlg.o \
|
||||
coredll_qt_notebook.o \
|
||||
coredll_qt_palette.o \
|
||||
coredll_qt_nonownedwnd.o \
|
||||
coredll_qt_pen.o \
|
||||
coredll_qt_popupwin.o \
|
||||
coredll_qt_printdlg.o \
|
||||
|
|
@ -10704,6 +10710,7 @@ COND_TOOLKIT_QT___LOWLEVEL_SRC_OBJECTS_6 = \
|
|||
corelib_qt_msgdlg.o \
|
||||
corelib_qt_notebook.o \
|
||||
corelib_qt_palette.o \
|
||||
corelib_qt_nonownedwnd.o \
|
||||
corelib_qt_pen.o \
|
||||
corelib_qt_popupwin.o \
|
||||
corelib_qt_printdlg.o \
|
||||
|
|
@ -11412,6 +11419,7 @@ COND_TOOLKIT_QT___LOWLEVEL_SRC_OBJECTS_7 = \
|
|||
corelib_qt_msgdlg.o \
|
||||
corelib_qt_notebook.o \
|
||||
corelib_qt_palette.o \
|
||||
corelib_qt_nonownedwnd.o \
|
||||
corelib_qt_pen.o \
|
||||
corelib_qt_popupwin.o \
|
||||
corelib_qt_printdlg.o \
|
||||
|
|
@ -18730,6 +18738,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
|
|||
@COND_TOOLKIT_QT_USE_GUI_1@monodll_qt_palette.o: $(srcdir)/src/qt/palette.cpp $(MONODLL_ODEP)
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/qt/palette.cpp
|
||||
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@monodll_qt_nonownedwnd.o: $(srcdir)/src/qt/nonownedwnd.cpp $(MONODLL_ODEP)
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/qt/nonownedwnd.cpp
|
||||
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@monodll_qt_pen.o: $(srcdir)/src/qt/pen.cpp $(MONODLL_ODEP)
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/qt/pen.cpp
|
||||
|
||||
|
|
@ -23587,6 +23598,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
|
|||
@COND_TOOLKIT_QT_USE_GUI_1@monolib_qt_palette.o: $(srcdir)/src/qt/palette.cpp $(MONOLIB_ODEP)
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/qt/palette.cpp
|
||||
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@monolib_qt_nonownedwnd.o: $(srcdir)/src/qt/nonownedwnd.cpp $(MONOLIB_ODEP)
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/qt/nonownedwnd.cpp
|
||||
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@monolib_qt_pen.o: $(srcdir)/src/qt/pen.cpp $(MONOLIB_ODEP)
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/qt/pen.cpp
|
||||
|
||||
|
|
@ -28510,6 +28524,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
|
|||
@COND_TOOLKIT_QT_USE_GUI_1@coredll_qt_palette.o: $(srcdir)/src/qt/palette.cpp $(COREDLL_ODEP)
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/qt/palette.cpp
|
||||
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@coredll_qt_nonownedwnd.o: $(srcdir)/src/qt/nonownedwnd.cpp $(COREDLL_ODEP)
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/qt/nonownedwnd.cpp
|
||||
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@coredll_qt_pen.o: $(srcdir)/src/qt/pen.cpp $(COREDLL_ODEP)
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/qt/pen.cpp
|
||||
|
||||
|
|
@ -31909,6 +31926,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
|
|||
@COND_TOOLKIT_QT_USE_GUI_1@corelib_qt_palette.o: $(srcdir)/src/qt/palette.cpp $(CORELIB_ODEP)
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/qt/palette.cpp
|
||||
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@corelib_qt_nonownedwnd.o: $(srcdir)/src/qt/nonownedwnd.cpp $(CORELIB_ODEP)
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/qt/nonownedwnd.cpp
|
||||
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@corelib_qt_pen.o: $(srcdir)/src/qt/pen.cpp $(CORELIB_ODEP)
|
||||
@COND_TOOLKIT_QT_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/qt/pen.cpp
|
||||
|
||||
|
|
|
|||
|
|
@ -380,6 +380,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
|
|||
src/qt/msgdlg.cpp
|
||||
src/qt/notebook.cpp
|
||||
src/qt/palette.cpp
|
||||
src/qt/nonownedwnd.cpp
|
||||
src/qt/pen.cpp
|
||||
src/qt/popupwin.cpp
|
||||
src/qt/printdlg.cpp
|
||||
|
|
|
|||
2
configure
vendored
2
configure
vendored
|
|
@ -24062,7 +24062,7 @@ $as_echo "yes" >&6; }
|
|||
GUI_TK_LIBRARY="${GUI_TK_LIBRARY} ${QT5_LIBS}"
|
||||
if `pkg-config --variable qt_config Qt5Core | grep "reduce_relocations" >/dev/null`; then
|
||||
SAMPLES_CXXFLAGS="-fPIC $SAMPLES_CXXFLAGS"
|
||||
WXCONFIG_CXXFLAGS="-fPIC $WXCONFIG_CXXFLAGS $TOOLKIT_INCLUDE"
|
||||
WXCONFIG_CXXFLAGS="-fPIC $WXCONFIG_CXXFLAGS"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -3322,7 +3322,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
|||
if `pkg-config --variable qt_config Qt5Core | grep "reduce_relocations" >/dev/null`; then
|
||||
dnl build with position independent code if Qt needs it
|
||||
SAMPLES_CXXFLAGS="-fPIC $SAMPLES_CXXFLAGS"
|
||||
WXCONFIG_CXXFLAGS="-fPIC $WXCONFIG_CXXFLAGS $TOOLKIT_INCLUDE"
|
||||
WXCONFIG_CXXFLAGS="-fPIC $WXCONFIG_CXXFLAGS"
|
||||
fi
|
||||
],
|
||||
[
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
// resources
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__)
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__) || defined(__WXX11__) || defined(__WXQT__)
|
||||
// application icon
|
||||
#include "mondrian.xpm"
|
||||
|
||||
|
|
|
|||
|
|
@ -255,6 +255,11 @@ wxOSX:
|
|||
- Fix updating radio groups when menu item is inserted/removed from wxMenu.
|
||||
- Allow changing alignment styles after wxTextCtrl creation (Andreas Falkenhahn).
|
||||
|
||||
wxQt
|
||||
|
||||
- Many changes and improvements by Sean D'Epagnier merged into trunk (with
|
||||
help from R.J.V. Bertin).
|
||||
|
||||
Unix:
|
||||
|
||||
- Support new gstreamer API in 1.7.2+ in wxMediaCtrl (Sebastian Dröge).
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ DECLARE_VARIANT_OBJECT_EXPORTED(wxColour,WXDLLIMPEXP_CORE)
|
|||
not need the wxGDIObject machinery to handle colors, please add it to the
|
||||
list of ports which do not need it.
|
||||
*/
|
||||
#if defined( __WXMAC__ ) || defined( __WXMSW__ )
|
||||
#if defined( __WXMAC__ ) || defined( __WXMSW__ ) || defined( __WXQT__ )
|
||||
#define wxCOLOUR_IS_GDIOBJECT 0
|
||||
#else
|
||||
#define wxCOLOUR_IS_GDIOBJECT 1
|
||||
|
|
|
|||
|
|
@ -102,6 +102,8 @@ protected:
|
|||
#include "wx/osx/nonownedwnd.h"
|
||||
#elif defined(__WXMSW__)
|
||||
#include "wx/msw/nonownedwnd.h"
|
||||
#elif defined(__WXQT__)
|
||||
#include "wx/qt/nonownedwnd.h"
|
||||
#else
|
||||
// No special class needed in other ports, they can derive both wxTLW and
|
||||
// wxPopupWindow directly from wxWindow and don't implement SetShape().
|
||||
|
|
|
|||
|
|
@ -9,9 +9,6 @@
|
|||
#ifndef _WX_QT_ACCEL_H_
|
||||
#define _WX_QT_ACCEL_H_
|
||||
|
||||
#include <QtCore/QList>
|
||||
#include <QtWidgets/QShortcut>
|
||||
|
||||
/* wxQt accelerators implementation:
|
||||
*
|
||||
* Storing:
|
||||
|
|
@ -36,6 +33,9 @@
|
|||
* QShortcut. This handler will finally create and send the appropriate wx
|
||||
* event to the window. */
|
||||
|
||||
class QShortcut;
|
||||
template < class T > class QList;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxAcceleratorTable : public wxObject
|
||||
{
|
||||
public:
|
||||
|
|
@ -43,7 +43,7 @@ public:
|
|||
wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]);
|
||||
|
||||
// Implementation
|
||||
QList< QShortcut* > ConvertShortcutTable( QWidget *parent ) const;
|
||||
QList < QShortcut* > *ConvertShortcutTable( QWidget *parent ) const;
|
||||
|
||||
bool Ok() const { return IsOk(); }
|
||||
bool IsOk() const;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#ifndef _WX_QT_ANYBUTTON_H_
|
||||
#define _WX_QT_ANYBUTTON_H_
|
||||
|
||||
#include <QtWidgets/QPushButton>
|
||||
class QPushButton;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxAnyButton
|
||||
|
|
@ -28,7 +28,7 @@ public:
|
|||
virtual void SetLabel( const wxString &label );
|
||||
virtual void DoSetBitmap(const wxBitmap& bitmap, State which);
|
||||
|
||||
virtual QPushButton *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@
|
|||
#ifndef _WX_QT_APP_H_
|
||||
#define _WX_QT_APP_H_
|
||||
|
||||
#include <QtWidgets/QApplication>
|
||||
|
||||
class QApplication;
|
||||
class WXDLLIMPEXP_CORE wxApp : public wxAppBase
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -86,13 +86,14 @@ protected:
|
|||
wxDECLARE_DYNAMIC_CLASS(wxBitmap);
|
||||
};
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMask : public wxObject
|
||||
class WXDLLIMPEXP_CORE wxMask : public wxMaskBase
|
||||
{
|
||||
public:
|
||||
wxMask();
|
||||
|
||||
// Copy constructor
|
||||
wxMask(const wxMask &mask);
|
||||
wxMask& operator=(const wxMask &mask);
|
||||
|
||||
// Construct a mask from a bitmap and a colour indicating the transparent
|
||||
// area
|
||||
|
|
@ -104,19 +105,20 @@ public:
|
|||
|
||||
// Construct a mask from a mono bitmap (copies the bitmap).
|
||||
wxMask(const wxBitmap& bitmap);
|
||||
|
||||
|
||||
virtual ~wxMask();
|
||||
|
||||
bool Create(const wxBitmap& bitmap, const wxColour& colour);
|
||||
bool Create(const wxBitmap& bitmap, int paletteIndex);
|
||||
bool Create(const wxBitmap& bitmap);
|
||||
|
||||
wxBitmap GetBitmap() const;
|
||||
|
||||
// Implementation
|
||||
QBitmap *GetHandle() const;
|
||||
|
||||
protected:
|
||||
// this function is called from Create() to free the existing mask data
|
||||
void FreeData();
|
||||
// by the public wrappers
|
||||
bool InitFromColour(const wxBitmap& bitmap, const wxColour& colour);
|
||||
bool InitFromMonoBitmap(const wxBitmap& bitmap);
|
||||
|
||||
wxBitmap GetBitmap() const;
|
||||
|
||||
protected:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxMask);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@
|
|||
#ifndef _WX_QT_BRUSH_H_
|
||||
#define _WX_QT_BRUSH_H_
|
||||
|
||||
#include <QtCore/Qt>
|
||||
|
||||
class QBrush;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxBrush : public wxBrushBase
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#define _WX_QT_CALCTRL_H_
|
||||
|
||||
#include "wx/calctrl.h"
|
||||
#include <QtWidgets/QCalendarWidget>
|
||||
class QCalendarWidget;
|
||||
|
||||
class WXDLLIMPEXP_ADV wxCalendarCtrl : public wxCalendarCtrlBase
|
||||
{
|
||||
|
|
@ -70,7 +70,7 @@ public:
|
|||
|
||||
using wxCalendarCtrlBase::GenerateAllChangeEvents;
|
||||
|
||||
virtual QCalendarWidget *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
protected:
|
||||
virtual void RefreshHolidays();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _WX_QT_CHECKBOX_H_
|
||||
#define _WX_QT_CHECKBOX_H_
|
||||
|
||||
#include <QtWidgets/QCheckBox>
|
||||
class QCheckBox;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxCheckBox : public wxCheckBoxBase
|
||||
{
|
||||
|
|
@ -32,7 +32,7 @@ public:
|
|||
virtual void SetValue(bool value);
|
||||
virtual bool GetValue() const;
|
||||
|
||||
virtual QCheckBox *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
protected:
|
||||
virtual void DoSet3StateValue(wxCheckBoxState state);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _WX_QT_CHOICE_H_
|
||||
#define _WX_QT_CHOICE_H_
|
||||
|
||||
#include <QtWidgets/QComboBox>
|
||||
class QComboBox;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxChoice : public wxChoiceBase
|
||||
{
|
||||
|
|
@ -56,7 +56,7 @@ public:
|
|||
virtual void SetSelection(int n);
|
||||
virtual int GetSelection() const;
|
||||
|
||||
virtual QComboBox *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
protected:
|
||||
virtual int DoInsertItems(const wxArrayStringsAdapter & items,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "wx/dialog.h"
|
||||
|
||||
#include <QtWidgets/QColorDialog>
|
||||
class QColorDialog;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxColourDialog : public wxDialog
|
||||
{
|
||||
|
|
@ -23,9 +23,8 @@ public:
|
|||
|
||||
wxColourData &GetColourData();
|
||||
|
||||
QColorDialog *GetHandle() const { return static_cast<QColorDialog *>(m_qtWindow); }
|
||||
|
||||
private:
|
||||
QColorDialog *GetQColorDialog() const;
|
||||
|
||||
wxColourData m_data;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -10,37 +10,35 @@
|
|||
#ifndef _WX_QT_COLOUR_H_
|
||||
#define _WX_QT_COLOUR_H_
|
||||
|
||||
#include <QtGui/QColor>
|
||||
class QColor;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxColour : public wxColourBase
|
||||
{
|
||||
public:
|
||||
DEFINE_STD_WXCOLOUR_CONSTRUCTORS
|
||||
wxColour(const QColor& color) : m_qtColor(color) {}
|
||||
wxColour(const QColor& color);
|
||||
|
||||
virtual bool IsOk() const { return m_qtColor.isValid(); }
|
||||
virtual bool IsOk() const { return m_valid; }
|
||||
|
||||
unsigned char Red() const { return m_qtColor.red(); }
|
||||
unsigned char Green() const { return m_qtColor.green(); }
|
||||
unsigned char Blue() const { return m_qtColor.blue(); }
|
||||
unsigned char Alpha() const { return m_qtColor.alpha(); }
|
||||
ChannelType Red() const { return m_red; }
|
||||
ChannelType Green() const { return m_green; }
|
||||
ChannelType Blue() const { return m_blue; }
|
||||
ChannelType Alpha() const { return m_alpha; }
|
||||
|
||||
bool operator==(const wxColour& color) const
|
||||
{ return m_qtColor == color.m_qtColor; }
|
||||
bool operator!=(const wxColour& color) const
|
||||
{ return m_qtColor != color.m_qtColor; }
|
||||
bool operator==(const wxColour& color) const;
|
||||
bool operator!=(const wxColour& color) const;
|
||||
|
||||
int GetPixel() const;
|
||||
|
||||
QColor GetHandle() const { return m_qtColor; };
|
||||
QColor GetQColor() const;
|
||||
|
||||
protected:
|
||||
virtual void
|
||||
InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a)
|
||||
{ m_qtColor.setRgb(r, g, b, a); }
|
||||
void Init();
|
||||
virtual void InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a);
|
||||
|
||||
private:
|
||||
QColor m_qtColor;
|
||||
ChannelType m_red, m_green, m_blue, m_alpha;
|
||||
bool m_valid;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxColour);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#define _WX_QT_COMBOBOX_H_
|
||||
|
||||
#include "wx/choice.h"
|
||||
#include <QtWidgets/QComboBox>
|
||||
class QComboBox;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxComboBox : public wxChoice, public wxTextEntry
|
||||
{
|
||||
|
|
@ -52,18 +52,18 @@ public:
|
|||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
|
||||
virtual void SetSelection(int n) { wxChoice::SetSelection(n); }
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void SetSelection(int n) wxOVERRIDE { wxChoice::SetSelection(n); }
|
||||
virtual void SetSelection(long from, long to) wxOVERRIDE;
|
||||
|
||||
virtual int GetSelection() const { return wxChoice::GetSelection(); }
|
||||
virtual void GetSelection(long *from, long *to) const;
|
||||
virtual int GetSelection() const wxOVERRIDE { return wxChoice::GetSelection(); }
|
||||
virtual void GetSelection(long *from, long *to) const wxOVERRIDE;
|
||||
|
||||
virtual wxString GetStringSelection() const
|
||||
virtual wxString GetStringSelection() const wxOVERRIDE
|
||||
{
|
||||
return wxItemContainer::GetStringSelection();
|
||||
}
|
||||
|
||||
virtual void Clear()
|
||||
virtual void Clear() wxOVERRIDE
|
||||
{
|
||||
wxTextEntry::Clear();
|
||||
wxItemContainer::Clear();
|
||||
|
|
@ -79,7 +79,7 @@ public:
|
|||
protected:
|
||||
|
||||
// From wxTextEntry:
|
||||
virtual wxString DoGetValue() const;
|
||||
virtual wxString DoGetValue() const wxOVERRIDE;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
|||
|
|
@ -10,13 +10,12 @@
|
|||
|
||||
#include "wx/image.h"
|
||||
|
||||
#include <QtGui/QCursor>
|
||||
class QCursor;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxCursor : public wxCursorBase
|
||||
{
|
||||
public:
|
||||
wxCursor() { }
|
||||
wxCursor( const wxCursor & );
|
||||
wxCursor(wxStockCursor id) { InitFromStock(id); }
|
||||
#if WXWIN_COMPATIBILITY_2_8
|
||||
wxCursor(int id) { InitFromStock((wxStockCursor)id); }
|
||||
|
|
@ -28,15 +27,17 @@ public:
|
|||
int hotSpotX = 0, int hotSpotY = 0);
|
||||
#endif
|
||||
|
||||
QCursor m_qtCursor;
|
||||
|
||||
virtual wxPoint GetHotSpot() const;
|
||||
QCursor &GetHandle() const;
|
||||
|
||||
protected:
|
||||
void InitFromStock( wxStockCursor cursorId );
|
||||
#if wxUSE_IMAGE
|
||||
void InitFromImage( const wxImage & image );
|
||||
#endif
|
||||
|
||||
protected:
|
||||
private:
|
||||
void Init();
|
||||
virtual wxGDIRefData *CreateGDIRefData() const;
|
||||
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@
|
|||
#ifndef _WX_QT_DATAFORM_H_
|
||||
#define _WX_QT_DATAFORM_H_
|
||||
|
||||
class QString;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxDataFormat
|
||||
{
|
||||
public:
|
||||
|
|
@ -33,7 +35,7 @@ public:
|
|||
wxDataFormatId GetType() const;
|
||||
void SetType( wxDataFormatId type );
|
||||
|
||||
QString m_MimeType;
|
||||
wxString m_MimeType;
|
||||
};
|
||||
|
||||
#endif // _WX_QT_DATAFORM_H_
|
||||
|
|
|
|||
|
|
@ -8,12 +8,13 @@
|
|||
#ifndef _WX_QT_DATAOBJ_H_
|
||||
#define _WX_QT_DATAOBJ_H_
|
||||
|
||||
#include <QMimeData>
|
||||
class QMimeData;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxDataObject : public wxDataObjectBase
|
||||
{
|
||||
public:
|
||||
wxDataObject() {}
|
||||
wxDataObject();
|
||||
~wxDataObject();
|
||||
|
||||
virtual bool IsSupportedFormat(const wxDataFormat& format, Direction dir) const;
|
||||
virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const;
|
||||
|
|
@ -24,7 +25,7 @@ public:
|
|||
virtual bool SetData(const wxDataFormat& format, size_t len, const void * buf);
|
||||
|
||||
private:
|
||||
QMimeData m_qtMimeData; // to handle formats that have no helper classes
|
||||
QMimeData *m_qtMimeData; // to handle formats that have no helper classes
|
||||
};
|
||||
|
||||
#endif // _WX_QT_DATAOBJ_H_
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@
|
|||
#ifndef _WX_QT_DC_H_
|
||||
#define _WX_QT_DC_H_
|
||||
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
class QPainter;
|
||||
class QImage;
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxRegion;
|
||||
|
|
@ -112,6 +111,8 @@ public:
|
|||
virtual void* GetHandle() const { return (void*) m_qtPainter; }
|
||||
|
||||
protected:
|
||||
virtual QImage *GetQImage() { return m_qtImage; }
|
||||
|
||||
QPainter *m_qtPainter;
|
||||
QImage *m_qtImage;
|
||||
|
||||
|
|
@ -125,8 +126,8 @@ private:
|
|||
wxQtINVERT
|
||||
};
|
||||
wxQtRasterColourOp m_rasterColourOp;
|
||||
QColor m_qtPenColor;
|
||||
QColor m_qtBrushColor;
|
||||
QColor *m_qtPenColor;
|
||||
QColor *m_qtBrushColor;
|
||||
void ApplyRasterColourOp();
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -20,9 +20,6 @@ public:
|
|||
|
||||
protected:
|
||||
wxWindow *m_window;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,13 +18,12 @@ public:
|
|||
wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc );
|
||||
~wxMemoryDCImpl();
|
||||
|
||||
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const;
|
||||
virtual void DoSelect(const wxBitmap& bitmap);
|
||||
|
||||
virtual const wxBitmap& GetSelectedBitmap() const;
|
||||
virtual wxBitmap& GetSelectedBitmap();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
wxBitmap m_selected;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,9 +17,11 @@ public:
|
|||
|
||||
~wxScreenDCImpl();
|
||||
|
||||
protected:
|
||||
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
|
||||
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
|
||||
|
||||
private:
|
||||
virtual QImage *GetQImage();
|
||||
|
||||
wxDECLARE_ABSTRACT_CLASS(wxScreenDCImpl);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#define _WX_QT_DIALOG_H_
|
||||
|
||||
#include "wx/dialog.h"
|
||||
#include <QtWidgets/QDialog>
|
||||
class QDialog;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxDialog : public wxDialogBase
|
||||
{
|
||||
|
|
@ -35,7 +35,7 @@ public:
|
|||
virtual void EndModal(int retCode);
|
||||
virtual bool IsModal() const;
|
||||
|
||||
virtual QDialog *GetHandle() const;
|
||||
QDialog *GetDialogHandle() const;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _WX_QT_DIRDLG_H_
|
||||
#define _WX_QT_DIRDLG_H_
|
||||
|
||||
#include <QtWidgets/QFileDialog>
|
||||
class QFileDialog;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxDirDialog : public wxDirDialogBase
|
||||
{
|
||||
|
|
@ -36,10 +36,10 @@ public: // overrides from wxGenericDirDialog
|
|||
wxString GetPath() const wxOVERRIDE;
|
||||
void SetPath(const wxString& path) wxOVERRIDE;
|
||||
|
||||
virtual QFileDialog *GetHandle() const;
|
||||
|
||||
private:
|
||||
|
||||
virtual QFileDialog *GetQFileDialog() const;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxDirDialog);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _WX_QT_EVTLOOP_H_
|
||||
#define _WX_QT_EVTLOOP_H_
|
||||
|
||||
#include <QtCore/QTimer>
|
||||
class QTimer;
|
||||
|
||||
class WXDLLIMPEXP_BASE wxQtEventLoopBase : public wxEventLoopBase
|
||||
{
|
||||
|
|
@ -58,21 +58,4 @@ public:
|
|||
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
|
||||
class wxQtEventLoopBase;
|
||||
|
||||
class wxQtIdleTimer : public QTimer
|
||||
{
|
||||
|
||||
public:
|
||||
wxQtIdleTimer( wxQtEventLoopBase *eventLoop );
|
||||
virtual bool eventFilter( QObject * watched, QEvent * event );
|
||||
|
||||
private:
|
||||
void idle();
|
||||
|
||||
private:
|
||||
wxQtEventLoopBase *m_eventLoop;
|
||||
};
|
||||
|
||||
#endif // _WX_QT_EVTLOOP_H_
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _WX_QT_FILEDLG_H_
|
||||
#define _WX_QT_FILEDLG_H_
|
||||
|
||||
#include <QtWidgets/QFileDialog>
|
||||
class QFileDialog;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxFileDialog : public wxFileDialogBase
|
||||
{
|
||||
|
|
@ -48,7 +48,7 @@ public:
|
|||
|
||||
virtual bool SupportsExtraControl() const wxOVERRIDE { return true; }
|
||||
|
||||
virtual QFileDialog *GetHandle() const;
|
||||
virtual QFileDialog *GetQFileDialog() const;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _WX_QT_FONTDLG_H_
|
||||
#define _WX_QT_FONTDLG_H_
|
||||
|
||||
#include <QtWidgets/QFontDialog>
|
||||
class QFontDialog;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxFontDialog : public wxFontDialogBase
|
||||
{
|
||||
|
|
@ -17,8 +17,6 @@ public:
|
|||
wxFontDialog(wxWindow *parent) { Create(parent); }
|
||||
wxFontDialog(wxWindow *parent, const wxFontData& data) { Create(parent, data); }
|
||||
|
||||
virtual QFontDialog *GetHandle() const { return static_cast<QFontDialog *>(m_qtWindow); }
|
||||
|
||||
protected:
|
||||
bool DoCreate(wxWindow *parent);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,9 @@
|
|||
#define _WX_QT_FRAME_H_
|
||||
|
||||
#include "wx/frame.h"
|
||||
#include <QtWidgets/QMainWindow>
|
||||
#include <QtWidgets/QScrollArea>
|
||||
|
||||
class QMainWindow;
|
||||
class QScrollArea;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase
|
||||
{
|
||||
|
|
@ -45,12 +46,8 @@ public:
|
|||
virtual void AddChild( wxWindowBase *child );
|
||||
virtual void RemoveChild( wxWindowBase *child );
|
||||
|
||||
virtual QMainWindow *GetHandle() const
|
||||
{
|
||||
return static_cast<QMainWindow*>(m_qtWindow);
|
||||
}
|
||||
|
||||
virtual QAbstractScrollArea *QtGetScrollBarsContainer() const;
|
||||
QMainWindow *GetQMainWindow() const;
|
||||
virtual QScrollArea *QtGetScrollBarsContainer() const;
|
||||
|
||||
protected:
|
||||
virtual void DoGetClientSize(int *width, int *height) const;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _WX_QT_GAUGE_H_
|
||||
#define _WX_QT_GAUGE_H_
|
||||
|
||||
#include <QtWidgets/QProgressBar>
|
||||
class QProgressBar;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxGauge : public wxGaugeBase
|
||||
{
|
||||
|
|
@ -33,7 +33,7 @@ public:
|
|||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxGaugeNameStr);
|
||||
|
||||
virtual QProgressBar *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
// set/get the control range
|
||||
virtual void SetRange(int range);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,11 @@
|
|||
#ifndef _WX_GLCANVAS_H_
|
||||
#define _WX_GLCANVAS_H_
|
||||
|
||||
#include <QtOpenGL/QGLWidget>
|
||||
#include <GL/gl.h>
|
||||
|
||||
class QGLWidget;
|
||||
class QGLContext;
|
||||
class QGLFormat;
|
||||
|
||||
class WXDLLIMPEXP_GL wxGLContext : public wxGLContextBase
|
||||
{
|
||||
|
|
@ -54,8 +58,6 @@ public:
|
|||
|
||||
static bool ConvertWXAttrsToQtGL(const int *wxattrs, QGLFormat &format);
|
||||
|
||||
virtual QGLWidget *GetHandle() const { return static_cast<QGLWidget *>(m_qtWindow); }
|
||||
|
||||
private:
|
||||
|
||||
// wxDECLARE_EVENT_TABLE();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@
|
|||
#ifndef _WX_QT_LISTBOX_H_
|
||||
#define _WX_QT_LISTBOX_H_
|
||||
|
||||
#include <QtWidgets/QListWidget>
|
||||
class QListWidget;
|
||||
class QModelIndex;
|
||||
class QScrollArea;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxListBox : public wxListBoxBase
|
||||
{
|
||||
|
|
@ -54,10 +56,9 @@ public:
|
|||
virtual wxString GetString(unsigned int n) const;
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
|
||||
virtual void SetSelection(int n);
|
||||
virtual int GetSelection() const;
|
||||
|
||||
virtual QListWidget *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
void QtSendEvent(wxEventType evtType, const QModelIndex &index, bool selected);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@
|
|||
#define _WX_QT_LISTCTRL_H_
|
||||
|
||||
#include "wx/textctrl.h"
|
||||
#include <QtWidgets/QTreeWidget>
|
||||
|
||||
class QTreeWidget;
|
||||
class QTreeWidgetItem;
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxImageList;
|
||||
|
||||
|
|
@ -284,7 +286,7 @@ public:
|
|||
return OnGetItemAttr(item);
|
||||
}
|
||||
|
||||
virtual QTreeWidget *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
protected:
|
||||
void Init();
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
#ifndef _WX_QT_MENU_H_
|
||||
#define _WX_QT_MENU_H_
|
||||
|
||||
#include <QtWidgets/QMenu>
|
||||
#include <QtWidgets/QMenuBar>
|
||||
class QMenu;
|
||||
class QMenuBar;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMenu : public wxMenuBase
|
||||
{
|
||||
|
|
@ -48,7 +48,8 @@ public:
|
|||
virtual void SetMenuLabel(size_t pos, const wxString& label);
|
||||
virtual wxString GetMenuLabel(size_t pos) const;
|
||||
|
||||
virtual QMenuBar *GetHandle() const;
|
||||
QMenuBar *GetQMenuBar() const { return m_qtMenuBar; }
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
virtual void Attach(wxFrame *frame);
|
||||
virtual void Detach();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#define _WX_QT_MENUITEM_H_
|
||||
|
||||
#include "wx/menuitem.h"
|
||||
#include <QtWidgets/QAction>
|
||||
class QAction;
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxBitmap;
|
||||
class WXDLLIMPEXP_FWD_CORE wxMenu;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "wx/msgdlg.h"
|
||||
|
||||
#include <QtWidgets/QMessageBox>
|
||||
class QMessageBox;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxMessageDialog : public wxMessageDialogBase
|
||||
{
|
||||
|
|
@ -23,9 +23,6 @@ public:
|
|||
|
||||
// Reimplemented to translate return codes from Qt to wx
|
||||
virtual int ShowModal();
|
||||
|
||||
virtual QMessageBox *GetHandle() const;
|
||||
|
||||
};
|
||||
|
||||
#endif // _WX_QT_MSGDLG_H_
|
||||
|
|
|
|||
30
include/wx/qt/nonownedwnd.h
Normal file
30
include/wx/qt/nonownedwnd.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/qt/nonownedwnd.h
|
||||
// Author: Sean D'Epagnier
|
||||
// Copyright: (c) 2016 wxWidgets dev team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_QT_NONOWNEDWND_H_
|
||||
#define _WX_QT_NONOWNEDWND_H_
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxNonOwnedWindow contains code common to wx{Popup,TopLevel}Window in wxQT.
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxNonOwnedWindow : public wxNonOwnedWindowBase
|
||||
{
|
||||
public:
|
||||
wxNonOwnedWindow();
|
||||
|
||||
protected:
|
||||
virtual bool DoClearShape() wxOVERRIDE;
|
||||
virtual bool DoSetRegionShape(const wxRegion& region) wxOVERRIDE;
|
||||
#if wxUSE_GRAPHICS_CONTEXT
|
||||
virtual bool DoSetPathShape(const wxGraphicsPath& path) wxOVERRIDE;
|
||||
#endif // wxUSE_GRAPHICS_CONTEXT
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxNonOwnedWindow);
|
||||
};
|
||||
|
||||
#endif // _WX_QT_NONOWNEDWND_H_
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _WX_QT_NOTEBOOK_H_
|
||||
#define _WX_QT_NOTEBOOK_H_
|
||||
|
||||
#include <QtWidgets/QTabWidget>
|
||||
class QTabWidget;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxNotebook : public wxNotebookBase
|
||||
{
|
||||
|
|
@ -45,7 +45,7 @@ public:
|
|||
int SetSelection(size_t nPage) { return DoSetSelection(nPage, SetSelection_SendEvent); }
|
||||
int ChangeSelection(size_t nPage) { return DoSetSelection(nPage); }
|
||||
|
||||
virtual QTabWidget *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
protected:
|
||||
virtual wxWindow *DoRemovePage(size_t page);
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@
|
|||
#ifndef _WX_QT_PEN_H_
|
||||
#define _WX_QT_PEN_H_
|
||||
|
||||
#include <QtCore/Qt>
|
||||
|
||||
class QPen;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxPen : public wxPenBase
|
||||
|
|
|
|||
|
|
@ -10,14 +10,14 @@
|
|||
|
||||
#if wxUSE_TIMER
|
||||
|
||||
#include "wx/private/timer.h"
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include "wx/private/timer.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxTimer
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class QTimerEvent;
|
||||
class WXDLLIMPEXP_CORE wxQtTimerImpl : public wxTimerImpl, QObject
|
||||
{
|
||||
public:
|
||||
|
|
@ -11,13 +11,15 @@
|
|||
#ifndef _WX_QT_EVENTSIGNALFORWARDER_H_
|
||||
#define _WX_QT_EVENTSIGNALFORWARDER_H_
|
||||
|
||||
#include <QtCore/QEvent>
|
||||
#include <QtGui/QCloseEvent>
|
||||
|
||||
#include "wx/log.h"
|
||||
#include "wx/window.h"
|
||||
#include "wx/qt/private/converter.h"
|
||||
#include "wx/qt/private/utils.h"
|
||||
|
||||
#include <QtCore/QEvent>
|
||||
#include <QtGui/QPaintEvent>
|
||||
class QPaintEvent;
|
||||
|
||||
template< typename Handler >
|
||||
class wxQtSignalHandler
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@
|
|||
#ifndef _WX_QT_RADIOBOX_H_
|
||||
#define _WX_QT_RADIOBOX_H_
|
||||
|
||||
#include <QtWidgets/QGroupBox>
|
||||
#include <QtWidgets/QButtonGroup>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
class QGroupBox;
|
||||
class QButtonGroup;
|
||||
class QBoxLayout;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxRadioBox : public wxControl, public wxRadioBoxBase
|
||||
{
|
||||
|
|
@ -77,7 +77,7 @@ public:
|
|||
virtual void SetSelection(int n);
|
||||
virtual int GetSelection() const;
|
||||
|
||||
virtual QGroupBox *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
private:
|
||||
// The 'visual' group box:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _WX_QT_RADIOBUT_H_
|
||||
#define _WX_QT_RADIOBUT_H_
|
||||
|
||||
#include <QtWidgets/QRadioButton>
|
||||
class QRadioButton;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxRadioButton : public wxControl
|
||||
{
|
||||
|
|
@ -35,7 +35,7 @@ public:
|
|||
virtual void SetValue(bool value);
|
||||
virtual bool GetValue() const;
|
||||
|
||||
virtual QRadioButton *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,9 @@
|
|||
#ifndef _WX_QT_REGION_H_
|
||||
#define _WX_QT_REGION_H_
|
||||
|
||||
#include <QtGui/QRegion>
|
||||
class QRegion;
|
||||
class QRect;
|
||||
template<class T> class QVector;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxRegion : public wxRegionBase
|
||||
{
|
||||
|
|
@ -25,7 +27,7 @@ public:
|
|||
virtual bool IsEmpty() const;
|
||||
virtual void Clear();
|
||||
|
||||
virtual QRegion GetHandle() const;
|
||||
virtual const QRegion &GetHandle() const;
|
||||
virtual void QtSetRegion(QRegion region); // Hangs on to this region
|
||||
|
||||
protected:
|
||||
|
|
@ -45,8 +47,6 @@ protected:
|
|||
virtual bool DoIntersect(const wxRegion& region);
|
||||
virtual bool DoSubtract(const wxRegion& region);
|
||||
virtual bool DoXor(const wxRegion& region);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ public:
|
|||
wxRect GetRect() const;
|
||||
|
||||
private:
|
||||
QVector< QRect > *m_qtRects;
|
||||
QVector < QRect > *m_qtRects;
|
||||
int m_pos;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "wx/scrolbar.h"
|
||||
|
||||
#include <QtWidgets/QScrollBar>
|
||||
class QScrollBar;
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxQtScrollBar;
|
||||
|
||||
|
|
@ -42,7 +42,8 @@ public:
|
|||
int range, int pageSize,
|
||||
bool refresh = true);
|
||||
|
||||
virtual QScrollBar* GetHandle() const;
|
||||
QScrollBar *GetQScrollBar() const { return m_qtScrollBar; }
|
||||
QWidget *GetHandle() const;
|
||||
|
||||
private:
|
||||
QScrollBar *m_qtScrollBar;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _WX_QT_SLIDER_H_
|
||||
#define _WX_QT_SLIDER_H_
|
||||
|
||||
#include <QtWidgets/QSlider>
|
||||
class QSlider;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxSlider : public wxSliderBase
|
||||
{
|
||||
|
|
@ -50,7 +50,7 @@ public:
|
|||
virtual void SetThumbLength(int lenPixels);
|
||||
virtual int GetThumbLength() const;
|
||||
|
||||
virtual QSlider *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
private:
|
||||
QSlider *m_qtSlider;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#define _WX_QT_SPINBUTT_H_
|
||||
|
||||
#include "wx/spinbutt.h"
|
||||
#include <QtWidgets/QSpinBox>
|
||||
class QSpinBox;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxSpinButton : public wxSpinButtonBase
|
||||
{
|
||||
|
|
@ -32,7 +32,7 @@ public:
|
|||
virtual int GetValue() const;
|
||||
virtual void SetValue(int val);
|
||||
|
||||
virtual QSpinBox *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
private:
|
||||
QSpinBox *m_qtSpinBox;
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
#ifndef _WX_QT_SPINCTRL_H_
|
||||
#define _WX_QT_SPINCTRL_H_
|
||||
|
||||
#include <QtWidgets/QSpinBox>
|
||||
#include <QtWidgets/QDoubleSpinBox>
|
||||
class QSpinBox;
|
||||
class QDoubleSpinBox;
|
||||
|
||||
// Take advantage of the Qt compile time polymorphy and use a template to avoid
|
||||
// copy&paste code for the usage of QSpinBox/QDoubleSpinBox.
|
||||
|
|
@ -45,7 +45,7 @@ public:
|
|||
T GetMax() const;
|
||||
T GetIncrement() const;
|
||||
|
||||
virtual Widget *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
protected:
|
||||
Widget *m_qtSpinBox;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _WX_QT_STATBMP_H_
|
||||
#define _WX_QT_STATBMP_H_
|
||||
|
||||
#include <QtWidgets/QLabel>
|
||||
class QLabel;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxStaticBitmap : public wxStaticBitmapBase
|
||||
{
|
||||
|
|
@ -35,7 +35,7 @@ public:
|
|||
virtual wxBitmap GetBitmap() const;
|
||||
virtual wxIcon GetIcon() const;
|
||||
|
||||
virtual QLabel *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _WX_QT_STATBOX_H_
|
||||
#define _WX_QT_STATBOX_H_
|
||||
|
||||
#include <QtWidgets/QGroupBox>
|
||||
class QGroupBox;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxStaticBox : public wxStaticBoxBase
|
||||
{
|
||||
|
|
@ -31,7 +31,7 @@ public:
|
|||
|
||||
virtual void GetBordersForSizer(int *borderTop, int *borderOther) const;
|
||||
|
||||
virtual QGroupBox *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _WX_QT_STATLINE_H_
|
||||
#define _WX_QT_STATLINE_H_
|
||||
|
||||
#include <QtWidgets/QFrame>
|
||||
class QFrame;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxStaticLine : public wxStaticLineBase
|
||||
{
|
||||
|
|
@ -29,7 +29,7 @@ public:
|
|||
long style = wxLI_HORIZONTAL,
|
||||
const wxString &name = wxStaticLineNameStr );
|
||||
|
||||
virtual QFrame *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
private:
|
||||
QFrame *m_qtFrame;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _WX_QT_STATTEXT_H_
|
||||
#define _WX_QT_STATTEXT_H_
|
||||
|
||||
#include <QtWidgets/QLabel>
|
||||
class QLabel;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxStaticText : public wxStaticTextBase
|
||||
{
|
||||
|
|
@ -32,7 +32,8 @@ public:
|
|||
|
||||
void SetLabel(const wxString& label);
|
||||
|
||||
QLabel *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
private:
|
||||
QLabel *m_qtLabel;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,13 +10,15 @@
|
|||
|
||||
#include "wx/statusbr.h"
|
||||
|
||||
#include <QtWidgets/QLabel>
|
||||
#include <QtWidgets/QStatusBar>
|
||||
class QLabel;
|
||||
class QStatusBar;
|
||||
|
||||
template < class T > class QList;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxStatusBar : public wxStatusBarBase
|
||||
{
|
||||
public:
|
||||
wxStatusBar() {}
|
||||
wxStatusBar();
|
||||
wxStatusBar(wxWindow *parent, wxWindowID winid = wxID_ANY,
|
||||
long style = wxSTB_DEFAULT_STYLE,
|
||||
const wxString& name = wxStatusBarNameStr);
|
||||
|
|
@ -32,8 +34,9 @@ public:
|
|||
virtual void Refresh( bool eraseBackground = true,
|
||||
const wxRect *rect = (const wxRect *) NULL );
|
||||
|
||||
virtual QStatusBar *GetHandle() const;
|
||||
|
||||
QStatusBar *GetQStatusBar() const { return m_qtStatusBar; }
|
||||
QWidget *GetHandle() const;
|
||||
|
||||
protected:
|
||||
virtual void DoUpdateStatusText(int number);
|
||||
|
||||
|
|
@ -42,7 +45,7 @@ private:
|
|||
void UpdateFields();
|
||||
|
||||
QStatusBar *m_qtStatusBar;
|
||||
QList< QLabel* > m_qtPanes;
|
||||
QList< QLabel* > *m_qtPanes;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxStatusBar);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,12 +8,13 @@
|
|||
#ifndef _WX_QT_TASKBAR_H_
|
||||
#define _WX_QT_TASKBAR_H_
|
||||
|
||||
#include <QtWidgets/QSystemTrayIcon>
|
||||
class QSystemTrayIcon;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTaskBarIcon : public wxTaskBarIconBase
|
||||
{
|
||||
public:
|
||||
wxTaskBarIcon(wxTaskBarIconType iconType = wxTBI_DEFAULT_TYPE);
|
||||
virtual ~wxTaskBarIcon();
|
||||
|
||||
// Accessors
|
||||
bool IsOk() const { return false; }
|
||||
|
|
@ -26,7 +27,7 @@ public:
|
|||
virtual bool PopupMenu(wxMenu *menu);
|
||||
|
||||
private:
|
||||
QSystemTrayIcon m_qtSystemTrayIcon;
|
||||
QSystemTrayIcon *m_qtSystemTrayIcon;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxTaskBarIcon);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,8 +8,9 @@
|
|||
#ifndef _WX_QT_TEXTCTRL_H_
|
||||
#define _WX_QT_TEXTCTRL_H_
|
||||
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include <QtWidgets/QTextEdit>
|
||||
class QLineEdit;
|
||||
class QTextEdit;
|
||||
class QScrollArea;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTextCtrl : public wxTextCtrlBase
|
||||
{
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public:
|
|||
virtual void SetValue(bool state);
|
||||
virtual bool GetValue() const;
|
||||
|
||||
virtual QPushButton *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
private:
|
||||
wxDECLARE_DYNAMIC_CLASS(wxBitmapToggleButton);
|
||||
|
|
@ -69,7 +69,7 @@ public:
|
|||
virtual void SetValue(bool state);
|
||||
virtual bool GetValue() const;
|
||||
|
||||
virtual QPushButton *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <QtWidgets/QToolBar>
|
||||
class QToolBar;
|
||||
|
||||
#ifndef _WX_QT_TOOLBAR_H_
|
||||
#define _WX_QT_TOOLBAR_H_
|
||||
|
|
@ -40,10 +40,10 @@ public:
|
|||
long style = wxTB_DEFAULT_STYLE | wxNO_BORDER,
|
||||
const wxString& name = wxToolBarNameStr);
|
||||
|
||||
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const;
|
||||
virtual QToolBar *GetHandle() const;
|
||||
virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const wxOVERRIDE;
|
||||
virtual QToolBar *GetQToolBar() const { return m_qtToolBar; }
|
||||
|
||||
virtual void SetWindowStyleFlag( long style );
|
||||
virtual void SetWindowStyleFlag( long style ) wxOVERRIDE;
|
||||
virtual bool Realize() wxOVERRIDE;
|
||||
|
||||
virtual wxToolBarToolBase *CreateTool(int toolid,
|
||||
|
|
@ -53,22 +53,23 @@ public:
|
|||
wxItemKind kind,
|
||||
wxObject *clientData,
|
||||
const wxString& shortHelp,
|
||||
const wxString& longHelp);
|
||||
const wxString& longHelp) wxOVERRIDE;
|
||||
|
||||
virtual wxToolBarToolBase *CreateTool(wxControl *control,
|
||||
const wxString& label);
|
||||
const wxString& label) wxOVERRIDE;
|
||||
QWidget *GetHandle() const wxOVERRIDE;
|
||||
|
||||
protected:
|
||||
|
||||
QActionGroup* GetActionGroup(size_t pos);
|
||||
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool);
|
||||
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool);
|
||||
virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable);
|
||||
virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle);
|
||||
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle);
|
||||
virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE;
|
||||
virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool) wxOVERRIDE;
|
||||
virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable) wxOVERRIDE;
|
||||
virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle) wxOVERRIDE;
|
||||
virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle) wxOVERRIDE;
|
||||
|
||||
private:
|
||||
Qt::ToolButtonStyle GetButtonStyle();
|
||||
long GetButtonStyle();
|
||||
|
||||
QToolBar *m_qtToolBar;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include "wx/object.h"
|
||||
|
||||
class wxWindow;
|
||||
class WXDLLIMPEXP_CORE wxToolTip : public wxObject
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
#ifndef _WX_QT_TREECTRL_H_
|
||||
#define _WX_QT_TREECTRL_H_
|
||||
|
||||
#include <QtWidgets/QTreeWidget>
|
||||
class QTreeWidget;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTreeCtrl : public wxTreeCtrlBase
|
||||
{
|
||||
|
|
@ -112,7 +112,7 @@ public:
|
|||
|
||||
virtual bool GetBoundingRect(const wxTreeItemId& item, wxRect& rect, bool textOnly = false) const;
|
||||
|
||||
virtual QTreeWidget *GetHandle() const;
|
||||
virtual QWidget *GetHandle() const;
|
||||
|
||||
protected:
|
||||
virtual int DoGetItemState(const wxTreeItemId& item) const;
|
||||
|
|
|
|||
|
|
@ -9,8 +9,27 @@
|
|||
#ifndef _WX_QT_WINDOW_H_
|
||||
#define _WX_QT_WINDOW_H_
|
||||
|
||||
#include <QtWidgets/QWidget>
|
||||
#include <QtWidgets/QScrollArea>
|
||||
#include <list>
|
||||
|
||||
class QWidget;
|
||||
class QScrollWindow;
|
||||
class QAbstractScrollArea;
|
||||
class QScrollArea;
|
||||
class QPicture;
|
||||
class QPainter;
|
||||
|
||||
class QPaintEvent;
|
||||
class QResizeEvent;
|
||||
class QWheelEvent;
|
||||
class QKeyEvent;
|
||||
class QMouseEvent;
|
||||
class QEvent;
|
||||
class QMoveEvent;
|
||||
class QEvent;
|
||||
class QEvent;
|
||||
class QCloseEvent;
|
||||
class QContextMenuEvent;
|
||||
class QFocusEvent;
|
||||
|
||||
class WXDLLIMPEXP_FWD_CORE wxScrollBar;
|
||||
class WXDLLIMPEXP_FWD_CORE wxQtShortcutHandler;
|
||||
|
|
@ -46,81 +65,82 @@ public:
|
|||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
|
||||
|
||||
bool Create(wxWindowQt *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
|
||||
|
||||
// Used by all window classes in the widget creation process.
|
||||
void PostCreation( bool generic = true );
|
||||
|
||||
void AddChild( wxWindowBase *child );
|
||||
void AddChild( wxWindowBase *child ) wxOVERRIDE;
|
||||
|
||||
virtual bool Show( bool show = true );
|
||||
virtual bool Show( bool show = true ) wxOVERRIDE;
|
||||
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual wxString GetLabel() const;
|
||||
virtual void SetLabel(const wxString& label) wxOVERRIDE;
|
||||
virtual wxString GetLabel() const wxOVERRIDE;
|
||||
|
||||
virtual void DoEnable( bool enable );
|
||||
virtual void SetFocus();
|
||||
virtual void DoEnable( bool enable ) wxOVERRIDE;
|
||||
virtual void SetFocus() wxOVERRIDE;
|
||||
|
||||
// Parent/Child:
|
||||
static void QtReparent( QWidget *child, QWidget *parent );
|
||||
virtual bool Reparent( wxWindowBase *newParent );
|
||||
|
||||
virtual bool Reparent( wxWindowBase *newParent ) wxOVERRIDE;
|
||||
|
||||
// Z-order
|
||||
virtual void Raise();
|
||||
virtual void Lower();
|
||||
|
||||
virtual void Raise() wxOVERRIDE;
|
||||
virtual void Lower() wxOVERRIDE;
|
||||
|
||||
// move the mouse to the specified position
|
||||
virtual void WarpPointer(int x, int y);
|
||||
virtual void WarpPointer(int x, int y) wxOVERRIDE;
|
||||
|
||||
virtual void Update();
|
||||
virtual void Update() wxOVERRIDE;
|
||||
virtual void Refresh( bool eraseBackground = true,
|
||||
const wxRect *rect = (const wxRect *) NULL );
|
||||
const wxRect *rect = (const wxRect *) NULL ) wxOVERRIDE;
|
||||
|
||||
virtual bool SetCursor( const wxCursor &cursor ) wxOVERRIDE;
|
||||
virtual bool SetFont(const wxFont& font) wxOVERRIDE;
|
||||
|
||||
virtual bool SetFont(const wxFont& font);
|
||||
|
||||
// get the (average) character size for the current font
|
||||
virtual int GetCharHeight() const;
|
||||
virtual int GetCharWidth() const;
|
||||
|
||||
virtual int GetCharHeight() const wxOVERRIDE;
|
||||
virtual int GetCharWidth() const wxOVERRIDE;
|
||||
|
||||
virtual void SetScrollbar( int orient,
|
||||
int pos,
|
||||
int thumbvisible,
|
||||
int range,
|
||||
bool refresh = true );
|
||||
virtual void SetScrollPos( int orient, int pos, bool refresh = true );
|
||||
virtual int GetScrollPos( int orient ) const;
|
||||
virtual int GetScrollThumb( int orient ) const;
|
||||
virtual int GetScrollRange( int orient ) const;
|
||||
bool refresh = true ) wxOVERRIDE;
|
||||
virtual void SetScrollPos( int orient, int pos, bool refresh = true ) wxOVERRIDE;
|
||||
virtual int GetScrollPos( int orient ) const wxOVERRIDE;
|
||||
virtual int GetScrollThumb( int orient ) const wxOVERRIDE;
|
||||
virtual int GetScrollRange( int orient ) const wxOVERRIDE;
|
||||
|
||||
// scroll window to the specified position
|
||||
virtual void ScrollWindow( int dx, int dy,
|
||||
const wxRect* rect = NULL );
|
||||
const wxRect* rect = NULL ) wxOVERRIDE;
|
||||
|
||||
// Styles
|
||||
virtual void SetWindowStyleFlag( long style );
|
||||
virtual void SetExtraStyle( long exStyle );
|
||||
virtual void SetWindowStyleFlag( long style ) wxOVERRIDE;
|
||||
virtual void SetExtraStyle( long exStyle ) wxOVERRIDE;
|
||||
|
||||
virtual bool SetBackgroundStyle(wxBackgroundStyle style);
|
||||
virtual bool IsTransparentBackgroundSupported(wxString* reason = NULL) const;
|
||||
virtual bool SetTransparent(wxByte alpha);
|
||||
virtual bool CanSetTransparent() { return true; }
|
||||
virtual bool SetBackgroundStyle(wxBackgroundStyle style) wxOVERRIDE;
|
||||
virtual bool IsTransparentBackgroundSupported(wxString* reason = NULL) const wxOVERRIDE;
|
||||
virtual bool SetTransparent(wxByte alpha) wxOVERRIDE;
|
||||
virtual bool CanSetTransparent() wxOVERRIDE { return true; }
|
||||
|
||||
virtual WXWidget GetHandle() const;
|
||||
QWidget *GetHandle() const wxOVERRIDE;
|
||||
|
||||
virtual void SetDropTarget( wxDropTarget *dropTarget ) wxOVERRIDE;
|
||||
|
||||
virtual void SetDropTarget( wxDropTarget *dropTarget );
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
// accelerators
|
||||
// ------------
|
||||
virtual void SetAcceleratorTable( const wxAcceleratorTable& accel );
|
||||
virtual void SetAcceleratorTable( const wxAcceleratorTable& accel ) wxOVERRIDE;
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
|
||||
// wxQt implementation internals:
|
||||
|
||||
virtual QPicture *QtGetPicture() const;
|
||||
|
|
@ -147,41 +167,41 @@ public:
|
|||
virtual void QtHandleShortcut ( int command );
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
virtual QAbstractScrollArea *QtGetScrollBarsContainer() const;
|
||||
virtual QScrollArea *QtGetScrollBarsContainer() const;
|
||||
|
||||
protected:
|
||||
virtual void DoGetTextExtent(const wxString& string,
|
||||
int *x, int *y,
|
||||
int *descent = NULL,
|
||||
int *externalLeading = NULL,
|
||||
const wxFont *font = NULL) const;
|
||||
const wxFont *font = NULL) const wxOVERRIDE;
|
||||
|
||||
// coordinates translation
|
||||
virtual void DoClientToScreen( int *x, int *y ) const;
|
||||
virtual void DoScreenToClient( int *x, int *y ) const;
|
||||
virtual void DoClientToScreen( int *x, int *y ) const wxOVERRIDE;
|
||||
virtual void DoScreenToClient( int *x, int *y ) const wxOVERRIDE;
|
||||
|
||||
// capture/release the mouse, used by Capture/ReleaseMouse()
|
||||
virtual void DoCaptureMouse();
|
||||
virtual void DoReleaseMouse();
|
||||
virtual void DoCaptureMouse() wxOVERRIDE;
|
||||
virtual void DoReleaseMouse() wxOVERRIDE;
|
||||
|
||||
// retrieve the position/size of the window
|
||||
virtual void DoGetPosition(int *x, int *y) const;
|
||||
virtual void DoGetPosition(int *x, int *y) const wxOVERRIDE;
|
||||
|
||||
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO) wxOVERRIDE;
|
||||
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
|
||||
|
||||
// same as DoSetSize() for the client size
|
||||
virtual void DoSetClientSize(int width, int height);
|
||||
virtual void DoGetClientSize(int *width, int *height) const;
|
||||
virtual void DoSetClientSize(int width, int height) wxOVERRIDE;
|
||||
virtual void DoGetClientSize(int *width, int *height) const wxOVERRIDE;
|
||||
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE;
|
||||
|
||||
#if wxUSE_TOOLTIPS
|
||||
virtual void DoSetToolTip( wxToolTip *tip );
|
||||
virtual void DoSetToolTip( wxToolTip *tip ) wxOVERRIDE;
|
||||
#endif // wxUSE_TOOLTIPS
|
||||
|
||||
#if wxUSE_MENUS
|
||||
virtual bool DoPopupMenu(wxMenu *menu, int x, int y);
|
||||
virtual bool DoPopupMenu(wxMenu *menu, int x, int y) wxOVERRIDE;
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
QWidget *m_qtWindow;
|
||||
|
|
@ -205,7 +225,7 @@ private:
|
|||
bool m_mouseInside;
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
QList< QShortcut* > m_qtShortcuts;
|
||||
QList< QShortcut* > *m_qtShortcuts;
|
||||
wxQtShortcutHandler *m_qtShortcutHandler;
|
||||
bool m_processingShortcut;
|
||||
#endif // wxUSE_ACCEL
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include "wx/list.h"
|
||||
#include "wx/qt/private/converter.h"
|
||||
#include <QtCore/QVariant>
|
||||
#include <QtWidgets/QShortcut>
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxAccelList: a list of wxAcceleratorEntries
|
||||
|
|
@ -81,13 +82,13 @@ wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]
|
|||
}
|
||||
}
|
||||
|
||||
QList< QShortcut* > wxAcceleratorTable::ConvertShortcutTable( QWidget *parent ) const
|
||||
QList< QShortcut* > *wxAcceleratorTable::ConvertShortcutTable( QWidget *parent ) const
|
||||
{
|
||||
QList< QShortcut* > qtList;
|
||||
QList< QShortcut* > *qtList = new QList< QShortcut* >;
|
||||
|
||||
for ( wxAccelList::Node *node = M_ACCELDATA->m_accels.GetFirst(); node; node = node->GetNext() )
|
||||
{
|
||||
qtList << ConvertAccelerator( node->GetData(), parent );
|
||||
qtList->push_back(ConvertAccelerator( node->GetData(), parent ));
|
||||
}
|
||||
|
||||
return qtList;
|
||||
|
|
|
|||
|
|
@ -14,11 +14,12 @@
|
|||
#include "wx/anybutton.h"
|
||||
#endif
|
||||
|
||||
#include <QtWidgets/QPushButton>
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
#include "wx/qt/private/utils.h"
|
||||
#include "wx/qt/private/winevent.h"
|
||||
|
||||
|
||||
class wxQtPushButton : public wxQtEventSignalHandler< QPushButton, wxAnyButton >
|
||||
{
|
||||
|
||||
|
|
@ -64,7 +65,7 @@ void wxAnyButton::SetLabel( const wxString &label )
|
|||
m_qtPushButton->setText( wxQtConvertString( label ));
|
||||
}
|
||||
|
||||
QPushButton *wxAnyButton::GetHandle() const
|
||||
QWidget *wxAnyButton::GetHandle() const
|
||||
{
|
||||
return m_qtPushButton;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
#include "wx/qt/private/utils.h"
|
||||
#include "wx/qt/private/converter.h"
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtWidgets/QApplication>
|
||||
|
||||
wxIMPLEMENT_DYNAMIC_CLASS(wxApp, wxAppBase);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@
|
|||
#include "wx/stdpaths.h"
|
||||
#include "wx/evtloop.h"
|
||||
|
||||
#include "wx/qt/timer.h"
|
||||
#include "wx/timer.h"
|
||||
#include "wx/qt/private/timer.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include "wx/bitmap.h"
|
||||
#include "wx/cursor.h"
|
||||
#include "wx/rawbmp.h"
|
||||
#include "wx/qt/colour.h"
|
||||
#include "wx/qt/private/converter.h"
|
||||
#include "wx/qt/private/utils.h"
|
||||
|
||||
|
|
@ -123,42 +124,31 @@ static QImage ConvertImage( const wxImage &image )
|
|||
class wxBitmapRefData: public wxGDIRefData
|
||||
{
|
||||
public:
|
||||
wxBitmapRefData() : wxGDIRefData()
|
||||
wxBitmapRefData() { m_mask = NULL; }
|
||||
|
||||
wxBitmapRefData( int width, int height, int depth )
|
||||
{
|
||||
if (depth == 1)
|
||||
m_qtPixmap = QBitmap( width, height );
|
||||
else
|
||||
m_qtPixmap = QPixmap( width, height );
|
||||
m_mask = NULL;
|
||||
m_qtPixmap = new QPixmap();
|
||||
}
|
||||
|
||||
wxBitmapRefData( const wxBitmapRefData& data ) : wxGDIRefData()
|
||||
wxBitmapRefData( QPixmap pix )
|
||||
{
|
||||
m_qtPixmap = pix;
|
||||
m_mask = NULL;
|
||||
m_qtPixmap = new QPixmap(data.m_qtPixmap->handle());
|
||||
}
|
||||
|
||||
wxBitmapRefData( int width, int height, int depth ) : wxGDIRefData()
|
||||
{
|
||||
m_mask = NULL;
|
||||
if (depth == 1) {
|
||||
m_qtPixmap = new QBitmap( width, height );
|
||||
} else {
|
||||
m_qtPixmap = new QPixmap( width, height );
|
||||
}
|
||||
}
|
||||
|
||||
wxBitmapRefData( QPixmap pix ) : wxGDIRefData()
|
||||
{
|
||||
m_mask = NULL;
|
||||
m_qtPixmap = new QPixmap(pix);
|
||||
}
|
||||
|
||||
virtual ~wxBitmapRefData()
|
||||
{
|
||||
if (m_qtPixmap != NULL)
|
||||
delete m_qtPixmap;
|
||||
}
|
||||
virtual ~wxBitmapRefData() { delete m_mask; }
|
||||
|
||||
QPixmap *m_qtPixmap;
|
||||
QPixmap m_qtPixmap;
|
||||
wxMask *m_mask;
|
||||
|
||||
private:
|
||||
wxBitmapRefData(const wxBitmapRefData&other);
|
||||
wxBitmapRefData& operator=(const wxBitmapRefData&other);
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -167,7 +157,8 @@ class wxBitmapRefData: public wxGDIRefData
|
|||
|
||||
wxIMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxObject);
|
||||
|
||||
#define M_PIXDATA (*((wxBitmapRefData *)m_refData)->m_qtPixmap)
|
||||
#define M_PIXDATA ((wxBitmapRefData *)m_refData)->m_qtPixmap
|
||||
#define M_MASK ((wxBitmapRefData *)m_refData)->m_mask
|
||||
|
||||
void wxBitmap::InitStandardHandlers()
|
||||
{
|
||||
|
|
@ -194,8 +185,7 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth )
|
|||
if (width > 0 && height > 0 && depth == 1)
|
||||
{
|
||||
m_refData = new wxBitmapRefData();
|
||||
((wxBitmapRefData *)m_refData)->m_qtPixmap =
|
||||
new QBitmap(QBitmap::fromData(QSize(width, height), (const uchar*)bits));
|
||||
M_PIXDATA = QBitmap(QBitmap::fromData(QSize(width, height), (const uchar*)bits));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -213,7 +203,7 @@ wxBitmap::wxBitmap(const wxSize& sz, int depth )
|
|||
wxBitmap::wxBitmap(const char* const* bits)
|
||||
{
|
||||
m_refData = new wxBitmapRefData();
|
||||
((wxBitmapRefData *)m_refData)->m_qtPixmap = new QPixmap( bits );
|
||||
M_PIXDATA = QPixmap( bits );
|
||||
}
|
||||
|
||||
wxBitmap::wxBitmap(const wxString &filename, wxBitmapType type )
|
||||
|
|
@ -232,9 +222,7 @@ wxBitmap::wxBitmap(const wxImage& image, int depth, double WXUNUSED(scale) )
|
|||
wxBitmap::wxBitmap(const wxCursor& cursor)
|
||||
{
|
||||
// note that pixmap could be invalid if is not a pixmap cursor
|
||||
// also, a wxCursor::GetHandle method could be implemented instead of
|
||||
// accessing the member variable directly
|
||||
QPixmap pix = cursor.m_qtCursor.pixmap();
|
||||
QPixmap pix = cursor.GetHandle().pixmap();
|
||||
m_refData = new wxBitmapRefData(pix);
|
||||
}
|
||||
|
||||
|
|
@ -275,29 +263,26 @@ int wxBitmap::GetDepth() const
|
|||
#if wxUSE_IMAGE
|
||||
wxImage wxBitmap::ConvertToImage() const
|
||||
{
|
||||
return ConvertImage(M_PIXDATA.toImage());
|
||||
QPixmap pixmap(M_PIXDATA);
|
||||
if ( M_MASK && M_MASK->GetHandle() )
|
||||
pixmap.setMask(*M_MASK->GetHandle());
|
||||
return ConvertImage(pixmap.toImage());
|
||||
}
|
||||
|
||||
#endif // wxUSE_IMAGE
|
||||
|
||||
wxMask *wxBitmap::GetMask() const
|
||||
{
|
||||
return ( ((wxBitmapRefData *)m_refData)->m_mask );
|
||||
return M_MASK;
|
||||
}
|
||||
|
||||
void wxBitmap::SetMask(wxMask *mask)
|
||||
{
|
||||
wxMask *bitmapMask = ( ((wxBitmapRefData *)m_refData)->m_mask );
|
||||
|
||||
if (bitmapMask)
|
||||
delete bitmapMask;
|
||||
|
||||
bitmapMask = mask;
|
||||
((wxBitmapRefData *)m_refData)->m_mask = mask;
|
||||
M_PIXDATA.setMask( *mask->GetHandle() );
|
||||
AllocExclusive();
|
||||
delete M_MASK;
|
||||
M_MASK = mask;
|
||||
}
|
||||
|
||||
|
||||
wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const
|
||||
{
|
||||
return wxBitmap(M_PIXDATA.copy(wxQtConvertRect(rect)));
|
||||
|
|
@ -448,7 +433,7 @@ void wxBitmap::UngetRawData(wxPixelDataBase& WXUNUSED(data))
|
|||
|
||||
QPixmap *wxBitmap::GetHandle() const
|
||||
{
|
||||
return ( m_refData != NULL ) ? ((wxBitmapRefData *)m_refData)->m_qtPixmap : NULL;
|
||||
return ( m_refData != NULL ) ? &M_PIXDATA : NULL;
|
||||
}
|
||||
|
||||
wxGDIRefData *wxBitmap::CreateGDIRefData() const
|
||||
|
|
@ -458,7 +443,11 @@ wxGDIRefData *wxBitmap::CreateGDIRefData() const
|
|||
|
||||
wxGDIRefData *wxBitmap::CloneGDIRefData(const wxGDIRefData *data) const
|
||||
{
|
||||
return new wxBitmapRefData(*(wxBitmapRefData *)data);
|
||||
const wxBitmapRefData* oldRef = static_cast<const wxBitmapRefData*>(data);
|
||||
wxBitmapRefData *d = new wxBitmapRefData;
|
||||
d->m_qtPixmap = oldRef->m_qtPixmap; //.copy();// copy not needed
|
||||
d->m_mask = oldRef->m_mask ? new wxMask(*oldRef->m_mask) : NULL;
|
||||
return d;
|
||||
}
|
||||
|
||||
bool wxBitmap::HasAlpha() const
|
||||
|
|
@ -479,9 +468,18 @@ wxMask::wxMask()
|
|||
|
||||
wxMask::wxMask(const wxMask &mask)
|
||||
{
|
||||
m_qtBitmap = new QBitmap(*mask.GetHandle());
|
||||
QBitmap *mask_bmp = mask.GetHandle();
|
||||
m_qtBitmap = mask_bmp ? new QBitmap(*mask_bmp) : NULL;
|
||||
}
|
||||
|
||||
wxMask& wxMask::operator=(const wxMask &mask)
|
||||
{
|
||||
delete m_qtBitmap;
|
||||
QBitmap *mask_bmp = mask.GetHandle();
|
||||
m_qtBitmap = mask_bmp ? new QBitmap(*mask_bmp) : NULL;
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxMask::wxMask(const wxBitmap& bitmap, const wxColour& colour)
|
||||
{
|
||||
m_qtBitmap = NULL;
|
||||
|
|
@ -502,38 +500,36 @@ wxMask::wxMask(const wxBitmap& bitmap)
|
|||
|
||||
wxMask::~wxMask()
|
||||
{
|
||||
if (m_qtBitmap)
|
||||
delete m_qtBitmap;
|
||||
delete m_qtBitmap;
|
||||
}
|
||||
|
||||
bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
|
||||
// this function is called from Create() to free the existing mask data
|
||||
void wxMask::FreeData()
|
||||
{
|
||||
delete m_qtBitmap;
|
||||
m_qtBitmap = NULL;
|
||||
}
|
||||
|
||||
bool wxMask::InitFromColour(const wxBitmap& bitmap, const wxColour& colour)
|
||||
{
|
||||
if (!bitmap.IsOk())
|
||||
return false;
|
||||
|
||||
if (m_qtBitmap)
|
||||
delete m_qtBitmap;
|
||||
delete m_qtBitmap;
|
||||
m_qtBitmap = new QBitmap(bitmap.GetHandle()->createMaskFromColor(colour.GetQColor()));
|
||||
|
||||
m_qtBitmap = new QBitmap(bitmap.GetHandle()->createMaskFromColor(colour.GetHandle()));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxMask::Create(const wxBitmap& WXUNUSED(bitmap), int WXUNUSED(paletteIndex))
|
||||
{
|
||||
wxMISSING_IMPLEMENTATION( __FUNCTION__ );
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxMask::Create(const wxBitmap& bitmap)
|
||||
bool wxMask::InitFromMonoBitmap(const wxBitmap& bitmap)
|
||||
{
|
||||
//Only for mono bitmaps
|
||||
if (!bitmap.IsOk() || bitmap.GetDepth() != 1)
|
||||
return false;
|
||||
|
||||
if (m_qtBitmap)
|
||||
delete m_qtBitmap;
|
||||
|
||||
delete m_qtBitmap;
|
||||
m_qtBitmap = new QBitmap(*bitmap.GetHandle());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ wxBrush::wxBrush()
|
|||
wxBrush::wxBrush(const wxColour& col, wxBrushStyle style )
|
||||
{
|
||||
m_refData = new wxBrushRefData();
|
||||
M_BRUSHDATA.setColor(col.GetHandle());
|
||||
M_BRUSHDATA.setColor(col.GetQColor());
|
||||
M_BRUSHDATA.setStyle(ConvertBrushStyle(style));
|
||||
M_STYLEDATA = style;
|
||||
}
|
||||
|
|
@ -103,7 +103,7 @@ wxBrush::wxBrush(const wxColour& col, wxBrushStyle style )
|
|||
wxBrush::wxBrush(const wxColour& col, int style)
|
||||
{
|
||||
m_refData = new wxBrushRefData();
|
||||
M_BRUSHDATA.setColor(col.GetHandle());
|
||||
M_BRUSHDATA.setColor(col.GetQColor());
|
||||
M_BRUSHDATA.setStyle(ConvertBrushStyle((wxBrushStyle)style));
|
||||
M_STYLEDATA = (wxBrushStyle)style;
|
||||
}
|
||||
|
|
@ -122,7 +122,7 @@ wxBrush::wxBrush(const wxBitmap& stipple)
|
|||
void wxBrush::SetColour(const wxColour& col)
|
||||
{
|
||||
AllocExclusive();
|
||||
M_BRUSHDATA.setColor(col.GetHandle());
|
||||
M_BRUSHDATA.setColor(col.GetQColor());
|
||||
}
|
||||
|
||||
void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b)
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include "wx/qt/private/utils.h"
|
||||
#include "wx/qt/private/winevent.h"
|
||||
|
||||
#include <QtWidgets/QPushButton>
|
||||
|
||||
wxButton::wxButton()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
#include "wx/qt/private/winevent.h"
|
||||
|
||||
#include <QtGui/QTextCharFormat>
|
||||
|
||||
#include <QtWidgets/QCalendarWidget>
|
||||
|
||||
class wxQtCalendarWidget : public wxQtEventSignalHandler< QCalendarWidget, wxCalendarCtrl >
|
||||
{
|
||||
|
|
@ -229,7 +229,7 @@ void wxCalendarCtrl::SetHoliday(size_t day)
|
|||
date.setDate(date.year(), date.month(), day);
|
||||
|
||||
QTextCharFormat format = m_qtCalendar->dateTextFormat(date);
|
||||
format.setForeground(m_colHolidayFg.GetHandle());
|
||||
format.setForeground(m_colHolidayFg.GetQColor());
|
||||
m_qtCalendar->setDateTextFormat(date, format);
|
||||
}
|
||||
|
||||
|
|
@ -249,9 +249,9 @@ void wxCalendarCtrl::RefreshHolidays()
|
|||
if ( m_windowStyle & wxCAL_SHOW_HOLIDAYS )
|
||||
{
|
||||
if ( m_colHolidayFg.IsOk() )
|
||||
format.setForeground(m_colHolidayFg.GetHandle());
|
||||
format.setForeground(m_colHolidayFg.GetQColor());
|
||||
if ( m_colHolidayBg.IsOk() )
|
||||
format.setBackground(m_colHolidayBg.GetHandle());
|
||||
format.setBackground(m_colHolidayBg.GetQColor());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -278,9 +278,9 @@ void wxCalendarCtrl::SetHeaderColours(const wxColour& colFg, const wxColour& col
|
|||
|
||||
QTextCharFormat format = m_qtCalendar->headerTextFormat();
|
||||
if ( m_colHeaderFg.IsOk() )
|
||||
format.setForeground(m_colHeaderFg.GetHandle());
|
||||
format.setForeground(m_colHeaderFg.GetQColor());
|
||||
if ( m_colHeaderBg.IsOk() )
|
||||
format.setBackground(m_colHeaderBg.GetHandle());
|
||||
format.setBackground(m_colHeaderBg.GetQColor());
|
||||
m_qtCalendar->setHeaderTextFormat(format);
|
||||
}
|
||||
|
||||
|
|
@ -303,9 +303,9 @@ void wxCalendarCtrl::SetAttr(size_t day, wxCalendarDateAttr *attr)
|
|||
|
||||
QTextCharFormat format = m_qtCalendar->dateTextFormat(date);
|
||||
if ( attr->HasTextColour() )
|
||||
format.setForeground(attr->GetTextColour().GetHandle());
|
||||
format.setForeground(attr->GetTextColour().GetQColor());
|
||||
if ( attr->HasBackgroundColour() )
|
||||
format.setBackground(attr->GetBackgroundColour().GetHandle());
|
||||
format.setBackground(attr->GetBackgroundColour().GetQColor());
|
||||
|
||||
wxMISSING_IMPLEMENTATION( "Setting font" );
|
||||
|
||||
|
|
@ -316,7 +316,7 @@ void wxCalendarCtrl::SetAttr(size_t day, wxCalendarDateAttr *attr)
|
|||
m_qtCalendar->setDateTextFormat(date, format);
|
||||
}
|
||||
|
||||
QCalendarWidget *wxCalendarCtrl::GetHandle() const
|
||||
QWidget *wxCalendarCtrl::GetHandle() const
|
||||
{
|
||||
return m_qtCalendar;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@
|
|||
#include "wx/qt/private/converter.h"
|
||||
#include "wx/qt/private/winevent.h"
|
||||
|
||||
#include <QtWidgets/QCheckBox>
|
||||
|
||||
class wxQtCheckBox : public wxQtEventSignalHandler< QCheckBox, wxCheckBox >
|
||||
{
|
||||
public:
|
||||
|
|
@ -124,7 +126,7 @@ wxCheckBoxState wxCheckBox::DoGet3StateValue() const
|
|||
return wxCHK_UNDETERMINED;
|
||||
}
|
||||
|
||||
QCheckBox *wxCheckBox::GetHandle() const
|
||||
QWidget *wxCheckBox::GetHandle() const
|
||||
{
|
||||
return m_qtCheckBox;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@
|
|||
|
||||
#include "wx/checklst.h"
|
||||
|
||||
#include <QtWidgets/QListWidgetItem>
|
||||
|
||||
wxCheckListBox::wxCheckListBox()
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
|
|||
const wxValidator& validator,
|
||||
const wxString& name )
|
||||
{
|
||||
return Create( parent, id, pos, size, choices.size(), &choices[ 0 ], style,
|
||||
return Create( parent, id, pos, size, choices.size(), choices.size() ? &choices[ 0 ] : NULL, style,
|
||||
validator, name );
|
||||
}
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ void wxChoice::DoDeleteOneItem(unsigned int pos)
|
|||
m_qtComboBox->removeItem(pos);
|
||||
}
|
||||
|
||||
QComboBox *wxChoice::GetHandle() const
|
||||
QWidget *wxChoice::GetHandle() const
|
||||
{
|
||||
return m_qtComboBox;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include "wx/scopeguard.h"
|
||||
#include "wx/qt/private/converter.h"
|
||||
|
||||
#include <QtCore/QMimeData>
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxClipboard ctor/dtor
|
||||
|
|
@ -42,7 +43,7 @@ public:
|
|||
private:
|
||||
void changed( QClipboard::Mode mode)
|
||||
{
|
||||
if(mode != m_clipboard->Mode() || !m_clipboard->m_sink)
|
||||
if ( mode != m_clipboard->Mode() || !m_clipboard->m_sink )
|
||||
return;
|
||||
|
||||
wxClipboardEvent *event = new wxClipboardEvent(wxEVT_CLIPBOARD_CHANGED);
|
||||
|
|
@ -108,7 +109,7 @@ bool wxClipboard::AddData( wxDataObject *data )
|
|||
|
||||
QByteArray bytearray(size, 0);
|
||||
data->GetDataHere(format, bytearray.data());
|
||||
MimeData->setData(format.m_MimeType, bytearray);
|
||||
MimeData->setData(wxQtConvertString(format.m_MimeType), bytearray);
|
||||
}
|
||||
|
||||
delete data;
|
||||
|
|
@ -143,15 +144,15 @@ bool wxClipboard::GetData( wxDataObject& data )
|
|||
const wxDataFormat format(formats[i]);
|
||||
|
||||
// is this format supported by clipboard ?
|
||||
if( !MimeData->hasFormat(format.m_MimeType) )
|
||||
if( !MimeData->hasFormat(wxQtConvertString(format.m_MimeType)) )
|
||||
continue;
|
||||
|
||||
wxTextDataObject *textdata = dynamic_cast<wxTextDataObject*>(&data);
|
||||
if(textdata)
|
||||
if ( textdata )
|
||||
textdata->SetText(wxQtConvertString(MimeData->text()));
|
||||
else
|
||||
{
|
||||
QByteArray bytearray = MimeData->data( format.m_MimeType ).data();
|
||||
QByteArray bytearray = MimeData->data( wxQtConvertString(format.m_MimeType) ).data();
|
||||
data.SetData(format, bytearray.size(), bytearray.constData());
|
||||
}
|
||||
|
||||
|
|
@ -169,7 +170,7 @@ void wxClipboard::Clear()
|
|||
bool wxClipboard::IsSupported( const wxDataFormat& format )
|
||||
{
|
||||
const QMimeData *data = QtClipboard->mimeData( (QClipboard::Mode)Mode() );
|
||||
return data->hasFormat(format.m_MimeType);
|
||||
return data->hasFormat(wxQtConvertString(format.m_MimeType));
|
||||
}
|
||||
|
||||
bool wxClipboard::IsSupportedAsync(wxEvtHandler *sink)
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
#include "wx/qt/private/winevent.h"
|
||||
#include "wx/colordlg.h"
|
||||
|
||||
#include <QtWidgets/QColorDialog>
|
||||
|
||||
class wxQtColorDialog : public wxQtEventSignalHandler< QColorDialog, wxDialog >
|
||||
{
|
||||
public:
|
||||
|
|
@ -23,16 +25,16 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data )
|
|||
{
|
||||
m_qtWindow = new wxQtColorDialog( parent, this );
|
||||
|
||||
if(data)
|
||||
if ( data )
|
||||
m_data = *data;
|
||||
|
||||
if ( m_data.GetChooseFull() )
|
||||
{
|
||||
for (int i=0; i<wxColourData::NUM_CUSTOM; i++)
|
||||
QColorDialog::setCustomColor(i, m_data.GetCustomColour(i).GetHandle());
|
||||
QColorDialog::setCustomColor(i, m_data.GetCustomColour(i).GetQColor());
|
||||
}
|
||||
|
||||
GetHandle()->setCurrentColor(m_data.GetColour().GetHandle());
|
||||
static_cast<QColorDialog*>(m_qtWindow)->setCurrentColor(m_data.GetColour().GetQColor());
|
||||
|
||||
return wxTopLevelWindow::Create( parent, wxID_ANY, "");
|
||||
}
|
||||
|
|
@ -40,10 +42,14 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data )
|
|||
wxColourData &wxColourDialog::GetColourData()
|
||||
{
|
||||
for (int i=0; i<wxColourData::NUM_CUSTOM; i++)
|
||||
m_data.SetCustomColour(i, GetHandle()->customColor(i));
|
||||
m_data.SetCustomColour(i, GetQColorDialog()->customColor(i));
|
||||
|
||||
m_data.SetColour(GetHandle()->currentColor());
|
||||
m_data.SetColour(GetQColorDialog()->currentColor());
|
||||
|
||||
return m_data;
|
||||
}
|
||||
|
||||
QColorDialog *wxColourDialog::GetQColorDialog() const
|
||||
{
|
||||
return static_cast<QColorDialog *>(m_qtWindow);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,25 @@
|
|||
#include "wx/colour.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/colour.h"
|
||||
#include "wx/qt/private/utils.h"
|
||||
|
||||
#include <QtGui/QColor>
|
||||
|
||||
wxColour::wxColour(const QColor& color)
|
||||
{
|
||||
InitRGBA(color.red(), color.green(), color.blue(), color.alpha());
|
||||
}
|
||||
|
||||
bool wxColour::operator==(const wxColour& color) const
|
||||
{
|
||||
return m_red == color.m_red && m_green == color.m_green && m_blue == color.m_blue && m_alpha == color.m_alpha;
|
||||
}
|
||||
|
||||
bool wxColour::operator!=(const wxColour& color) const
|
||||
{
|
||||
return !(*this == color);
|
||||
}
|
||||
|
||||
int wxColour::GetPixel() const
|
||||
{
|
||||
|
|
@ -27,4 +44,21 @@ int wxColour::GetPixel() const
|
|||
return 0;
|
||||
}
|
||||
|
||||
#include "wx/colour.h"
|
||||
QColor wxColour::GetQColor() const
|
||||
{
|
||||
if ( m_valid )
|
||||
return QColor(m_red, m_green, m_blue, m_alpha);
|
||||
return QColor();
|
||||
}
|
||||
|
||||
void wxColour::Init()
|
||||
{
|
||||
m_red = m_green = m_blue = m_alpha = 0;
|
||||
m_valid = false;
|
||||
}
|
||||
|
||||
void wxColour::InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a)
|
||||
{
|
||||
m_red = r, m_green = g, m_blue = b, m_alpha = a;
|
||||
m_valid = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,9 @@
|
|||
#include "wx/window.h"
|
||||
#include "wx/qt/private/converter.h"
|
||||
#include "wx/qt/private/winevent.h"
|
||||
|
||||
#include <QtWidgets/QComboBox>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
|
||||
class wxQtComboBox : public wxQtEventSignalHandler< QComboBox, wxComboBox >
|
||||
{
|
||||
|
|
@ -123,12 +125,12 @@ wxString wxComboBox::DoGetValue() const
|
|||
|
||||
void wxComboBox::Popup()
|
||||
{
|
||||
GetHandle()->showPopup();
|
||||
static_cast<QComboBox *>(GetHandle())->showPopup();
|
||||
}
|
||||
|
||||
void wxComboBox::Dismiss()
|
||||
{
|
||||
GetHandle()->hidePopup();
|
||||
static_cast<QComboBox *>(GetHandle())->hidePopup();
|
||||
}
|
||||
|
||||
void wxComboBox::SetSelection( long from, long to )
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
#include "wx/control.h"
|
||||
#include "wx/qt/private/converter.h"
|
||||
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
wxIMPLEMENT_DYNAMIC_CLASS(wxControl, wxWindow);
|
||||
|
||||
wxControl::wxControl()
|
||||
|
|
|
|||
|
|
@ -20,19 +20,19 @@
|
|||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/cursor.h"
|
||||
|
||||
#include "wx/qt/private/converter.h"
|
||||
|
||||
void wxSetCursor(const wxCursor& cursor)
|
||||
{
|
||||
if (cursor.m_qtCursor.shape() == Qt::ArrowCursor)
|
||||
if (cursor.GetHandle().shape() == Qt::ArrowCursor)
|
||||
QApplication::restoreOverrideCursor();
|
||||
else
|
||||
QApplication::setOverrideCursor(cursor.m_qtCursor);
|
||||
QApplication::setOverrideCursor(cursor.GetHandle());
|
||||
}
|
||||
|
||||
void wxBeginBusyCursor(const wxCursor *cursor)
|
||||
{
|
||||
QApplication::setOverrideCursor(cursor->m_qtCursor);
|
||||
QApplication::setOverrideCursor(cursor->GetHandle());
|
||||
}
|
||||
|
||||
bool wxIsBusy()
|
||||
|
|
@ -45,13 +45,22 @@ void wxEndBusyCursor()
|
|||
QApplication::restoreOverrideCursor();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxCursorRefData
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxCursorRefData: public wxGDIRefData
|
||||
{
|
||||
public:
|
||||
wxCursorRefData() {}
|
||||
wxCursorRefData( const wxCursorRefData& data ) : m_qtCursor(data.m_qtCursor) {}
|
||||
wxCursorRefData( QCursor &c ) : m_qtCursor(c) {}
|
||||
|
||||
QCursor m_qtCursor;
|
||||
};
|
||||
|
||||
wxIMPLEMENT_DYNAMIC_CLASS(wxCursor, wxGDIObject);
|
||||
|
||||
wxCursor::wxCursor( const wxCursor &cursor )
|
||||
{
|
||||
m_qtCursor = cursor.m_qtCursor;
|
||||
}
|
||||
|
||||
#if wxUSE_IMAGE
|
||||
wxCursor::wxCursor(const wxString& cursor_file,
|
||||
|
|
@ -77,14 +86,26 @@ wxCursor::wxCursor(const wxImage& img)
|
|||
}
|
||||
#endif
|
||||
|
||||
wxPoint wxCursor::GetHotSpot() const
|
||||
{
|
||||
return wxQtConvertPoint(GetHandle().hotSpot());
|
||||
}
|
||||
|
||||
QCursor &wxCursor::GetHandle() const
|
||||
{
|
||||
return static_cast<wxCursorRefData*>(m_refData)->m_qtCursor;
|
||||
}
|
||||
|
||||
void wxCursor::InitFromStock( wxStockCursor cursorId )
|
||||
{
|
||||
AllocExclusive();
|
||||
|
||||
Qt::CursorShape qt_cur;
|
||||
switch (cursorId)
|
||||
{
|
||||
case wxCURSOR_BLANK:
|
||||
{
|
||||
m_qtCursor = QBitmap();
|
||||
GetHandle() = QBitmap();
|
||||
return;
|
||||
}
|
||||
// case wxCURSOR_ARROW:
|
||||
|
|
@ -125,28 +146,29 @@ void wxCursor::InitFromStock( wxStockCursor cursorId )
|
|||
break;
|
||||
}
|
||||
|
||||
m_qtCursor.setShape(qt_cur);
|
||||
GetHandle().setShape(qt_cur);
|
||||
}
|
||||
|
||||
#if wxUSE_IMAGE
|
||||
|
||||
void wxCursor::InitFromImage( const wxImage & image )
|
||||
{
|
||||
m_qtCursor = *wxBitmap(image).GetHandle();
|
||||
AllocExclusive();
|
||||
GetHandle() = QCursor(*wxBitmap(image).GetHandle(),
|
||||
image.HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_X) ?
|
||||
image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X) : -1,
|
||||
image.HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y) ?
|
||||
image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y) : -1);
|
||||
}
|
||||
|
||||
#endif // wxUSE_IMAGE
|
||||
|
||||
wxGDIRefData *wxCursor::CreateGDIRefData() const
|
||||
{
|
||||
//return new wxCursorRefData;
|
||||
return NULL;
|
||||
return new wxCursorRefData;
|
||||
}
|
||||
|
||||
wxGDIRefData *
|
||||
wxCursor::CloneGDIRefData(const wxGDIRefData * data) const
|
||||
wxGDIRefData *wxCursor::CloneGDIRefData(const wxGDIRefData *data) const
|
||||
{
|
||||
// return new wxCursorRefData(data->bitmap());
|
||||
return NULL;
|
||||
|
||||
return new wxCursorRefData(*(wxCursorRefData *)data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,18 +12,17 @@
|
|||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "wx/qt/private/converter.h"
|
||||
#include "wx/qt/private/utils.h"
|
||||
#include "wx/dataobj.h"
|
||||
|
||||
#include <QtCore/QMimeData>
|
||||
|
||||
wxDataFormat::wxDataFormat()
|
||||
{
|
||||
}
|
||||
|
||||
static QString DataFormatIdToMimeType( wxDataFormatId formatId )
|
||||
static wxString DataFormatIdToMimeType( wxDataFormatId formatId )
|
||||
{
|
||||
switch(formatId) {
|
||||
case wxDF_TEXT: return "text/plain";
|
||||
|
|
@ -58,32 +57,32 @@ wxDataFormat::wxDataFormat( wxDataFormatId formatId )
|
|||
|
||||
wxDataFormat::wxDataFormat(const wxString &id)
|
||||
{
|
||||
m_MimeType = wxQtConvertString(id);
|
||||
m_MimeType = id;
|
||||
}
|
||||
|
||||
wxDataFormat::wxDataFormat(const wxChar *id)
|
||||
{
|
||||
m_MimeType = wxQtConvertString((wxString)id);
|
||||
m_MimeType = id;
|
||||
}
|
||||
|
||||
wxDataFormat::wxDataFormat(const QString &id)
|
||||
{
|
||||
m_MimeType = id;
|
||||
m_MimeType = wxQtConvertString(id);
|
||||
}
|
||||
|
||||
void wxDataFormat::SetId( const wxChar *id )
|
||||
{
|
||||
m_MimeType = wxQtConvertString((wxString)id);
|
||||
m_MimeType = id;
|
||||
}
|
||||
|
||||
void wxDataFormat::SetId( const wxString& id )
|
||||
{
|
||||
m_MimeType = wxQtConvertString(id);
|
||||
m_MimeType = id;
|
||||
}
|
||||
|
||||
wxString wxDataFormat::GetId() const
|
||||
{
|
||||
return wxQtConvertString(m_MimeType);
|
||||
return m_MimeType;
|
||||
}
|
||||
|
||||
wxDataFormatId wxDataFormat::GetType() const
|
||||
|
|
@ -119,6 +118,16 @@ bool wxDataFormat::operator!=(const wxDataFormat& format) const
|
|||
|
||||
//#############################################################################
|
||||
|
||||
wxDataObject::wxDataObject()
|
||||
{
|
||||
m_qtMimeData = new QMimeData;
|
||||
}
|
||||
|
||||
wxDataObject::~wxDataObject()
|
||||
{
|
||||
delete m_qtMimeData;
|
||||
}
|
||||
|
||||
bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, Direction) const
|
||||
{
|
||||
return wxDataFormat(format) != wxDF_INVALID;
|
||||
|
|
@ -126,21 +135,21 @@ bool wxDataObject::IsSupportedFormat(const wxDataFormat& format, Direction) cons
|
|||
wxDataFormat wxDataObject::GetPreferredFormat(Direction) const
|
||||
{
|
||||
/* formats are in order of preference */
|
||||
if (m_qtMimeData.formats().count())
|
||||
return m_qtMimeData.formats().first();
|
||||
if (m_qtMimeData->formats().count())
|
||||
return m_qtMimeData->formats().first();
|
||||
|
||||
return wxDataFormat();
|
||||
}
|
||||
|
||||
size_t wxDataObject::GetFormatCount(Direction) const
|
||||
{
|
||||
return m_qtMimeData.formats().count();
|
||||
return m_qtMimeData->formats().count();
|
||||
}
|
||||
|
||||
void wxDataObject::GetAllFormats(wxDataFormat *formats, Direction) const
|
||||
{
|
||||
int i = 0;
|
||||
foreach (QString format, m_qtMimeData.formats())
|
||||
foreach (QString format, m_qtMimeData->formats())
|
||||
{
|
||||
formats[i] = format;
|
||||
i++;
|
||||
|
|
@ -149,15 +158,15 @@ void wxDataObject::GetAllFormats(wxDataFormat *formats, Direction) const
|
|||
|
||||
size_t wxDataObject::GetDataSize(const wxDataFormat& format) const
|
||||
{
|
||||
return m_qtMimeData.data( format.m_MimeType ).count();
|
||||
return m_qtMimeData->data( wxQtConvertString(format.m_MimeType) ).count();
|
||||
}
|
||||
|
||||
bool wxDataObject::GetDataHere(const wxDataFormat& format, void *buf) const
|
||||
{
|
||||
if (!m_qtMimeData.hasFormat(format.m_MimeType))
|
||||
if (!m_qtMimeData->hasFormat(wxQtConvertString(format.m_MimeType)))
|
||||
return false;
|
||||
|
||||
QByteArray data = m_qtMimeData.data( format.m_MimeType ).data();
|
||||
QByteArray data = m_qtMimeData->data( wxQtConvertString(format.m_MimeType) ).data();
|
||||
memcpy(buf, data.constData(), data.size());
|
||||
return true;
|
||||
}
|
||||
|
|
@ -165,7 +174,7 @@ bool wxDataObject::GetDataHere(const wxDataFormat& format, void *buf) const
|
|||
bool wxDataObject::SetData(const wxDataFormat& format, size_t len, const void * buf)
|
||||
{
|
||||
QByteArray bytearray((const char*)buf, len);
|
||||
m_qtMimeData.setData(format.m_MimeType, bytearray);
|
||||
m_qtMimeData->setData(wxQtConvertString(format.m_MimeType), bytearray);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@
|
|||
#endif
|
||||
|
||||
#include <QtGui/QBitmap>
|
||||
#include <QtGui/QPen>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/icon.h"
|
||||
|
|
@ -24,6 +26,8 @@
|
|||
#include "wx/qt/private/converter.h"
|
||||
#include "wx/qt/private/utils.h"
|
||||
|
||||
#include <QtGui/QScreen>
|
||||
#include <QtWidgets/QApplication>
|
||||
|
||||
static void SetPenColour( QPainter *qtPainter, QColor col )
|
||||
{
|
||||
|
|
@ -45,6 +49,8 @@ wxQtDCImpl::wxQtDCImpl( wxDC *owner )
|
|||
m_clippingRegion = new wxRegion;
|
||||
m_qtImage = NULL;
|
||||
m_rasterColourOp = wxQtNONE;
|
||||
m_qtPenColor = new QColor;
|
||||
m_qtBrushColor = new QColor;
|
||||
m_ok = true;
|
||||
}
|
||||
|
||||
|
|
@ -58,8 +64,10 @@ wxQtDCImpl::~wxQtDCImpl()
|
|||
}
|
||||
delete m_qtPainter;
|
||||
}
|
||||
if ( m_clippingRegion != NULL )
|
||||
delete m_clippingRegion;
|
||||
|
||||
delete m_clippingRegion;
|
||||
delete m_qtPenColor;
|
||||
delete m_qtBrushColor;
|
||||
}
|
||||
|
||||
void wxQtDCImpl::QtPreparePainter( )
|
||||
|
|
@ -91,7 +99,7 @@ void wxQtDCImpl::QtPreparePainter( )
|
|||
}
|
||||
else
|
||||
{
|
||||
wxLogDebug(wxT("wxQtDCImpl::QtPreparePainter not active!"));
|
||||
// wxLogDebug(wxT("wxQtDCImpl::QtPreparePainter not active!"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -124,7 +132,11 @@ int wxQtDCImpl::GetDepth() const
|
|||
|
||||
wxSize wxQtDCImpl::GetPPI() const
|
||||
{
|
||||
return wxSize(m_qtPainter->device()->logicalDpiX(), m_qtPainter->device()->logicalDpiY());
|
||||
QScreen *srn = QApplication::screens().at(0);
|
||||
if (!srn)
|
||||
return wxSize(m_qtPainter->device()->logicalDpiX(), m_qtPainter->device()->logicalDpiY());
|
||||
qreal dotsPerInch = srn->logicalDotsPerInch();
|
||||
return wxSize(round(dotsPerInch), round(dotsPerInch));
|
||||
}
|
||||
|
||||
void wxQtDCImpl::SetFont(const wxFont& font)
|
||||
|
|
@ -152,7 +164,7 @@ void wxQtDCImpl::SetBrush(const wxBrush& brush)
|
|||
{
|
||||
// Use a monochrome mask: use foreground color for the mask
|
||||
QBrush b(brush.GetHandle());
|
||||
b.setColor(m_textForegroundColour.GetHandle());
|
||||
b.setColor(m_textForegroundColour.GetQColor());
|
||||
b.setTexture(b.texture().mask());
|
||||
m_qtPainter->setBrush(b);
|
||||
}
|
||||
|
|
@ -192,6 +204,10 @@ void wxQtDCImpl::SetBackgroundMode(int mode)
|
|||
m_backgroundMode = mode;
|
||||
}
|
||||
|
||||
#include <QtGui/QPen>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QScreen>
|
||||
#include <QtWidgets/QApplication>
|
||||
|
||||
#if wxUSE_PALETTE
|
||||
void wxQtDCImpl::SetPalette(const wxPalette& WXUNUSED(palette))
|
||||
|
|
@ -279,8 +295,8 @@ void wxQtDCImpl::SetLogicalFunction(wxRasterOperationMode function)
|
|||
m_rasterColourOp = rasterColourOp;
|
||||
|
||||
// Restore original colours and apply new mode
|
||||
SetPenColour( m_qtPainter, m_qtPenColor );
|
||||
SetBrushColour( m_qtPainter, m_qtPenColor );
|
||||
SetPenColour( m_qtPainter, *m_qtPenColor );
|
||||
SetBrushColour( m_qtPainter, *m_qtPenColor );
|
||||
|
||||
ApplyRasterColourOp();
|
||||
}
|
||||
|
|
@ -289,8 +305,8 @@ void wxQtDCImpl::SetLogicalFunction(wxRasterOperationMode function)
|
|||
void wxQtDCImpl::ApplyRasterColourOp()
|
||||
{
|
||||
// Save colours
|
||||
m_qtPenColor = m_qtPainter->pen().color();
|
||||
m_qtBrushColor = m_qtPainter->brush().color();
|
||||
*m_qtPenColor = m_qtPainter->pen().color();
|
||||
*m_qtBrushColor = m_qtPainter->brush().color();
|
||||
|
||||
// Apply op
|
||||
switch ( m_rasterColourOp )
|
||||
|
|
@ -304,8 +320,8 @@ void wxQtDCImpl::ApplyRasterColourOp()
|
|||
SetBrushColour( m_qtPainter, QColor( Qt::black ) );
|
||||
break;
|
||||
case wxQtINVERT:
|
||||
SetPenColour( m_qtPainter, QColor( ~m_qtPenColor.rgb() ) );
|
||||
SetBrushColour( m_qtPainter, QColor( ~m_qtBrushColor.rgb() ) );
|
||||
SetPenColour( m_qtPainter, QColor( ~m_qtPenColor->rgb() ) );
|
||||
SetBrushColour( m_qtPainter, QColor( ~m_qtBrushColor->rgb() ) );
|
||||
break;
|
||||
case wxQtNONE:
|
||||
// No op
|
||||
|
|
@ -332,9 +348,11 @@ void wxQtDCImpl::DoGetTextExtent(const wxString& string,
|
|||
wxCoord *externalLeading,
|
||||
const wxFont *theFont ) const
|
||||
{
|
||||
QFont f = m_qtPainter->font();
|
||||
QFont f;
|
||||
if (theFont != NULL)
|
||||
f = theFont->GetHandle();
|
||||
else
|
||||
f = m_font.GetHandle();
|
||||
|
||||
QFontMetrics metrics(f);
|
||||
if (x != NULL || y != NULL)
|
||||
|
|
@ -579,7 +597,7 @@ void wxQtDCImpl::DoDrawEllipse(wxCoord x, wxCoord y,
|
|||
// Save pen/brush
|
||||
savedBrush = m_qtPainter->brush();
|
||||
// Fill with text background color ("no fill" like in wxGTK):
|
||||
m_qtPainter->setBrush(QBrush(m_textBackgroundColour.GetHandle()));
|
||||
m_qtPainter->setBrush(QBrush(m_textBackgroundColour.GetQColor()));
|
||||
}
|
||||
|
||||
// Draw
|
||||
|
|
@ -624,8 +642,8 @@ void wxQtDCImpl::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
|||
QPen savedPen = m_qtPainter->pen();
|
||||
|
||||
//Use text colors
|
||||
m_qtPainter->setBackground(QBrush(m_textBackgroundColour.GetHandle()));
|
||||
m_qtPainter->setPen(QPen(m_textForegroundColour.GetHandle()));
|
||||
m_qtPainter->setBackground(QBrush(m_textBackgroundColour.GetQColor()));
|
||||
m_qtPainter->setPen(QPen(m_textForegroundColour.GetQColor()));
|
||||
|
||||
//Draw
|
||||
m_qtPainter->drawPixmap(x, y, pix);
|
||||
|
|
@ -633,21 +651,11 @@ void wxQtDCImpl::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
|||
//Restore saved settings
|
||||
m_qtPainter->setBackground(savedBrush);
|
||||
m_qtPainter->setPen(savedPen);
|
||||
} else {
|
||||
if ( !useMask && bmp.GetMask() )
|
||||
{
|
||||
// Temporarly disable mask
|
||||
QBitmap mask;
|
||||
mask = pix.mask();
|
||||
pix.setMask( QBitmap() );
|
||||
|
||||
// Draw
|
||||
m_qtPainter->drawPixmap(x, y, pix);
|
||||
|
||||
// Restore saved mask
|
||||
pix.setMask( mask );
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( useMask && bmp.GetMask() && bmp.GetMask()->GetHandle() )
|
||||
pix.setMask(*bmp.GetMask()->GetHandle());
|
||||
m_qtPainter->drawPixmap(x, y, pix);
|
||||
}
|
||||
}
|
||||
|
|
@ -655,7 +663,7 @@ void wxQtDCImpl::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
|
|||
void wxQtDCImpl::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
||||
{
|
||||
QPen savedPen = m_qtPainter->pen();
|
||||
m_qtPainter->setPen(QPen(m_textForegroundColour.GetHandle()));
|
||||
m_qtPainter->setPen(QPen(m_textForegroundColour.GetQColor()));
|
||||
|
||||
// Disable logical function
|
||||
QPainter::CompositionMode savedOp = m_qtPainter->compositionMode();
|
||||
|
|
@ -669,7 +677,7 @@ void wxQtDCImpl::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
|
|||
QBrush savedBrush = m_qtPainter->background();
|
||||
|
||||
//Use text colors
|
||||
m_qtPainter->setBackground(QBrush(m_textBackgroundColour.GetHandle()));
|
||||
m_qtPainter->setBackground(QBrush(m_textBackgroundColour.GetQColor()));
|
||||
|
||||
//Draw
|
||||
m_qtPainter->drawText(x, y, 1, 1, Qt::TextDontClip, wxQtConvertString(text));
|
||||
|
|
@ -698,7 +706,7 @@ void wxQtDCImpl::DoDrawRotatedText(const wxString& text,
|
|||
m_qtPainter->rotate(-angle);
|
||||
|
||||
QPen savedPen = m_qtPainter->pen();
|
||||
m_qtPainter->setPen(QPen(m_textForegroundColour.GetHandle()));
|
||||
m_qtPainter->setPen(QPen(m_textForegroundColour.GetQColor()));
|
||||
|
||||
// Disable logical function
|
||||
QPainter::CompositionMode savedOp = m_qtPainter->compositionMode();
|
||||
|
|
@ -712,7 +720,7 @@ void wxQtDCImpl::DoDrawRotatedText(const wxString& text,
|
|||
QBrush savedBrush = m_qtPainter->background();
|
||||
|
||||
//Use text colors
|
||||
m_qtPainter->setBackground(QBrush(m_textBackgroundColour.GetHandle()));
|
||||
m_qtPainter->setBackground(QBrush(m_textBackgroundColour.GetQColor()));
|
||||
|
||||
//Draw
|
||||
m_qtPainter->drawText(x, y, 1, 1, Qt::TextDontClip, wxQtConvertString(text));
|
||||
|
|
@ -742,7 +750,7 @@ bool wxQtDCImpl::DoBlit(wxCoord xdest, wxCoord ydest,
|
|||
{
|
||||
wxQtDCImpl *implSource = (wxQtDCImpl*)source->GetImpl();
|
||||
|
||||
QImage *qtSource = implSource->m_qtImage;
|
||||
QImage *qtSource = implSource->GetQImage();
|
||||
|
||||
// Not a CHECK on purpose
|
||||
if ( !qtSource )
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@
|
|||
#include "wx/dcclient.h"
|
||||
#include "wx/qt/dcclient.h"
|
||||
|
||||
#include <QtWidgets/QScrollArea>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
//##############################################################################
|
||||
|
||||
|
|
@ -29,6 +31,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner )
|
|||
: wxQtDCImpl( owner )
|
||||
{
|
||||
m_window = NULL;
|
||||
m_qtImage = NULL;
|
||||
m_ok = false;
|
||||
m_qtPainter = new QPainter();
|
||||
}
|
||||
|
|
@ -37,6 +40,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *win )
|
|||
: wxQtDCImpl( owner )
|
||||
{
|
||||
m_window = win;
|
||||
m_qtImage = NULL;
|
||||
m_qtPainter = m_window->QtGetPainter();
|
||||
// if we're not inside a Paint event, painter will invalid
|
||||
m_ok = m_qtPainter != NULL;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
#include "wx/dcmemory.h"
|
||||
#include "wx/qt/dcmemory.h"
|
||||
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner )
|
||||
: wxQtDCImpl( owner )
|
||||
{
|
||||
|
|
@ -33,6 +35,7 @@ wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *WXUNUSED(dc) )
|
|||
{
|
||||
m_qtImage = NULL;
|
||||
m_ok = false;
|
||||
m_qtPainter = new QPainter();
|
||||
}
|
||||
|
||||
wxMemoryDCImpl::~wxMemoryDCImpl()
|
||||
|
|
@ -67,8 +70,12 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
|
|||
|
||||
m_selected = bitmap;
|
||||
if ( bitmap.IsOk() && !bitmap.GetHandle()->isNull() ) {
|
||||
QPixmap pixmap(*bitmap.GetHandle());
|
||||
// apply mask before converting to image
|
||||
if ( bitmap.GetMask() && bitmap.GetMask()->GetHandle() )
|
||||
pixmap.setMask(*bitmap.GetMask()->GetHandle());
|
||||
// create the intermediate image for the pixmap:
|
||||
m_qtImage = new QImage( bitmap.GetHandle()->toImage() );
|
||||
m_qtImage = new QImage( pixmap.toImage() );
|
||||
// start drawing on the intermediary device:
|
||||
m_ok = m_qtPainter->begin( m_qtImage );
|
||||
|
||||
|
|
@ -78,6 +85,13 @@ void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
|
|||
}
|
||||
}
|
||||
|
||||
wxBitmap wxMemoryDCImpl::DoGetAsBitmap(const wxRect *subrect) const
|
||||
{
|
||||
if ( !subrect )
|
||||
return m_selected;
|
||||
return m_selected.GetSubBitmap(*subrect);
|
||||
}
|
||||
|
||||
const wxBitmap& wxMemoryDCImpl::GetSelectedBitmap() const
|
||||
{
|
||||
return m_selected;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ wxIMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxWindowDCImpl);
|
|||
wxScreenDCImpl::wxScreenDCImpl( wxScreenDC *owner )
|
||||
: wxWindowDCImpl( owner )
|
||||
{
|
||||
m_qtImage = new QImage(QApplication::primaryScreen()->grabWindow(QApplication::desktop()->winId()).toImage());
|
||||
m_qtImage = NULL;
|
||||
}
|
||||
|
||||
wxScreenDCImpl::~wxScreenDCImpl( )
|
||||
|
|
@ -33,3 +33,20 @@ void wxScreenDCImpl::DoGetSize(int *width, int *height) const
|
|||
{
|
||||
wxDisplaySize(width, height);
|
||||
}
|
||||
|
||||
bool wxScreenDCImpl::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
|
||||
{
|
||||
// const_cast<wxScreenDCImpl*>(this)->GetQImage();
|
||||
// return wxQtDCImpl::DoGetPixel(x, y, col);
|
||||
x = y = 0;
|
||||
col = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// defered allocation for blit
|
||||
QImage *wxScreenDCImpl::GetQImage()
|
||||
{
|
||||
if ( !m_qtImage )
|
||||
m_qtImage = new QImage(QApplication::primaryScreen()->grabWindow(QApplication::desktop()->winId()).toImage());
|
||||
return m_qtImage;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include "wx/qt/private/utils.h"
|
||||
#include "wx/qt/private/winevent.h"
|
||||
|
||||
#include <QtWidgets/QDialog>
|
||||
|
||||
class wxQtDialog : public wxQtEventSignalHandler< QDialog, wxDialog >
|
||||
{
|
||||
|
|
@ -58,32 +59,38 @@ bool wxDialog::Create( wxWindow *parent, wxWindowID id,
|
|||
style |= wxTAB_TRAVERSAL;
|
||||
|
||||
m_qtWindow = new wxQtDialog( parent, this );
|
||||
|
||||
PostCreation();
|
||||
|
||||
return wxTopLevelWindow::Create( parent, id, title, pos, size, style, name );
|
||||
}
|
||||
|
||||
int wxDialog::ShowModal()
|
||||
{
|
||||
wxCHECK_MSG( GetHandle() != NULL, -1, "Invalid dialog" );
|
||||
|
||||
return GetHandle()->exec() ? wxID_OK : wxID_CANCEL;
|
||||
|
||||
bool ret = GetDialogHandle()->exec();
|
||||
if ( GetReturnCode() == 0 )
|
||||
return ret ? wxID_OK : wxID_CANCEL;
|
||||
return GetReturnCode();
|
||||
}
|
||||
|
||||
void wxDialog::EndModal(int retCode)
|
||||
{
|
||||
wxCHECK_RET( GetHandle() != NULL, "Invalid dialog" );
|
||||
|
||||
GetHandle()->done( retCode );
|
||||
wxCHECK_RET( GetDialogHandle() != NULL, "Invalid dialog" );
|
||||
|
||||
SetReturnCode(retCode);
|
||||
GetDialogHandle()->done( QDialog::Accepted );
|
||||
}
|
||||
|
||||
bool wxDialog::IsModal() const
|
||||
{
|
||||
wxCHECK_MSG( GetHandle() != NULL, false, "Invalid dialog" );
|
||||
wxCHECK_MSG( GetDialogHandle() != NULL, false, "Invalid dialog" );
|
||||
|
||||
return GetHandle()->isModal();
|
||||
return GetDialogHandle()->isModal();
|
||||
}
|
||||
|
||||
QDialog *wxDialog::GetHandle() const
|
||||
QDialog *wxDialog::GetDialogHandle() const
|
||||
{
|
||||
return static_cast<QDialog*>(m_qtWindow);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,23 @@
|
|||
#include <QtCore/QCoreApplication>
|
||||
#include <QtCore/QAbstractEventDispatcher>
|
||||
#include <QtCore/QSocketNotifier>
|
||||
#include <QtCore/QTimer>
|
||||
|
||||
#include <QtWidgets/QApplication>
|
||||
|
||||
class wxQtIdleTimer : public QTimer
|
||||
{
|
||||
|
||||
public:
|
||||
wxQtIdleTimer( wxQtEventLoopBase *eventLoop );
|
||||
virtual bool eventFilter( QObject * watched, QEvent * event );
|
||||
|
||||
private:
|
||||
void idle();
|
||||
|
||||
private:
|
||||
wxQtEventLoopBase *m_eventLoop;
|
||||
};
|
||||
|
||||
wxQtIdleTimer::wxQtIdleTimer( wxQtEventLoopBase *eventLoop )
|
||||
{
|
||||
|
|
@ -115,7 +132,9 @@ int wxQtEventLoopBase::DispatchTimeout(unsigned long timeout)
|
|||
|
||||
void wxQtEventLoopBase::WakeUp()
|
||||
{
|
||||
QAbstractEventDispatcher::instance()->wakeUp();
|
||||
QAbstractEventDispatcher *instance = QAbstractEventDispatcher::instance();
|
||||
if ( instance )
|
||||
instance->wakeUp();
|
||||
}
|
||||
|
||||
void wxQtEventLoopBase::DoYieldFor(long eventsToProcess)
|
||||
|
|
@ -224,7 +243,7 @@ wxEventLoopSource *wxQtEventLoopBase::AddSourceForFD(int fd, wxEventLoopSourceHa
|
|||
{
|
||||
wxGUIAppTraits *AppTraits = dynamic_cast<wxGUIAppTraits *>(wxApp::GetTraitsIfExists());
|
||||
|
||||
if(AppTraits)
|
||||
if ( AppTraits )
|
||||
return AppTraits->GetEventLoopSourcesManager()->AddSourceForFD(fd, handler, flags);
|
||||
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ wxString wxFileDialog::GetPath() const
|
|||
{
|
||||
wxArrayString paths;
|
||||
GetPaths(paths);
|
||||
if (paths.size() == 0)
|
||||
if (paths.empty())
|
||||
return "";
|
||||
|
||||
return paths[0];
|
||||
|
|
@ -113,7 +113,7 @@ wxString wxFileDialog::GetPath() const
|
|||
|
||||
void wxFileDialog::GetPaths(wxArrayString& paths) const
|
||||
{
|
||||
QStringList selectedfiles = GetHandle()->selectedFiles();
|
||||
QStringList selectedfiles = GetQFileDialog()->selectedFiles();
|
||||
foreach (QString file, selectedfiles)
|
||||
paths.Add(wxQtConvertString(file));
|
||||
}
|
||||
|
|
@ -122,7 +122,7 @@ wxString wxFileDialog::GetFilename() const
|
|||
{
|
||||
wxArrayString filenames;
|
||||
GetFilenames(filenames);
|
||||
if(filenames.size() == 0)
|
||||
if ( filenames.empty() )
|
||||
return "";
|
||||
|
||||
return filenames[0];
|
||||
|
|
@ -130,7 +130,7 @@ wxString wxFileDialog::GetFilename() const
|
|||
|
||||
void wxFileDialog::GetFilenames(wxArrayString& files) const
|
||||
{
|
||||
QStringList selectedfiles = GetHandle()->selectedFiles();
|
||||
QStringList selectedfiles = GetQFileDialog()->selectedFiles();
|
||||
foreach (QString file, selectedfiles )
|
||||
{
|
||||
wxFileName fn = wxQtConvertString(file);
|
||||
|
|
@ -141,9 +141,9 @@ void wxFileDialog::GetFilenames(wxArrayString& files) const
|
|||
int wxFileDialog::GetFilterIndex() const
|
||||
{
|
||||
int index = 0;
|
||||
foreach (QString filter, GetHandle()->nameFilters())
|
||||
foreach (QString filter, GetQFileDialog()->nameFilters())
|
||||
{
|
||||
if (filter == GetHandle()->selectedNameFilter())
|
||||
if (filter == GetQFileDialog()->selectedNameFilter())
|
||||
return index;
|
||||
index++;
|
||||
}
|
||||
|
|
@ -153,17 +153,17 @@ int wxFileDialog::GetFilterIndex() const
|
|||
|
||||
void wxFileDialog::SetMessage(const wxString& message)
|
||||
{
|
||||
GetHandle()->setLabelText(QFileDialog::LookIn, wxQtConvertString(message));
|
||||
GetQFileDialog()->setLabelText(QFileDialog::LookIn, wxQtConvertString(message));
|
||||
}
|
||||
|
||||
void wxFileDialog::SetPath(const wxString& path)
|
||||
{
|
||||
GetHandle()->selectFile(wxQtConvertString(path));
|
||||
GetQFileDialog()->selectFile(wxQtConvertString(path));
|
||||
}
|
||||
|
||||
void wxFileDialog::SetDirectory(const wxString& dir)
|
||||
{
|
||||
GetHandle()->setDirectory(wxQtConvertString(dir));
|
||||
GetQFileDialog()->setDirectory(wxQtConvertString(dir));
|
||||
}
|
||||
|
||||
void wxFileDialog::SetFilename(const wxString& name)
|
||||
|
|
@ -173,19 +173,19 @@ void wxFileDialog::SetFilename(const wxString& name)
|
|||
|
||||
void wxFileDialog::SetWildcard(const wxString& wildCard)
|
||||
{
|
||||
GetHandle()->setNameFilter(wxQtConvertString(wildCard));
|
||||
GetQFileDialog()->setNameFilter(wxQtConvertString(wildCard));
|
||||
}
|
||||
|
||||
void wxFileDialog::SetFilterIndex(int filterIndex)
|
||||
{
|
||||
QStringList filters = GetHandle()->nameFilters();
|
||||
QStringList filters = GetQFileDialog()->nameFilters();
|
||||
if (filterIndex < 0 || filterIndex >= filters.size())
|
||||
return;
|
||||
|
||||
GetHandle()->setNameFilter(filters.at(filterIndex));
|
||||
GetQFileDialog()->setNameFilter(filters.at(filterIndex));
|
||||
}
|
||||
|
||||
QFileDialog *wxFileDialog::GetHandle() const
|
||||
QFileDialog *wxFileDialog::GetQFileDialog() const
|
||||
{
|
||||
return static_cast<QFileDialog *>(m_qtWindow);
|
||||
}
|
||||
|
|
@ -237,7 +237,7 @@ bool wxDirDialog::Create(wxWindow *parent,
|
|||
|
||||
wxString wxDirDialog::GetPath() const
|
||||
{
|
||||
QStringList selectedfiles = GetHandle()->selectedFiles();
|
||||
QStringList selectedfiles = GetQFileDialog()->selectedFiles();
|
||||
if (selectedfiles.size() > 0)
|
||||
return wxQtConvertString(selectedfiles.first());
|
||||
|
||||
|
|
@ -246,10 +246,10 @@ wxString wxDirDialog::GetPath() const
|
|||
|
||||
void wxDirDialog::SetPath(const wxString& path)
|
||||
{
|
||||
GetHandle()->selectFile(wxQtConvertString(path));
|
||||
GetQFileDialog()->selectFile(wxQtConvertString(path));
|
||||
}
|
||||
|
||||
QFileDialog *wxDirDialog::GetHandle() const
|
||||
QFileDialog *wxDirDialog::GetQFileDialog() const
|
||||
{
|
||||
return static_cast<QFileDialog *>(m_qtWindow);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
#include "wx/qt/private/winevent.h"
|
||||
#include "wx/fontdlg.h"
|
||||
|
||||
#include <QtWidgets/QFontDialog>
|
||||
|
||||
class wxQtFontDialog : public wxQtEventSignalHandler< QFontDialog, wxFontDialog >
|
||||
{
|
||||
public:
|
||||
|
|
@ -31,7 +33,7 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog);
|
|||
bool wxFontDialog::DoCreate(wxWindow *parent)
|
||||
{
|
||||
m_qtWindow = new wxQtFontDialog( parent, this );
|
||||
GetHandle()->setCurrentFont(m_fontData.GetInitialFont().GetHandle());
|
||||
static_cast<QFontDialog*>(m_qtWindow)->setCurrentFont(m_fontData.GetInitialFont().GetHandle());
|
||||
return wxFontDialogBase::DoCreate(parent);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,6 @@
|
|||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#include <QtWidgets/QScrollArea>
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/menu.h"
|
||||
#include "wx/toolbar.h"
|
||||
|
|
@ -24,6 +22,9 @@
|
|||
#include "wx/qt/private/converter.h"
|
||||
#include "wx/qt/private/winevent.h"
|
||||
|
||||
#include <QtWidgets/QScrollArea>
|
||||
#include <QtWidgets/QMainWindow>
|
||||
#include <QtWidgets/QMenuBar>
|
||||
|
||||
class wxQtMainWindow : public wxQtEventSignalHandler< QMainWindow, wxFrame >
|
||||
{
|
||||
|
|
@ -31,6 +32,7 @@ public:
|
|||
wxQtMainWindow( wxWindow *parent, wxFrame *handler );
|
||||
|
||||
private:
|
||||
virtual bool focusNextPrevChild(bool) wxOVERRIDE { return false; }
|
||||
};
|
||||
|
||||
// Central widget helper (container to show scroll bars and receive events):
|
||||
|
|
@ -55,7 +57,7 @@ wxFrame::wxFrame( wxWindow *parent, wxWindowID id, const wxString& title,
|
|||
wxFrame::~wxFrame()
|
||||
{
|
||||
// central widget should be deleted by qt when the main window is destroyed
|
||||
QtStoreWindowPointer( GetHandle()->centralWidget(), NULL );
|
||||
QtStoreWindowPointer( GetQMainWindow()->centralWidget(), NULL );
|
||||
}
|
||||
|
||||
bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
|
|
@ -66,7 +68,7 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString& title,
|
|||
// TODO: Could we use a wxPanel as the central widget? If so then we could
|
||||
// remove wxWindow::QtReparent.
|
||||
|
||||
GetHandle()->setCentralWidget( new wxQtCentralWidget( parent, this ) );
|
||||
GetQMainWindow()->setCentralWidget( new wxQtCentralWidget( parent, this ) );
|
||||
|
||||
PostCreation();
|
||||
|
||||
|
|
@ -82,13 +84,13 @@ void wxFrame::SetMenuBar( wxMenuBar *menuBar )
|
|||
wxCHECK_RET( menuBar->GetHandle(),
|
||||
"Using a replaced menu bar is not supported in wxQT");
|
||||
// Warning: Qt main window takes ownership of the QMenuBar pointer:
|
||||
GetHandle()->setMenuBar( menuBar->GetHandle() );
|
||||
GetQMainWindow()->setMenuBar( menuBar->GetQMenuBar() );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Creating an empty menu bar should hide it and free the previous:
|
||||
QMenuBar *qmenubar = new QMenuBar(GetHandle());
|
||||
GetHandle()->setMenuBar( qmenubar );
|
||||
GetQMainWindow()->setMenuBar( qmenubar );
|
||||
}
|
||||
wxFrameBase::SetMenuBar( menuBar );
|
||||
}
|
||||
|
|
@ -99,14 +101,14 @@ void wxFrame::SetStatusBar( wxStatusBar *statusBar )
|
|||
// TODO: add a mechanism like Detach in menus to avoid issues
|
||||
if ( statusBar != NULL )
|
||||
{
|
||||
GetHandle()->setStatusBar( statusBar->GetHandle() );
|
||||
GetQMainWindow()->setStatusBar( statusBar->GetQStatusBar() );
|
||||
// Update statusbar sizes now that it has a size
|
||||
statusBar->Refresh();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Remove the current status bar
|
||||
GetHandle()->setStatusBar(NULL);
|
||||
GetQMainWindow()->setStatusBar(NULL);
|
||||
}
|
||||
wxFrameBase::SetStatusBar( statusBar );
|
||||
}
|
||||
|
|
@ -121,11 +123,11 @@ void wxFrame::SetToolBar(wxToolBar *toolbar)
|
|||
if (toolbar->HasFlag(wxTB_TOP)) area |= Qt::TopToolBarArea;
|
||||
if (toolbar->HasFlag(wxTB_BOTTOM)) area |= Qt::BottomToolBarArea;
|
||||
|
||||
GetHandle()->addToolBar((Qt::ToolBarArea)area, toolbar->GetHandle());
|
||||
GetQMainWindow()->addToolBar((Qt::ToolBarArea)area, toolbar->GetQToolBar());
|
||||
}
|
||||
else if ( m_frameToolBar != NULL )
|
||||
{
|
||||
GetHandle()->removeToolBar(m_frameToolBar->GetHandle());
|
||||
GetQMainWindow()->removeToolBar(m_frameToolBar->GetQToolBar());
|
||||
}
|
||||
wxFrameBase::SetToolBar( toolbar );
|
||||
}
|
||||
|
|
@ -134,7 +136,7 @@ void wxFrame::SetWindowStyleFlag( long style )
|
|||
{
|
||||
wxWindow::SetWindowStyleFlag( style );
|
||||
|
||||
Qt::WindowFlags qtFlags = GetHandle()->windowFlags();
|
||||
Qt::WindowFlags qtFlags = GetQMainWindow()->windowFlags();
|
||||
|
||||
if ( HasFlag( wxFRAME_TOOL_WINDOW ) )
|
||||
{
|
||||
|
|
@ -142,14 +144,14 @@ void wxFrame::SetWindowStyleFlag( long style )
|
|||
qtFlags |= Qt::Tool;
|
||||
}
|
||||
|
||||
GetHandle()->setWindowFlags( qtFlags );
|
||||
GetQMainWindow()->setWindowFlags( qtFlags );
|
||||
}
|
||||
|
||||
void wxFrame::AddChild( wxWindowBase *child )
|
||||
{
|
||||
// Make sure all children are children of the central widget:
|
||||
|
||||
QtReparent( child->GetHandle(), GetHandle()->centralWidget() );
|
||||
QtReparent( child->GetHandle(), GetQMainWindow()->centralWidget() );
|
||||
|
||||
wxFrameBase::AddChild( child );
|
||||
}
|
||||
|
|
@ -159,9 +161,9 @@ void wxFrame::RemoveChild( wxWindowBase *child )
|
|||
wxFrameBase::RemoveChild( child );
|
||||
}
|
||||
|
||||
QAbstractScrollArea *wxFrame::QtGetScrollBarsContainer() const
|
||||
QScrollArea *wxFrame::QtGetScrollBarsContainer() const
|
||||
{
|
||||
return dynamic_cast <QAbstractScrollArea *> (GetHandle()->centralWidget() );
|
||||
return dynamic_cast <QScrollArea *> (GetQMainWindow()->centralWidget() );
|
||||
}
|
||||
|
||||
void wxFrame::DoGetClientSize(int *width, int *height) const
|
||||
|
|
@ -178,6 +180,11 @@ void wxFrame::DoGetClientSize(int *width, int *height) const
|
|||
}
|
||||
}
|
||||
|
||||
QMainWindow *wxFrame::GetQMainWindow() const
|
||||
{
|
||||
return static_cast<QMainWindow*>(m_qtWindow);
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
||||
wxQtMainWindow::wxQtMainWindow( wxWindow *parent, wxFrame *handler )
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include "wx/qt/private/converter.h"
|
||||
#include "wx/qt/private/winevent.h"
|
||||
|
||||
#include <QtWidgets/QProgressBar>
|
||||
|
||||
class wxQtProgressBar : public wxQtEventSignalHandler< QProgressBar, wxGauge >
|
||||
{
|
||||
|
|
@ -62,7 +63,7 @@ bool wxGauge::Create(wxWindow *parent,
|
|||
}
|
||||
|
||||
|
||||
QProgressBar *wxGauge::GetHandle() const
|
||||
QWidget *wxGauge::GetHandle() const
|
||||
{
|
||||
return m_qtProgressBar;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
#include "wx/qt/private/winevent.h"
|
||||
#include "wx/glcanvas.h"
|
||||
|
||||
#include <QtOpenGL/QGLWidget>
|
||||
|
||||
class wxQtGLWidget : public wxQtEventSignalHandler< QGLWidget, wxGLCanvas >
|
||||
{
|
||||
public:
|
||||
|
|
@ -64,6 +66,263 @@ void wxQtGLWidget::paintGL()
|
|||
EmitEvent(event);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGLContextAttrs: OpenGL rendering context attributes
|
||||
// ----------------------------------------------------------------------------
|
||||
// GLX specific values
|
||||
|
||||
wxGLContextAttrs& wxGLContextAttrs::CoreProfile()
|
||||
{
|
||||
// AddAttribBits(GLX_CONTEXT_PROFILE_MASK_ARB,
|
||||
// GLX_CONTEXT_CORE_PROFILE_BIT_ARB);
|
||||
SetNeedsARB();
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLContextAttrs& wxGLContextAttrs::MajorVersion(int val)
|
||||
{
|
||||
if ( val > 0 )
|
||||
{
|
||||
if ( val >= 3 )
|
||||
SetNeedsARB();
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLContextAttrs& wxGLContextAttrs::MinorVersion(int val)
|
||||
{
|
||||
if ( val >= 0 )
|
||||
{
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLContextAttrs& wxGLContextAttrs::CompatibilityProfile()
|
||||
{
|
||||
SetNeedsARB();
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLContextAttrs& wxGLContextAttrs::ForwardCompatible()
|
||||
{
|
||||
SetNeedsARB();
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLContextAttrs& wxGLContextAttrs::ES2()
|
||||
{
|
||||
SetNeedsARB();
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLContextAttrs& wxGLContextAttrs::DebugCtx()
|
||||
{
|
||||
SetNeedsARB();
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLContextAttrs& wxGLContextAttrs::Robust()
|
||||
{
|
||||
SetNeedsARB();
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLContextAttrs& wxGLContextAttrs::NoResetNotify()
|
||||
{
|
||||
SetNeedsARB();
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLContextAttrs& wxGLContextAttrs::LoseOnReset()
|
||||
{
|
||||
SetNeedsARB();
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLContextAttrs& wxGLContextAttrs::ResetIsolation()
|
||||
{
|
||||
SetNeedsARB();
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLContextAttrs& wxGLContextAttrs::ReleaseFlush(int val)
|
||||
{
|
||||
SetNeedsARB();
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLContextAttrs& wxGLContextAttrs::PlatformDefaults()
|
||||
{
|
||||
renderTypeRGBA = true;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void wxGLContextAttrs::EndList()
|
||||
{
|
||||
// AddAttribute(None);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGLAttributes: Visual/FBconfig attributes
|
||||
// ----------------------------------------------------------------------------
|
||||
// GLX specific values
|
||||
|
||||
// Different versions of GLX API use rather different attributes lists, see
|
||||
// the following URLs:
|
||||
//
|
||||
// - <= 1.2: http://www.opengl.org/sdk/docs/man/xhtml/glXChooseVisual.xml
|
||||
// - >= 1.3: http://www.opengl.org/sdk/docs/man/xhtml/glXChooseFBConfig.xml
|
||||
//
|
||||
// Notice in particular that
|
||||
// - GLX_RGBA is boolean attribute in the old version of the API but a
|
||||
// value of GLX_RENDER_TYPE in the new one
|
||||
// - Boolean attributes such as GLX_DOUBLEBUFFER don't take values in the
|
||||
// old version but must be followed by True or False in the new one.
|
||||
|
||||
wxGLAttributes& wxGLAttributes::RGBA()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLAttributes& wxGLAttributes::BufferSize(int val)
|
||||
{
|
||||
if ( val >= 0 )
|
||||
{
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLAttributes& wxGLAttributes::Level(int val)
|
||||
{
|
||||
// AddAttribute(GLX_LEVEL);
|
||||
AddAttribute(val);
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLAttributes& wxGLAttributes::DoubleBuffer()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLAttributes& wxGLAttributes::Stereo()
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLAttributes& wxGLAttributes::AuxBuffers(int val)
|
||||
{
|
||||
if ( val >= 0 )
|
||||
{
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLAttributes& wxGLAttributes::MinRGBA(int mRed, int mGreen, int mBlue, int mAlpha)
|
||||
{
|
||||
if ( mRed >= 0)
|
||||
{
|
||||
}
|
||||
if ( mGreen >= 0)
|
||||
{
|
||||
}
|
||||
if ( mBlue >= 0)
|
||||
{
|
||||
}
|
||||
if ( mAlpha >= 0)
|
||||
{
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLAttributes& wxGLAttributes::Depth(int val)
|
||||
{
|
||||
if ( val >= 0 )
|
||||
{
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLAttributes& wxGLAttributes::Stencil(int val)
|
||||
{
|
||||
if ( val >= 0 )
|
||||
{
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLAttributes& wxGLAttributes::MinAcumRGBA(int mRed, int mGreen, int mBlue, int mAlpha)
|
||||
{
|
||||
if ( mRed >= 0)
|
||||
{
|
||||
}
|
||||
if ( mGreen >= 0)
|
||||
{
|
||||
}
|
||||
if ( mBlue >= 0)
|
||||
{
|
||||
}
|
||||
if ( mAlpha >= 0)
|
||||
{
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLAttributes& wxGLAttributes::SampleBuffers(int val)
|
||||
{
|
||||
#ifdef GLX_SAMPLE_BUFFERS_ARB
|
||||
if ( val >= 0 && wxGLCanvasX11::IsGLXMultiSampleAvailable() )
|
||||
{
|
||||
AddAttribute(GLX_SAMPLE_BUFFERS_ARB);
|
||||
AddAttribute(val);
|
||||
}
|
||||
#endif
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLAttributes& wxGLAttributes::Samplers(int val)
|
||||
{
|
||||
#ifdef GLX_SAMPLES_ARB
|
||||
if ( val >= 0 && wxGLCanvasX11::IsGLXMultiSampleAvailable() )
|
||||
{
|
||||
AddAttribute(GLX_SAMPLES_ARB);
|
||||
AddAttribute(val);
|
||||
}
|
||||
#endif
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLAttributes& wxGLAttributes::FrameBuffersRGB()
|
||||
{
|
||||
// AddAttribute(GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB);
|
||||
// AddAttribute(True);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void wxGLAttributes::EndList()
|
||||
{
|
||||
}
|
||||
|
||||
wxGLAttributes& wxGLAttributes::PlatformDefaults()
|
||||
{
|
||||
// No GLX specific values
|
||||
return *this;
|
||||
}
|
||||
|
||||
wxGLAttributes& wxGLAttributes::Defaults()
|
||||
{
|
||||
RGBA().DoubleBuffer();
|
||||
// if ( wxGLCanvasX11::GetGLXVersion() < 13 )
|
||||
// Depth(1).MinRGBA(1, 1, 1, 0);
|
||||
// else
|
||||
Depth(16).SampleBuffers(1).Samplers(4);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void wxGLAttributes::AddDefaultsForWXBefore31()
|
||||
{
|
||||
Defaults();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// wxGlContext
|
||||
//---------------------------------------------------------------------------
|
||||
|
|
@ -125,7 +384,7 @@ bool wxGLCanvas::Create(wxWindow *parent,
|
|||
|
||||
bool wxGLCanvas::SwapBuffers()
|
||||
{
|
||||
GetHandle()->swapBuffers();
|
||||
static_cast<QGLWidget *>(m_qtWindow)->swapBuffers();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -229,7 +488,7 @@ bool wxGLCanvas::ConvertWXAttrsToQtGL(const int *wxattrs, QGLFormat &format)
|
|||
}
|
||||
|
||||
if ( !isBoolAttr ) {
|
||||
if(!v)
|
||||
if ( !v )
|
||||
return false; // zero parameter
|
||||
arg++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include "wx/listbox.h"
|
||||
#include "wx/qt/private/winevent.h"
|
||||
|
||||
#include <QtWidgets/QListWidget>
|
||||
|
||||
class wxQtListWidget : public wxQtEventSignalHandler< QListWidget, wxListBox >
|
||||
{
|
||||
|
|
@ -157,11 +158,6 @@ void wxListBox::SetString(unsigned int n, const wxString& WXUNUSED(s))
|
|||
}
|
||||
}
|
||||
|
||||
void wxListBox::SetSelection(int n)
|
||||
{
|
||||
return m_qtListWidget->setCurrentRow(n);
|
||||
}
|
||||
|
||||
int wxListBox::GetSelection() const
|
||||
{
|
||||
return m_qtListWidget->currentIndex().row();
|
||||
|
|
@ -225,7 +221,7 @@ void wxListBox::DoDeleteOneItem(unsigned int pos)
|
|||
delete item;
|
||||
}
|
||||
|
||||
QListWidget *wxListBox::GetHandle() const
|
||||
QWidget *wxListBox::GetHandle() const
|
||||
{
|
||||
return m_qtListWidget;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include "wx/imaglist.h"
|
||||
#include "wx/qt/private/winevent.h"
|
||||
|
||||
#include <QtWidgets/QTreeWidget>
|
||||
|
||||
class wxQtTreeWidget : public wxQtEventSignalHandler< QTreeWidget, wxListCtrl >
|
||||
{
|
||||
|
|
@ -300,6 +301,8 @@ bool wxListCtrl::GetItem(wxListItem& info) const
|
|||
bool wxListCtrl::SetItem(wxListItem& info)
|
||||
{
|
||||
const long id = info.GetId();
|
||||
if ( id < 0 )
|
||||
return false;
|
||||
QTreeWidgetItem *qitem = QtGetItem(id);
|
||||
if ( qitem != NULL )
|
||||
{
|
||||
|
|
@ -344,9 +347,9 @@ bool wxListCtrl::SetItem(wxListItem& info)
|
|||
if ( info.GetFont().IsOk() )
|
||||
qitem->setFont(col, info.GetFont().GetHandle() );
|
||||
if ( info.GetTextColour().IsOk() )
|
||||
qitem->setTextColor(col, info.GetTextColour().GetHandle());
|
||||
qitem->setTextColor(col, info.GetTextColour().GetQColor());
|
||||
if ( info.GetBackgroundColour().IsOk() )
|
||||
qitem->setBackgroundColor(col, info.GetBackgroundColour().GetHandle());
|
||||
qitem->setBackgroundColor(col, info.GetBackgroundColour().GetQColor());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -916,7 +919,7 @@ int wxListCtrl::OnGetItemColumnImage(long item, long column) const
|
|||
return -1;
|
||||
}
|
||||
|
||||
QTreeWidget *wxListCtrl::GetHandle() const
|
||||
QWidget *wxListCtrl::GetHandle() const
|
||||
{
|
||||
return m_qtTreeWidget;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@
|
|||
#include "wx/qt/private/utils.h"
|
||||
#include "wx/qt/private/converter.h"
|
||||
#include "wx/qt/private/winevent.h"
|
||||
|
||||
#include <QtWidgets/QMdiArea>
|
||||
#include <QtWidgets/QMainWindow>
|
||||
|
||||
// Main MDI window helper
|
||||
|
||||
|
|
@ -69,7 +71,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent,
|
|||
if ( !m_clientWindow->CreateClient(this, GetWindowStyleFlag()) )
|
||||
return false;
|
||||
|
||||
GetHandle()->setCentralWidget( client->GetHandle() );
|
||||
GetQMainWindow()->setCentralWidget( client->GetHandle() );
|
||||
|
||||
PostCreation();
|
||||
|
||||
|
|
@ -116,7 +118,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
|
|||
if (ok)
|
||||
{
|
||||
// Add the window to the internal MDI client area:
|
||||
static_cast<QMdiArea*>(parent->GetHandle()->centralWidget())->addSubWindow(GetHandle());
|
||||
static_cast<QMdiArea*>(parent->GetQMainWindow()->centralWidget())->addSubWindow(GetHandle());
|
||||
}
|
||||
return ok;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
#include "wx/qt/private/utils.h"
|
||||
#include "wx/qt/private/converter.h"
|
||||
|
||||
#include <QtWidgets/QMenu>
|
||||
#include <QtWidgets/QMenuBar>
|
||||
|
||||
static void ApplyStyle( QMenu *qtMenu, long style )
|
||||
{
|
||||
|
|
@ -245,7 +247,7 @@ void wxMenuBar::Detach()
|
|||
wxMenuBarBase::Detach();
|
||||
}
|
||||
|
||||
QMenuBar *wxMenuBar::GetHandle() const
|
||||
QWidget *wxMenuBar::GetHandle() const
|
||||
{
|
||||
return m_qtMenuBar;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@
|
|||
#include "wx/qt/private/converter.h"
|
||||
#include "wx/qt/private/winevent.h"
|
||||
|
||||
#include <QtWidgets/QAction>
|
||||
#include <QtWidgets/QMenuBar>
|
||||
|
||||
class wxQtAction : public QAction, public wxQtSignalHandler< wxMenuItem >
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,39 +27,40 @@ wxMessageDialog::wxMessageDialog( wxWindow *parent, const wxString& message,
|
|||
const wxString& caption, long style, const wxPoint& pos )
|
||||
: wxMessageDialogBase( parent, message, caption, style )
|
||||
{
|
||||
m_qtWindow = new wxQtMessageDialog( parent, this );
|
||||
wxQtMessageDialog *dlg = new wxQtMessageDialog( parent, this );
|
||||
m_qtWindow = dlg;
|
||||
|
||||
// Set properties
|
||||
Move( pos );
|
||||
GetHandle()->setText( wxQtConvertString( message ) );
|
||||
GetHandle()->setWindowTitle( wxQtConvertString( caption ) );
|
||||
dlg->setText( wxQtConvertString( message ) );
|
||||
dlg->setWindowTitle( wxQtConvertString( caption ) );
|
||||
|
||||
// Apply the style
|
||||
SetWindowStyleFlag( style );
|
||||
|
||||
// Buttons
|
||||
if ( style & wxOK )
|
||||
GetHandle()->addButton( QMessageBox::Ok );
|
||||
dlg->addButton( QMessageBox::Ok );
|
||||
if ( style & wxCANCEL )
|
||||
GetHandle()->addButton( QMessageBox::Cancel );
|
||||
dlg->addButton( QMessageBox::Cancel );
|
||||
if ( style & wxYES_NO )
|
||||
{
|
||||
GetHandle()->addButton( QMessageBox::Yes );
|
||||
GetHandle()->addButton( QMessageBox::No );
|
||||
dlg->addButton( QMessageBox::Yes );
|
||||
dlg->addButton( QMessageBox::No );
|
||||
}
|
||||
|
||||
// Default button
|
||||
if ( style & wxNO_DEFAULT )
|
||||
GetHandle()->setDefaultButton( QMessageBox::No );
|
||||
dlg->setDefaultButton( QMessageBox::No );
|
||||
else if ( style & wxCANCEL_DEFAULT )
|
||||
GetHandle()->setDefaultButton( QMessageBox::Cancel );
|
||||
dlg->setDefaultButton( QMessageBox::Cancel );
|
||||
else
|
||||
{
|
||||
// Default to OK or Yes
|
||||
if ( style & wxOK )
|
||||
GetHandle()->setDefaultButton( QMessageBox::Ok );
|
||||
dlg->setDefaultButton( QMessageBox::Ok );
|
||||
else
|
||||
GetHandle()->setDefaultButton( QMessageBox::Yes );
|
||||
dlg->setDefaultButton( QMessageBox::Yes );
|
||||
}
|
||||
|
||||
// Icon
|
||||
|
|
@ -67,31 +68,31 @@ wxMessageDialog::wxMessageDialog( wxWindow *parent, const wxString& message,
|
|||
if ( style & wxICON_NONE )
|
||||
{
|
||||
numIcons++;
|
||||
GetHandle()->setIcon( QMessageBox::NoIcon );
|
||||
dlg->setIcon( QMessageBox::NoIcon );
|
||||
}
|
||||
|
||||
if ( style & wxICON_EXCLAMATION )
|
||||
{
|
||||
numIcons++;
|
||||
GetHandle()->setIcon( QMessageBox::Warning );
|
||||
dlg->setIcon( QMessageBox::Warning );
|
||||
}
|
||||
|
||||
if ( style & wxICON_ERROR || style & wxICON_HAND )
|
||||
{
|
||||
numIcons++;
|
||||
GetHandle()->setIcon( QMessageBox::Critical );
|
||||
dlg->setIcon( QMessageBox::Critical );
|
||||
}
|
||||
|
||||
if ( style & wxICON_QUESTION )
|
||||
{
|
||||
numIcons++;
|
||||
GetHandle()->setIcon( QMessageBox::Question );
|
||||
dlg->setIcon( QMessageBox::Question );
|
||||
}
|
||||
|
||||
if ( style & wxICON_INFORMATION )
|
||||
{
|
||||
numIcons++;
|
||||
GetHandle()->setIcon( QMessageBox::Information );
|
||||
dlg->setIcon( QMessageBox::Information );
|
||||
}
|
||||
|
||||
wxCHECK_RET( numIcons <= 1, "Multiple icon definitions" );
|
||||
|
|
@ -99,23 +100,23 @@ wxMessageDialog::wxMessageDialog( wxWindow *parent, const wxString& message,
|
|||
{
|
||||
// Use default
|
||||
if ( style & wxYES_NO )
|
||||
GetHandle()->setIcon( QMessageBox::Question );
|
||||
dlg->setIcon( QMessageBox::Question );
|
||||
else
|
||||
GetHandle()->setIcon( QMessageBox::Information );
|
||||
dlg->setIcon( QMessageBox::Information );
|
||||
}
|
||||
|
||||
if ( style & wxSTAY_ON_TOP )
|
||||
GetHandle()->setWindowModality( Qt::ApplicationModal );
|
||||
dlg->setWindowModality( Qt::ApplicationModal );
|
||||
|
||||
PostCreation();
|
||||
}
|
||||
|
||||
int wxMessageDialog::ShowModal()
|
||||
{
|
||||
wxCHECK_MSG( GetHandle(), -1, "Invalid dialog" );
|
||||
wxCHECK_MSG( m_qtWindow, -1, "Invalid dialog" );
|
||||
|
||||
// Exec may return a wx identifier if a close event is generated
|
||||
int ret = GetHandle()->exec();
|
||||
int ret = static_cast<QDialog*>(m_qtWindow)->exec();
|
||||
switch ( ret )
|
||||
{
|
||||
case QMessageBox::Ok:
|
||||
|
|
@ -132,11 +133,6 @@ int wxMessageDialog::ShowModal()
|
|||
}
|
||||
}
|
||||
|
||||
QMessageBox *wxMessageDialog::GetHandle() const
|
||||
{
|
||||
return static_cast<QMessageBox*>(m_qtWindow);
|
||||
}
|
||||
|
||||
wxMessageDialog::~wxMessageDialog()
|
||||
{
|
||||
}
|
||||
|
|
|
|||
69
src/qt/nonownedwnd.cpp
Normal file
69
src/qt/nonownedwnd.cpp
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/qt/nonownedwnd.h
|
||||
// Author: Sean D'Epagnier
|
||||
// Copyright: (c) 2016 wxWidgets dev team
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// for compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/region.h"
|
||||
#include "wx/region.h"
|
||||
#endif // WX_PRECOMP
|
||||
|
||||
#include "wx/nonownedwnd.h"
|
||||
#include "wx/qt/private/converter.h"
|
||||
#include "wx/qt/private/utils.h"
|
||||
|
||||
#include <QtGui/QBitmap>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtWidgets/QWidget>
|
||||
|
||||
// ============================================================================
|
||||
// wxNonOwnedWindow implementation
|
||||
// ============================================================================
|
||||
|
||||
wxNonOwnedWindow::wxNonOwnedWindow()
|
||||
{
|
||||
}
|
||||
|
||||
bool wxNonOwnedWindow::DoClearShape()
|
||||
{
|
||||
GetHandle()->setMask(QBitmap());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool wxNonOwnedWindow::DoSetRegionShape(const wxRegion& region)
|
||||
{
|
||||
QPixmap pixmap(GetHandle()->size());
|
||||
QPainter painter(&pixmap);
|
||||
painter.fillRect(pixmap.rect(), Qt::white);
|
||||
painter.setClipRegion(region.GetHandle());
|
||||
painter.fillRect(pixmap.rect(), Qt::black);
|
||||
GetHandle()->setMask(pixmap.createMaskFromColor(Qt::white));
|
||||
return true;
|
||||
}
|
||||
|
||||
#if wxUSE_GRAPHICS_CONTEXT
|
||||
bool wxNonOwnedWindow::DoSetPathShape(const wxGraphicsPath& path)
|
||||
{
|
||||
wxMISSING_IMPLEMENTATION( __FUNCTION__ );
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -13,6 +13,8 @@
|
|||
#include "wx/qt/private/converter.h"
|
||||
#include "wx/qt/private/winevent.h"
|
||||
|
||||
#include <QtWidgets/QTabWidget>
|
||||
|
||||
class wxQtTabWidget : public wxQtEventSignalHandler< QTabWidget, wxNotebook >
|
||||
{
|
||||
public:
|
||||
|
|
@ -199,7 +201,7 @@ wxWindow *wxNotebook::DoRemovePage(size_t page)
|
|||
return QtRetrieveWindowPointer( qtWidget );
|
||||
}
|
||||
|
||||
QTabWidget *wxNotebook::GetHandle() const
|
||||
QWidget *wxNotebook::GetHandle() const
|
||||
{
|
||||
return m_qtTabWidget;
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue