本文整理汇总了C++中QTabWidget::setObjectName方法的典型用法代码示例。如果您正苦于以下问题:C++ QTabWidget::setObjectName方法的具体用法?C++ QTabWidget::setObjectName怎么用?C++ QTabWidget::setObjectName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTabWidget
的用法示例。
在下文中一共展示了QTabWidget::setObjectName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: create_model_tab
void model_import_dlg::create_model_tab(QString title, render::lod lod)
{
QWidget * tab = new QWidget(ui.tabModels);
QTabWidget * tabHost = new QTabWidget(tab);
tabHost->setGeometry(-1, 10, 590, 620);
tabHost->setObjectName("meshTabHost");
QObject::connect(tabHost, SIGNAL(tabBarClicked(int)), this, SLOT(on_mesh_tab_changed(int)));
for (size_t i = 0; i < conv.count(); i++)
{
model_import_dlg::create_mesh_tab(tabHost, i, lod);
}
ui.tabModels->addTab(tab, "Model " + title);
}
示例2: init
//.........这里部分代码省略.........
// Enable antialiasing if requested in the config file.
// TODO: Make this settable via the GUI
QGLFormat glformat = QGLFormat::defaultFormat();
if (m_appCore->getConfig()->aaSamples > 1)
{
glformat.setSampleBuffers(true);
glformat.setSamples(m_appCore->getConfig()->aaSamples);
QGLFormat::setDefaultFormat(glformat);
}
glWidget = new CelestiaGlWidget(NULL, "Celestia", m_appCore);
glWidget->makeCurrent();
GLenum glewErr = glewInit();
if (glewErr != GLEW_OK)
{
QMessageBox::critical(0, "Celestia",
QString(_("Celestia was unable to initialize OpenGL extensions (error %1). Graphics quality will be reduced.")).arg(glewErr));
}
m_appCore->setCursorHandler(glWidget);
m_appCore->setContextMenuCallback(ContextMenu);
MainWindowInstance = this; // TODO: Fix context menu callback
setCentralWidget(glWidget);
setWindowTitle("Celestia");
actions = new CelestiaActions(this, m_appCore);
createMenus();
QTabWidget* tabWidget = new QTabWidget(this);
tabWidget->setObjectName("celestia-tabbed-browser");
toolsDock = new QDockWidget(_("Celestial Browser"), this);
toolsDock->setObjectName("celestia-tools-dock");
toolsDock->setAllowedAreas(Qt::LeftDockWidgetArea |
Qt::RightDockWidgetArea);
// Create the various browser widgets
celestialBrowser = new CelestialBrowser(m_appCore, NULL);
celestialBrowser->setObjectName("celestia-browser");
connect(celestialBrowser,
SIGNAL(selectionContextMenuRequested(const QPoint&, Selection&)),
this,
SLOT(slotShowSelectionContextMenu(const QPoint&, Selection&)));
QWidget* deepSkyBrowser = new DeepSkyBrowser(m_appCore, NULL);
deepSkyBrowser->setObjectName("deepsky-browser");
connect(deepSkyBrowser,
SIGNAL(selectionContextMenuRequested(const QPoint&, Selection&)),
this,
SLOT(slotShowSelectionContextMenu(const QPoint&, Selection&)));
SolarSystemBrowser* solarSystemBrowser = new SolarSystemBrowser(m_appCore, NULL);
solarSystemBrowser->setObjectName("ssys-browser");
connect(solarSystemBrowser,
SIGNAL(selectionContextMenuRequested(const QPoint&, Selection&)),
this,
SLOT(slotShowSelectionContextMenu(const QPoint&, Selection&)));
// Set up the browser tabs
tabWidget->addTab(solarSystemBrowser, _("Solar System"));
tabWidget->addTab(celestialBrowser, _("Stars"));
tabWidget->addTab(deepSkyBrowser, _("Deep Sky Objects"));
示例3: createWidget
QWidget* WidgetStyle::createWidget(const QString& name)
{
if(name == "CheckBox")
{
QCheckBox* box = new QCheckBox("CheckBox");
box->setObjectName("CheckBox");
return setLayoutWidget({ box }, { 100, 30 });
}
else if(name == "ComboBox")
{
QComboBox* box = new QComboBox;
box->addItem("Item1");
box->addItem("Item3");
box->addItem("Item3");
box->setObjectName("ComboBox");
return setLayoutWidget({ box }, { 70, 30 });
}
else if(name == "DateEdit")
{
QDateEdit* date = new QDateEdit;
date->setObjectName("DateEdit");
return setLayoutWidget({ date }, { 110, 40 });
}
else if(name == "DateTimeEdit")
{
QDateTimeEdit* date = new QDateTimeEdit;
date->setObjectName("DateTimeEdit");
return setLayoutWidget({ date }, { 160, 30 });
}
else if(name == "Dialog")
{
QDialog* dialog = new QDialog;
dialog->setObjectName("Dialog");
return setLayoutWidget({ dialog }, { 160, 110 });
}
else if(name == "DockWidget") //?
{
QDockWidget* widget = new QDockWidget;
widget->setObjectName("DockWidget");
widget->resize(61, 22);
return widget;
}
else if(name == "DoubleSpinBox")
{
QDoubleSpinBox* box = new QDoubleSpinBox;
box->setObjectName("DoubleSpinBox");
return setLayoutWidget({ box }, { 90, 40 });
}
else if(name == "Frame") //??
{
QFrame* frame = new QFrame;
frame->setObjectName("Frame");
frame->resize(150, 100);
return frame;
}
else if(name == "GroupBox")
{
QGroupBox* box = new QGroupBox("GroupBox");
box->setObjectName("GroupBox");
return setLayoutWidget({ box }, { 160, 110 });
}
else if(name == "Label")
{
QLabel* label = new QLabel("Label");
label->setObjectName("Label");
return setLayoutWidget({ label }, { 40, 20});
}
else if(name == "LineEdit")
{
QLineEdit* line = new QLineEdit;
line->setObjectName("LineEdit");
return setLayoutWidget({ line }, { 30, 30 });
}
else if(name == "ListView") //??
{
QListView* view = new QListView;
view->setObjectName("ListView");
view->resize(71, 71);
return view;
}
else if(name == "ListWidget")
{
QListWidget* list = new QListWidget;
list->setObjectName("ListWidget");
for(int i = 0; i < 20; i++)
list->addItem(QString("Item %1").arg(i));
return setLayoutWidget({ list }, { 80, 80 });
}
else if(name == "MainWindow")
{
QMainWindow* window = new QMainWindow;
window->setObjectName("MainWindow");
return setLayoutWidget({ window }, { 160, 110 });
}
else if(name == "Menu")
{
QMenu* parentMenu = new QMenu;
parentMenu->setObjectName("Menu");
parentMenu->addMenu("Menu1");
QMenu* menu1 = parentMenu->addMenu("Menu2");
//.........这里部分代码省略.........
示例4: setupUi
//.........这里部分代码省略.........
streetHLayout->addWidget(streetLineEdit);
streetHLayout->addWidget(numberLabel);
streetHLayout->addWidget(numberLineEdit);
streetHLayout->setContentsMargins(0, 0, 0, 0);
streetHLayout->setStretch(0, 5);
streetHLayout->setStretch(2, 1);
// zip and city in one cell like above
cityHLayout->addWidget(zipLineEdit);
cityHLayout->addWidget(cityLabel);
cityHLayout->addWidget(cityLineEdit);
cityHLayout->setContentsMargins(0, 0, 0, 0);
// title and titleext like above
titleHLayout->addWidget(comboBox);
titleHLayout->addWidget(titleExtLabel);
titleHLayout->addWidget(titleExtLineEdit);
titleHLayout->setContentsMargins(0, 0, 0, 0);
// zip codes have only 5 digits, also define appropriate size
zipLineEdit->setMaxLength(5);
zipLineEdit->setMaximumSize(QSize(80, 16777215));
// initial siye of dialog. TODO: Save in conf on quit. Restore here.
MemberEditDialog->resize(1200, 700);
updateGeometry();
retranslateUi(MemberEditDialog);
QMetaObject::connectSlotsByName(MemberEditDialog);
if (MemberEditDialog->objectName().isEmpty())
MemberEditDialog->setObjectName(QStringLiteral("MemberEditDialog"));
mainWidget->setObjectName(QStringLiteral("mainWidget"));
horizontalLayout->setObjectName(QStringLiteral("horizontalLayout"));
tabWidget->setObjectName(QStringLiteral("tabWidget"));
generalTab->setObjectName(QStringLiteral("generalTab"));
generalHLayout->setObjectName(QStringLiteral("generalHLayout"));
formWidget->setObjectName(QStringLiteral("formWidget"));
formTab1LeftLayout->setObjectName(QStringLiteral("formTab1LeftLayout"));
titleLabel->setObjectName(QStringLiteral("titleLabel"));
firstNameLabel->setObjectName(QStringLiteral("firstNameLabel"));
firstNameLineEdit->setObjectName(QStringLiteral("firstNameLineEdit"));
lastNameLabel->setObjectName(QStringLiteral("lastNameLabel"));
lastNameLineEdit->setObjectName(QStringLiteral("lastNameLineEdit"));
streetLabel->setObjectName(QStringLiteral("streetLabel"));
zipLabel->setObjectName(QStringLiteral("zipLabel"));
streetHorizontalWidget->setObjectName(QStringLiteral("streetHorizontalWidget"));
streetHLayout->setObjectName(QStringLiteral("streetHLayout"));
streetLineEdit->setObjectName(QStringLiteral("streetLineEdit"));
numberLabel->setObjectName(QStringLiteral("numberLabel"));
numberLineEdit->setObjectName(QStringLiteral("numberLineEdit"));
cityHorizontalWidget->setObjectName(QStringLiteral("cityHorizontalWidget"));
cityHLayout->setObjectName(QStringLiteral("cityHLayout"));
zipLineEdit->setObjectName(QStringLiteral("zipLineEdit"));
cityLabel->setObjectName(QStringLiteral("cityLabel"));
cityLineEdit->setObjectName(QStringLiteral("cityLineEdit"));
titleHorizontalWidget->setObjectName(QStringLiteral("titleHorizontalWidget"));
titleHLayout->setObjectName(QStringLiteral("titleHLayout"));
comboBox->setObjectName(QStringLiteral("comboBox"));
titleExtLabel->setObjectName(QStringLiteral("titleExtLabel"));
titleExtLineEdit->setObjectName(QStringLiteral("titleExtLineEdit"));
formTab1Right->setObjectName(QStringLiteral("formTab1Right"));
formTab1RightLayout->setObjectName(QStringLiteral("formTab1RightLayout"));
示例5: ui_companion_qt_init
static void* ui_companion_qt_init(void)
{
ui_companion_qt_t *handle = (ui_companion_qt_t*)calloc(1, sizeof(*handle));
MainWindow *mainwindow = NULL;
QHBoxLayout *browserButtonsHBoxLayout = NULL;
QVBoxLayout *layout = NULL;
QVBoxLayout *launchWithWidgetLayout = NULL;
QHBoxLayout *coreComboBoxLayout = NULL;
QMenuBar *menu = NULL;
QDesktopWidget *desktop = NULL;
QMenu *fileMenu = NULL;
QMenu *editMenu = NULL;
QMenu *viewMenu = NULL;
QMenu *viewClosedDocksMenu = NULL;
QRect desktopRect;
QDockWidget *thumbnailDock = NULL;
QDockWidget *thumbnail2Dock = NULL;
QDockWidget *thumbnail3Dock = NULL;
QDockWidget *browserAndPlaylistTabDock = NULL;
QDockWidget *coreSelectionDock = NULL;
QTabWidget *browserAndPlaylistTabWidget = NULL;
QWidget *widget = NULL;
QWidget *browserWidget = NULL;
QWidget *playlistWidget = NULL;
QWidget *coreSelectionWidget = NULL;
QWidget *launchWithWidget = NULL;
ThumbnailWidget *thumbnailWidget = NULL;
ThumbnailWidget *thumbnail2Widget = NULL;
ThumbnailWidget *thumbnail3Widget = NULL;
QPushButton *browserDownloadsButton = NULL;
QPushButton *browserUpButton = NULL;
QPushButton *browserStartButton = NULL;
ThumbnailLabel *thumbnail = NULL;
ThumbnailLabel *thumbnail2 = NULL;
ThumbnailLabel *thumbnail3 = NULL;
QAction *editSearchAction = NULL;
QAction *loadCoreAction = NULL;
QAction *unloadCoreAction = NULL;
QAction *exitAction = NULL;
QComboBox *launchWithComboBox = NULL;
QSettings *qsettings = NULL;
if (!handle)
return NULL;
handle->app = static_cast<ui_application_qt_t*>(ui_application_qt.initialize());
handle->window = static_cast<ui_window_qt_t*>(ui_window_qt.init());
desktop = qApp->desktop();
desktopRect = desktop->availableGeometry();
mainwindow = handle->window->qtWindow;
qsettings = mainwindow->settings();
mainwindow->resize(qMin(desktopRect.width(), INITIAL_WIDTH), qMin(desktopRect.height(), INITIAL_HEIGHT));
mainwindow->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, mainwindow->size(), desktopRect));
mainwindow->setWindowTitle("RetroArch");
mainwindow->setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks | QMainWindow::AllowTabbedDocks | GROUPED_DRAGGING);
widget = new QWidget(mainwindow);
widget->setObjectName("tableWidget");
layout = new QVBoxLayout();
layout->addWidget(mainwindow->contentTableWidget());
widget->setLayout(layout);
mainwindow->setCentralWidget(widget);
menu = mainwindow->menuBar();
fileMenu = menu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE));
loadCoreAction = fileMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_LOAD_CORE), mainwindow, SLOT(onLoadCoreClicked()));
loadCoreAction->setShortcut(QKeySequence("Ctrl+L"));
unloadCoreAction = fileMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_UNLOAD_CORE), mainwindow, SLOT(onUnloadCoreMenuAction()));
unloadCoreAction->setObjectName("unloadCoreAction");
unloadCoreAction->setEnabled(false);
unloadCoreAction->setShortcut(QKeySequence("Ctrl+U"));
exitAction = fileMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_EXIT), mainwindow, SLOT(close()));
exitAction->setShortcut(QKeySequence::Quit);
editMenu = menu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_EDIT));
editSearchAction = editMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_EDIT_SEARCH), mainwindow->searchLineEdit(), SLOT(setFocus()));
editSearchAction->setShortcut(QKeySequence::Find);
viewMenu = menu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW));
viewClosedDocksMenu = viewMenu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_CLOSED_DOCKS));
viewClosedDocksMenu->setObjectName("viewClosedDocksMenu");
QObject::connect(viewClosedDocksMenu, SIGNAL(aboutToShow()), mainwindow, SLOT(onViewClosedDocksAboutToShow()));
viewMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_VIEW_OPTIONS), mainwindow->viewOptionsDialog(), SLOT(showDialog()));
playlistWidget = new QWidget();
playlistWidget->setLayout(new QVBoxLayout());
//.........这里部分代码省略.........
示例6: ui_companion_qt_init
static void* ui_companion_qt_init(void)
{
ui_companion_qt_t *handle = (ui_companion_qt_t*)calloc(1, sizeof(*handle));
MainWindow *mainwindow = NULL;
QHBoxLayout *browserButtonsHBoxLayout = NULL;
QVBoxLayout *layout = NULL;
QVBoxLayout *launchWithWidgetLayout = NULL;
QHBoxLayout *coreComboBoxLayout = NULL;
QMenuBar *menu = NULL;
QDesktopWidget *desktop = NULL;
QMenu *fileMenu = NULL;
QMenu *editMenu = NULL;
QMenu *viewMenu = NULL;
QMenu *viewClosedDocksMenu = NULL;
QMenu *toolsMenu = NULL;
QMenu *updaterMenu = NULL;
QMenu *helpMenu = NULL;
QRect desktopRect;
QDockWidget *thumbnailDock = NULL;
QDockWidget *thumbnail2Dock = NULL;
QDockWidget *thumbnail3Dock = NULL;
QDockWidget *browserAndPlaylistTabDock = NULL;
QDockWidget *coreSelectionDock = NULL;
QTabWidget *browserAndPlaylistTabWidget = NULL;
QWidget *widget = NULL;
QWidget *browserWidget = NULL;
QWidget *playlistWidget = NULL;
QWidget *coreSelectionWidget = NULL;
QWidget *launchWithWidget = NULL;
ThumbnailWidget *thumbnailWidget = NULL;
ThumbnailWidget *thumbnail2Widget = NULL;
ThumbnailWidget *thumbnail3Widget = NULL;
QPushButton *browserDownloadsButton = NULL;
QPushButton *browserUpButton = NULL;
QPushButton *browserStartButton = NULL;
ThumbnailLabel *thumbnail = NULL;
ThumbnailLabel *thumbnail2 = NULL;
ThumbnailLabel *thumbnail3 = NULL;
QAction *editSearchAction = NULL;
QAction *loadCoreAction = NULL;
QAction *unloadCoreAction = NULL;
QAction *exitAction = NULL;
QComboBox *launchWithComboBox = NULL;
QSettings *qsettings = NULL;
QListWidget *listWidget = NULL;
int i = 0;
if (!handle)
return NULL;
handle->app = static_cast<ui_application_qt_t*>(ui_application_qt.initialize());
handle->window = static_cast<ui_window_qt_t*>(ui_window_qt.init());
desktop = qApp->desktop();
desktopRect = desktop->availableGeometry();
mainwindow = handle->window->qtWindow;
qsettings = mainwindow->settings();
mainwindow->resize(qMin(desktopRect.width(), INITIAL_WIDTH), qMin(desktopRect.height(), INITIAL_HEIGHT));
mainwindow->setGeometry(QStyle::alignedRect(Qt::LeftToRight, Qt::AlignCenter, mainwindow->size(), desktopRect));
mainwindow->setWindowTitle("RetroArch");
mainwindow->setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks | QMainWindow::AllowTabbedDocks | GROUPED_DRAGGING);
listWidget = mainwindow->playlistListWidget();
widget = new FileDropWidget(mainwindow);
widget->setObjectName("tableWidget");
widget->setContextMenuPolicy(Qt::CustomContextMenu);
QObject::connect(widget, SIGNAL(filesDropped(QStringList)), mainwindow, SLOT(onPlaylistFilesDropped(QStringList)));
QObject::connect(widget, SIGNAL(deletePressed()), mainwindow, SLOT(deleteCurrentPlaylistItem()));
QObject::connect(widget, SIGNAL(customContextMenuRequested(const QPoint&)), mainwindow, SLOT(onFileDropWidgetContextMenuRequested(const QPoint&)));
layout = new QVBoxLayout();
layout->addWidget(mainwindow->contentTableWidget());
layout->addWidget(mainwindow->contentGridWidget());
widget->setLayout(layout);
mainwindow->setCentralWidget(widget);
menu = mainwindow->menuBar();
fileMenu = menu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE));
loadCoreAction = fileMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_LOAD_CORE), mainwindow, SLOT(onLoadCoreClicked()));
loadCoreAction->setShortcut(QKeySequence("Ctrl+L"));
unloadCoreAction = fileMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_UNLOAD_CORE), mainwindow, SLOT(onUnloadCoreMenuAction()));
unloadCoreAction->setObjectName("unloadCoreAction");
unloadCoreAction->setEnabled(false);
unloadCoreAction->setShortcut(QKeySequence("Ctrl+U"));
exitAction = fileMenu->addAction(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_FILE_EXIT), mainwindow, SLOT(close()));
exitAction->setShortcut(QKeySequence::Quit);
editMenu = menu->addMenu(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_QT_MENU_EDIT));
//.........这里部分代码省略.........