mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added functionality to open different website link and load the
website data to different tab. To achieve this, new customized
QTabWidget and QWebView are added to render the data to WebView
widget. All the widgets (New Tab, WebViewWinodw, and QToolButton)
are added dynamically. QToolButton is used to traverse back and
forward to web document opened in WebViewWindow.
Introduced the New class called WebViewWindow which is derived
from QWebView. Each tab of the QTabWidget contains the instance
of WebViewWindow class. WebViewWindow class is useful to display
the web document.
Introduced New class called TabWindow which is derived from
QTabWidget. This class is useful to achieve following functionality:
- Customize the close button of tabbar so that it can only be
visible other then main pgAdmin 4 window.
- Enable/Disable the toolbutton added left side of tabbar
depending on the web history traversed by the user in WebViewWindow.
- Set the tooltip text of the tabbar depending on the title change
event of WebViewWindow class.
Modified the Qt project file to support the both the version
of python 2 and python 3.
Qt5 is recommended to test pgAdmin4 in dektop mode.
58 lines
1.3 KiB
C++
58 lines
1.3 KiB
C++
//////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
//
|
|
// Copyright (C) 2013 - 2016, The pgAdmin Development Team
|
|
// This software is released under the PostgreSQL Licence
|
|
//
|
|
// TabWindow.h - Declaration of the custom tab widget
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef TABWINDOW_H
|
|
#define TABWINDOW_H
|
|
|
|
#include "pgAdmin4.h"
|
|
#include "WebViewWindow.h"
|
|
|
|
// Define button characters
|
|
const QString PGA_BTN_FORWARD = QString("\u2192");
|
|
const QString PGA_BTN_BACK = QString("\u2190");
|
|
const QString PGA_BTN_CLOSE = QString("\u2715");
|
|
|
|
class TabBar : public QTabBar
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
TabBar(QWidget* parent=0) : QTabBar(parent)
|
|
{
|
|
}
|
|
|
|
protected:
|
|
QSize tabSizeHint(int) const
|
|
{
|
|
return QSize(250, 24);
|
|
}
|
|
};
|
|
|
|
class TabWindow : public QTabWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
TabWindow(QWidget *parent = 0);
|
|
|
|
int getButtonIndex(QPushButton *btn);
|
|
void showHideToolButton(const int &index,const int &option);
|
|
void enableDisableToolButton(const int &index);
|
|
void setTabToolTipText(const int &index, const QString &toolTipString);
|
|
QTabBar *tabBar() const
|
|
{
|
|
return QTabWidget::tabBar();
|
|
}
|
|
|
|
private:
|
|
TabBar *m_testTabBar;
|
|
};
|
|
|
|
#endif // TABWINDOW_H
|