Merge branch 'qt_toolbar_area' of https://github.com/GeoTeric/wxWidgets

Use only a single position style for QToolBar and minor cleanup in the
related code.

Closes https://github.com/wxWidgets/wxWidgets/pull/1145
This commit is contained in:
Vadim Zeitlin
2019-01-19 23:04:23 +01:00
3 changed files with 6 additions and 7 deletions

View File

@@ -5,13 +5,12 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
class QToolBar;
#ifndef _WX_QT_TOOLBAR_H_ #ifndef _WX_QT_TOOLBAR_H_
#define _WX_QT_TOOLBAR_H_ #define _WX_QT_TOOLBAR_H_
class QActionGroup; class QActionGroup;
class wxQtToolBar; class QToolBar;
class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase class WXDLLIMPEXP_CORE wxToolBar : public wxToolBarBase
{ {

View File

@@ -120,10 +120,10 @@ void wxFrame::SetToolBar(wxToolBar *toolbar)
int area = 0; int area = 0;
if ( toolbar != NULL ) if ( toolbar != NULL )
{ {
if (toolbar->HasFlag(wxTB_LEFT)) area |= Qt::LeftToolBarArea; if (toolbar->HasFlag(wxTB_LEFT)) { area |= Qt::LeftToolBarArea; }
if (toolbar->HasFlag(wxTB_RIGHT)) area |= Qt::RightToolBarArea; else if (toolbar->HasFlag(wxTB_RIGHT)) { area |= Qt::RightToolBarArea; }
if (toolbar->HasFlag(wxTB_TOP)) area |= Qt::TopToolBarArea; else if (toolbar->HasFlag(wxTB_TOP)) { area |= Qt::TopToolBarArea; }
if (toolbar->HasFlag(wxTB_BOTTOM)) area |= Qt::BottomToolBarArea; else if (toolbar->HasFlag(wxTB_BOTTOM)){ area |= Qt::BottomToolBarArea;}
GetQMainWindow()->addToolBar((Qt::ToolBarArea)area, toolbar->GetQToolBar()); GetQMainWindow()->addToolBar((Qt::ToolBarArea)area, toolbar->GetQToolBar());
} }

View File

@@ -16,6 +16,7 @@
#include <QtWidgets/QActionGroup> #include <QtWidgets/QActionGroup>
#include <QtWidgets/QToolButton> #include <QtWidgets/QToolButton>
#include <QtWidgets/QToolBar>
#ifndef WX_PRECOMP #ifndef WX_PRECOMP
#include "wx/menu.h" #include "wx/menu.h"
@@ -25,7 +26,6 @@
#include "wx/qt/private/winevent.h" #include "wx/qt/private/winevent.h"
#include "wx/qt/private/converter.h" #include "wx/qt/private/converter.h"
#include <QtWidgets/QToolBar>
class wxQtToolButton; class wxQtToolButton;
class wxToolBarTool : public wxToolBarToolBase class wxToolBarTool : public wxToolBarToolBase