本文整理汇总了C++中QTabWidget::setTabIcon方法的典型用法代码示例。如果您正苦于以下问题:C++ QTabWidget::setTabIcon方法的具体用法?C++ QTabWidget::setTabIcon怎么用?C++ QTabWidget::setTabIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTabWidget
的用法示例。
在下文中一共展示了QTabWidget::setTabIcon方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
// Constructor.
qtractorConnections::qtractorConnections (
QWidget *pParent, Qt::WindowFlags wflags )
: QWidget(pParent, wflags)
{
// Surely a name is crucial (e.g.for storing geometry settings)
QWidget::setObjectName("qtractorConnections");
// Create main inner widget.
m_pConnectForm = new qtractorConnectForm(this);
// Set proper tab widget icons...
QTabWidget *pTabWidget = m_pConnectForm->connectTabWidget();
pTabWidget->setTabIcon(0, QIcon(":/images/trackAudio.png"));
pTabWidget->setTabIcon(1, QIcon(":/images/trackMidi.png"));
// Prepare the layout stuff.
QHBoxLayout *pLayout = new QHBoxLayout();
pLayout->setMargin(0);
pLayout->setSpacing(0);
pLayout->addWidget(m_pConnectForm);
QWidget::setLayout(pLayout);
// Some specialties to this kind of dock window...
QWidget::setMinimumWidth(480);
QWidget::setMinimumHeight(240);
// Finally set the default caption and tooltip.
const QString& sCaption = tr("Connections") + " - " QTRACTOR_TITLE;
QWidget::setWindowTitle(sCaption);
QWidget::setWindowIcon(QIcon(":/images/viewConnections.png"));
QWidget::setToolTip(sCaption);
// Get previously saved splitter sizes,
// (with fair default...)
qtractorOptions *pOptions = qtractorOptions::getInstance();
if (pOptions) {
QList<int> sizes;
sizes.append(180);
sizes.append(60);
sizes.append(180);
pOptions->loadSplitterSizes(
m_pConnectForm->audioConnectSplitter(), sizes);
pOptions->loadSplitterSizes(
m_pConnectForm->midiConnectSplitter(), sizes);
}
}
示例2: updateIcon
void Tab::updateIcon(void) {
QTabWidget* widget = qobject_cast<QTabWidget*>(parentWidget()->parentWidget());
if(widget) {
QIcon icon = _webView->icon();
if(icon.isNull()) {
icon = QIcon(":/defaultPageIcon.png");
}
widget->setTabIcon(widget->indexOf(this), icon);
}
}
示例3: initTabIcons
void ConfigurationManager::initTabIcons()
{
QTabWidget *tw = ui->tabWidget;
if ( !tw->tabIcon(0).isNull() )
return;
tw->setTabIcon( tw->indexOf(ui->tabGeneral), getIcon("", IconWrench) );
tw->setTabIcon( tw->indexOf(ui->tabLayout), getIcon("", IconColumns) );
tw->setTabIcon( tw->indexOf(ui->tabHistory), getIcon("", IconListAlt) );
tw->setTabIcon( tw->indexOf(ui->tabItems), getIcon("", IconThList) );
tw->setTabIcon( tw->indexOf(ui->tabTray), getIcon("", IconInbox) );
tw->setTabIcon( tw->indexOf(ui->tabNotifications), getIcon("", IconInfoCircle) );
tw->setTabIcon( tw->indexOf(ui->tabShortcuts), getIcon("", IconKeyboard) );
tw->setTabIcon( tw->indexOf(ui->tabAppearance), getIcon("", IconImage) );
}
示例4: setTabIcon
int TabWidget::setTabIcon( lua_State * L ) //( int index, const QIcon & icon )void
{
QTabWidget* obj = ObjectHelper<QTabWidget>::check( L, 1 );
int index = 0;
if ( Util::isNum( L, 2 ) )
{
if ( Util::toInt( L, 2 )>=0 )
{
index = Util::toInt( L, 2 );
}
else
{
Util::error( L, "Invalid Index" );
}
}
QIcon* icon = ValueInstaller2<QIcon>::check( L, 4 );
obj->setTabIcon( index, *icon );
return 0;
}
示例5: settings
//.........这里部分代码省略.........
m_options["always_on_top"] = Option(false, "checked", ui->checkBoxAlwaysOnTop);
m_options["tab_position"] = Option(0, "currentIndex", ui->comboBoxTabPosition);
m_options["text_wrap"] = Option(true, "checked", ui->checkBoxTextWrap);
m_options["tray_items"] = Option(5, "value", ui->spinBoxTrayItems);
m_options["tray_commands"] = Option(true, "checked", ui->checkBoxTrayShowCommands);
m_options["tray_tab_is_current"] = Option(true, "checked", ui->checkBoxMenuTabIsCurrent);
m_options["tray_images"] = Option(true, "checked", ui->checkBoxTrayImages);
m_options["tray_tab"] = Option("", "text", ui->comboBoxMenuTab->lineEdit());
// Tooltip to show on command line.
ui->comboBoxMenuTab->lineEdit()->setToolTip( ui->comboBoxMenuTab->toolTip() );
/* other options */
m_options["tabs"] = Option(QStringList());
m_options["command_history_size"] = Option(100);
m_options["_last_hash"] = Option(0);
#ifndef NO_GLOBAL_SHORTCUTS
/* shortcuts */
m_options["toggle_shortcut"] = Option("", "text", ui->pushButton);
m_options["menu_shortcut"] = Option("", "text", ui->pushButton_2);
m_options["edit_clipboard_shortcut"] = Option("", "text", ui->pushButton_3);
m_options["edit_shortcut"] = Option("", "text", ui->pushButton_4);
m_options["second_shortcut"] = Option("", "text", ui->pushButton_5);
m_options["show_action_dialog"] = Option("", "text", ui->pushButton_6);
m_options["new_item_shortcut"] = Option("", "text", ui->pushButton_7);
#endif
#ifdef COPYQ_WS_X11
/* X11 clipboard selection monitoring and synchronization */
m_options["check_selection"] = Option(true, "checked", ui->checkBoxSel);
m_options["copy_clipboard"] = Option(true, "checked", ui->checkBoxCopyClip);
m_options["copy_selection"] = Option(true, "checked", ui->checkBoxCopySel);
#else
ui->checkBoxCopySel->hide();
ui->checkBoxSel->hide();
ui->checkBoxCopyClip->hide();
#endif
// values of last submitted action
m_options["action_has_input"] = Option(false);
m_options["action_has_output"] = Option(false);
m_options["action_separator"] = Option("\\n");
m_options["action_output_tab"] = Option("");
/* appearance options */
QString name;
QPalette p;
name = p.color(QPalette::Base).name();
m_theme["bg"] = Option(name, "VALUE", ui->pushButtonColorBg);
m_theme["edit_bg"] = Option(name, "VALUE", ui->pushButtonColorEditorBg);
name = p.color(QPalette::Text).name();
m_theme["fg"] = Option(name, "VALUE", ui->pushButtonColorFg);
m_theme["edit_fg"] = Option(name, "VALUE", ui->pushButtonColorEditorFg);
name = p.color(QPalette::Text).lighter(400).name();
m_theme["num_fg"] = Option(name, "VALUE", ui->pushButtonColorNumberFg);
name = p.color(QPalette::AlternateBase).name();
m_theme["alt_bg"] = Option(name, "VALUE", ui->pushButtonColorAltBg);
name = p.color(QPalette::Highlight).name();
m_theme["sel_bg"] = Option(name, "VALUE", ui->pushButtonColorSelBg);
name = p.color(QPalette::HighlightedText).name();
m_theme["sel_fg"] = Option(name, "VALUE", ui->pushButtonColorSelFg);
m_theme["find_bg"] = Option("#ff0", "VALUE", ui->pushButtonColorFindBg);
m_theme["find_fg"] = Option("#000", "VALUE", ui->pushButtonColorFindFg);
m_theme["font"] = Option("", "VALUE", ui->pushButtonFont);
m_theme["edit_font"] = Option("", "VALUE", ui->pushButtonEditorFont);
m_theme["find_font"] = Option("", "VALUE", ui->pushButtonFoundFont);
m_theme["num_font"] = Option("", "VALUE", ui->pushButtonNumberFont);
m_theme["show_number"] = Option(true, "checked", ui->checkBoxShowNumber);
m_theme["show_scrollbars"] = Option(true, "checked", ui->checkBoxScrollbars);
m_options["use_system_icons"] = Option(false, "checked", ui->checkBoxSystemIcons);
/* datafile for items */
QSettings settings(QSettings::IniFormat, QSettings::UserScope,
QCoreApplication::organizationName(),
QCoreApplication::applicationName());
const QString settingsFileName = settings.fileName();
m_datfilename = settingsFileName;
m_datfilename.replace( QRegExp(".ini$"), QString("_tab_") );
// Create directory to save items (otherwise it may not exist at time of saving).
QDir settingsDir(settingsFileName + "/..");
if ( settingsDir.mkdir(".") ) {
log( tr("Cannot create directory for settings \"%1\"!").arg(settingsDir.path()),
LogError );
}
connect(this, SIGNAL(finished(int)), SLOT(onFinished(int)));
// Tab icons
QTabWidget *tw = ui->tabWidget;
tw->setTabIcon( tw->indexOf(ui->tabClipboard), getIcon("", IconPaste) );
tw->setTabIcon( tw->indexOf(ui->tabGeneral), getIcon("", IconListOl) );
tw->setTabIcon( tw->indexOf(ui->tabTray), getIcon("", IconInbox) );
tw->setTabIcon( tw->indexOf(ui->tabCommands), getIcon("", IconCogs) );
tw->setTabIcon( tw->indexOf(ui->tabShortcuts), getIcon("", IconHandUp) );
tw->setTabIcon( tw->indexOf(ui->tabAppearance), getIcon("", IconPicture) );
loadSettings();
}
示例6: setTabIcon
void QTabWidgetProto::setTabIcon(int index, const QIcon &icon)
{
QTabWidget *item = qscriptvalue_cast<QTabWidget*>(thisObject());
if (item)
item->setTabIcon(index, icon);
}