Merge branch 'wxqt-2' of https://github.com/dsa-t/wxWidgets
More miscellaneous wxQt fixes. See #24309.
This commit is contained in:
commit
4a5de60fa9
9 changed files with 50 additions and 4 deletions
|
|
@ -79,6 +79,9 @@ public:
|
||||||
virtual void SetSelection(int n) override;
|
virtual void SetSelection(int n) override;
|
||||||
virtual int GetSelection() const override;
|
virtual int GetSelection() const override;
|
||||||
|
|
||||||
|
virtual void SetLabel(const wxString &label) override;
|
||||||
|
virtual wxString GetLabel() const override;
|
||||||
|
|
||||||
virtual QWidget *GetHandle() const override;
|
virtual QWidget *GetHandle() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,9 @@ public:
|
||||||
virtual void SetValue(bool value) override;
|
virtual void SetValue(bool value) override;
|
||||||
virtual bool GetValue() const override;
|
virtual bool GetValue() const override;
|
||||||
|
|
||||||
|
virtual void SetLabel(const wxString &label) override;
|
||||||
|
virtual wxString GetLabel() const override;
|
||||||
|
|
||||||
virtual QWidget *GetHandle() const override;
|
virtual QWidget *GetHandle() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,8 @@ void wxAnyButton::QtSetBitmap( const wxBitmapBundle &bitmapBundle )
|
||||||
|
|
||||||
void wxAnyButton::SetLabel( const wxString &label )
|
void wxAnyButton::SetLabel( const wxString &label )
|
||||||
{
|
{
|
||||||
|
wxAnyButtonBase::SetLabel( label );
|
||||||
|
|
||||||
m_qtPushButton->setText( wxQtConvertString( label ));
|
m_qtPushButton->setText( wxQtConvertString( label ));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -139,6 +139,8 @@ wxString wxCheckBox::GetLabel() const
|
||||||
|
|
||||||
void wxCheckBox::SetLabel(const wxString& label)
|
void wxCheckBox::SetLabel(const wxString& label)
|
||||||
{
|
{
|
||||||
|
wxCheckBoxBase::SetLabel( label );
|
||||||
|
|
||||||
m_qtCheckBox->setText( wxQtConvertString(label) );
|
m_qtCheckBox->setText( wxQtConvertString(label) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,11 @@ void wxCursor::InitFromStock( wxStockCursor cursorId )
|
||||||
void wxCursor::InitFromImage( const wxImage & image )
|
void wxCursor::InitFromImage( const wxImage & image )
|
||||||
{
|
{
|
||||||
AllocExclusive();
|
AllocExclusive();
|
||||||
GetHandle() = QCursor(*wxBitmap(image).GetHandle(),
|
|
||||||
|
wxBitmap bmp(image);
|
||||||
|
bmp.QtBlendMaskWithAlpha();
|
||||||
|
|
||||||
|
GetHandle() = QCursor(*bmp.GetHandle(),
|
||||||
image.HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_X) ?
|
image.HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_X) ?
|
||||||
image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X) : -1,
|
image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_X) : -1,
|
||||||
image.HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y) ?
|
image.HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_Y) ?
|
||||||
|
|
|
||||||
|
|
@ -365,3 +365,14 @@ QWidget *wxRadioBox::GetHandle() const
|
||||||
return m_qtGroupBox;
|
return m_qtGroupBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxRadioBox::SetLabel(const wxString& label)
|
||||||
|
{
|
||||||
|
wxControlBase::SetLabel( label );
|
||||||
|
|
||||||
|
m_qtGroupBox->setTitle( wxQtConvertString( label ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
wxString wxRadioBox::GetLabel() const
|
||||||
|
{
|
||||||
|
return wxQtConvertString( m_qtGroupBox->title() );
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -164,3 +164,15 @@ QWidget *wxRadioButton::GetHandle() const
|
||||||
{
|
{
|
||||||
return m_qtRadioButton;
|
return m_qtRadioButton;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxString wxRadioButton::GetLabel() const
|
||||||
|
{
|
||||||
|
return wxQtConvertString( m_qtRadioButton->text() );
|
||||||
|
}
|
||||||
|
|
||||||
|
void wxRadioButton::SetLabel(const wxString& label)
|
||||||
|
{
|
||||||
|
wxRadioButtonBase::SetLabel(label);
|
||||||
|
|
||||||
|
m_qtRadioButton->setText( wxQtConvertString(label) );
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,12 +58,14 @@ QWidget *wxStaticBox::GetHandle() const
|
||||||
|
|
||||||
void wxStaticBox::SetLabel(const wxString& label)
|
void wxStaticBox::SetLabel(const wxString& label)
|
||||||
{
|
{
|
||||||
m_qtGroupBox->setTitle(wxQtConvertString(label));
|
wxStaticBoxBase::SetLabel( label );
|
||||||
|
|
||||||
|
m_qtGroupBox->setTitle( wxQtConvertString( label ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString wxStaticBox::GetLabel() const
|
wxString wxStaticBox::GetLabel() const
|
||||||
{
|
{
|
||||||
return wxQtConvertString(m_qtGroupBox->title());
|
return wxQtConvertString( m_qtGroupBox->title() );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const
|
void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const
|
||||||
|
|
|
||||||
|
|
@ -1176,7 +1176,14 @@ void wxWindowQt::DoSetToolTip( wxToolTip *tip )
|
||||||
bool wxWindowQt::DoPopupMenu(wxMenu *menu, int x, int y)
|
bool wxWindowQt::DoPopupMenu(wxMenu *menu, int x, int y)
|
||||||
{
|
{
|
||||||
menu->UpdateUI();
|
menu->UpdateUI();
|
||||||
menu->GetHandle()->exec( GetHandle()->mapToGlobal( QPoint( x, y ) ) );
|
|
||||||
|
QPoint pt;
|
||||||
|
if (x == wxDefaultCoord && y == wxDefaultCoord)
|
||||||
|
pt = QCursor::pos();
|
||||||
|
else
|
||||||
|
pt = GetHandle()->mapToGlobal(QPoint(x, y));
|
||||||
|
|
||||||
|
menu->GetHandle()->exec(pt);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue