#include <QtWebKitWidgets>
#include <QMessageBox>
#include <QUrl>
#include <QMainWindow>
#include <QTabWidget>
QWebView *m_mainWebView;
{
public:
{
QUrl name
("www.google.com");
m_mainGridLayout->setContentsMargins(0, 0, 0, 0);
m_MainTab
= new QWidget(m_tabWidget
);
m_tabGridLayout->setContentsMargins(0, 0, 0, 0);
m_mainWebView = new QWebView(m_MainTab);
m_tabGridLayout->addWidget(m_mainWebView, 0, 0, 1, 1);
m_tabWidget
->addTab
(m_MainTab,
QString());
m_tabWidget->setCurrentIndex(0);
m_tabWidget->setTabText(0, "My Customized Tab");
m_tabWidget->setStyleSheet("QTabBar::tab{max-height:100px;max-width:300px;}");
setCentralWidget(m_tabWidget);
m_mainWebView->setUrl(name);
};
~myMainWindow(){};
};
int main(int argc, char **argv)
{
myMainWindow *window = new myMainWindow();
window->resize(400, 400);
window->setWindowTitle("QTabWidget - Style Testing");
window->show();
return app.exec();
}
#include <QtWebKitWidgets>
#include <QMessageBox>
#include <QUrl>
#include <QMainWindow>
#include <QTabWidget>
QWebView *m_mainWebView;
QGridLayout *m_tabGridLayout;
QGridLayout *m_mainGridLayout;
QTabWidget *m_tabWidget;
QWidget *m_MainTab;
class myMainWindow:public QMainWindow
{
public:
myMainWindow():QMainWindow()
{
QUrl name("www.google.com");
m_tabWidget = new QTabWidget(this);
m_mainGridLayout = new QGridLayout(m_tabWidget);
m_mainGridLayout->setContentsMargins(0, 0, 0, 0);
m_MainTab = new QWidget(m_tabWidget);
m_tabGridLayout = new QGridLayout(m_MainTab);
m_tabGridLayout->setContentsMargins(0, 0, 0, 0);
m_mainWebView = new QWebView(m_MainTab);
m_tabGridLayout->addWidget(m_mainWebView, 0, 0, 1, 1);
m_tabWidget->addTab(m_MainTab, QString());
m_tabWidget->setCurrentIndex(0);
m_tabWidget->setTabText(0, "My Customized Tab");
m_tabWidget->setStyleSheet("QTabBar::tab{max-height:100px;max-width:300px;}");
setCentralWidget(m_tabWidget);
m_mainWebView->setUrl(name);
};
~myMainWindow(){};
};
int main(int argc, char **argv)
{
QApplication app(argc, argv);
myMainWindow *window = new myMainWindow();
window->resize(400, 400);
window->setWindowTitle("QTabWidget - Style Testing");
window->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks