本文整理汇总了C++中QLabel::installEventFilter方法的典型用法代码示例。如果您正苦于以下问题:C++ QLabel::installEventFilter方法的具体用法?C++ QLabel::installEventFilter怎么用?C++ QLabel::installEventFilter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QLabel
的用法示例。
在下文中一共展示了QLabel::installEventFilter方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: init
void KviIconWidget::init()
{
setWindowTitle(__tr2qs("Icon Table"));
setWindowIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::IconManager))));
int iRows = KviIconManager::IconCount / 20;
if((iRows * 20) < KviIconManager::IconCount)
iRows++;
QGridLayout * pLayout = new QGridLayout(this);
int i;
for(i = 0; i < 20; i++)
{
KviCString szTmp(KviCString::Format,"%d",i);
QLabel * pLabel = new QLabel(szTmp.ptr(),this);
pLayout->addWidget(pLabel,0,i + 1);
}
for(i = 0; i < iRows; i++)
{
KviCString szTmp(KviCString::Format,"%d",i * 20);
QLabel * pLabel = new QLabel(szTmp.ptr(),this);
pLayout->addWidget(pLabel,i + 1,0);
}
for(i = 0; i < KviIconManager::IconCount; i++)
{
KviCString szTmp(KviCString::Format,"%d",i);
QLabel * pLabel = new QLabel(this);
pLabel->setObjectName(szTmp.ptr());
pLabel->setPixmap(*(g_pIconManager->getSmallIcon(i)));
pLabel->installEventFilter(this);
pLabel->setAcceptDrops(true);
pLayout->addWidget(pLabel,(i / 20) + 1,(i % 20) + 1);
}
}
示例2: tabInserted
void TabBarWidget::tabInserted(int index)
{
setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
QTabBar::tabInserted(index);
if (m_showUrlIcon)
{
QLabel *label = new QLabel();
label->setFixedSize(QSize(16, 16));
setTabButton(index, m_iconButtonPosition, label);
}
else
{
setTabButton(index, m_iconButtonPosition, NULL);
}
if (m_showCloseButton || getTabProperty(index, QLatin1String("isPinned"), false).toBool())
{
QLabel *label = new QLabel();
label->setFixedSize(QSize(16, 16));
label->installEventFilter(this);
setTabButton(index, m_closeButtonPosition, label);
}
updateTabs();
emit tabsAmountChanged(count());
}
示例3: paint
void FilterItemDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QAbstractItemView *view = qobject_cast<QAbstractItemView*>(parent());
QLabel *label;
if (view->indexWidget(index) == 0)
{
label = new QLabel();
label->installEventFilter(filter);
label->setAutoFillBackground(true);
label->setFocusPolicy(Qt::TabFocus);
label->setText(index.data().toString());
view->setIndexWidget(index, label);
}
label = (QLabel*)view->indexWidget(index);
if (option.state & QStyle::State_Selected)
if (option.state & QStyle::State_HasFocus)
label->setBackgroundRole(QPalette::Highlight);
else
label->setBackgroundRole(QPalette::Window);
else
label->setBackgroundRole(QPalette::Base);
}
示例4: insertPermanentItem
void KStatusBar::insertPermanentItem( const QString& text, int id, int stretch)
{
if (d->items[id]) {
kDebug() << "KStatusBar::insertPermanentItem: item id " << id << " already exists.";
}
QLabel *l = new QLabel( text, this );
l->installEventFilter( this );
l->setFixedHeight( fontMetrics().height() + 2 );
l->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter );
d->items.insert( id, l );
addPermanentWidget( l, stretch );
l->show();
}
示例5: createLoadingFailedView
void CloudView::createLoadingFailedView()
{
loading_failed_view_ = new QWidget(this);
QVBoxLayout *layout = new QVBoxLayout;
loading_failed_view_->setLayout(layout);
QLabel *label = new QLabel;
label->setObjectName(kLoadingFaieldLabelName);
QString link = QString("<a style=\"color:#777\" href=\"#\">%1</a>").arg(tr("retry"));
QString label_text = tr("Failed to get libraries information<br/>"
"Please %1").arg(link);
label->setText(label_text);
label->setAlignment(Qt::AlignCenter);
connect(label, SIGNAL(linkActivated(const QString&)),
this, SLOT(onRefreshClicked()));
label->installEventFilter(this);
layout->addWidget(label);
}
示例6: createAndAddWidget
/* Overloading the AbstractController one, because we don't manage the
Spacing items in the same ways */
void DroppingController::createAndAddWidget( QBoxLayout *newControlLayout,
int i_index,
buttonType_e i_type,
int i_option )
{
/* Special case for SPACERS, who aren't QWidgets */
if( i_type == WIDGET_SPACER || i_type == WIDGET_SPACER_EXTEND )
{
QLabel *label = new QLabel( this );
label->setPixmap( ImageHelper::loadSvgToPixmap( ":/toolbar/space.svg", height(), height() ) );
if( i_type == WIDGET_SPACER_EXTEND )
{
label->setSizePolicy( QSizePolicy::MinimumExpanding,
QSizePolicy::Preferred );
/* Create a box around it */
label->setFrameStyle( QFrame::Panel | QFrame::Sunken );
label->setLineWidth ( 1 );
label->setAlignment( Qt::AlignCenter );
}
else
label->setSizePolicy( QSizePolicy::Fixed,
QSizePolicy::Preferred );
/* Install event Filter for drag'n drop */
label->installEventFilter( this );
newControlLayout->insertWidget( i_index, label );
}
/* Normal Widgets */
else
{
QWidget *widg = createWidget( i_type, i_option );
if( !widg ) return;
/* Install the Event Filter in order to catch the drag */
widg->setParent( this );
widg->installEventFilter( this );
/* We are in a complex widget, we need to stop events on children too */
if( i_type >= TIME_LABEL && i_type < SPECIAL_MAX )
{
QList<QObject *>children = widg->children();
QObject *child;
foreach( child, children )
{
QWidget *childWidg;
if( ( childWidg = qobject_cast<QWidget *>( child ) ) )
{
child->installEventFilter( this );
childWidg->setEnabled( true );
}
}
/* Decorating the frames when possible */
QFrame *frame;
if( (i_type >= MENU_BUTTONS || i_type == TIME_LABEL) /* Don't bother to check for volume */
&& ( frame = qobject_cast<QFrame *>( widg ) ) != NULL )
{
frame->setFrameStyle( QFrame::Panel | QFrame::Raised );
frame->setLineWidth ( 1 );
}
}
示例7: QWidget
QBalloonTip::QBalloonTip(QSystemTrayIcon::MessageIcon icon, const QString& title,
const QString& message, QSystemTrayIcon *ti)
: QWidget(0, Qt::ToolTip), trayIcon(ti), timerId(-1)
{
setAttribute(Qt::WA_DeleteOnClose);
QObject::connect(ti, SIGNAL(destroyed()), this, SLOT(close()));
QLabel *titleLabel = new QLabel;
titleLabel->installEventFilter(this);
titleLabel->setText(title);
QFont f = titleLabel->font();
f.setBold(true);
#ifdef Q_WS_WINCE
f.setPointSize(f.pointSize() - 2);
#endif
titleLabel->setFont(f);
titleLabel->setTextFormat(Qt::PlainText); // to maintain compat with windows
#ifdef Q_WS_WINCE
const int iconSize = style()->pixelMetric(QStyle::PM_SmallIconSize);
const int closeButtonSize = style()->pixelMetric(QStyle::PM_SmallIconSize) - 2;
#else
const int iconSize = 18;
const int closeButtonSize = 15;
#endif
QPushButton *closeButton = new QPushButton;
closeButton->setIcon(style()->standardIcon(QStyle::SP_TitleBarCloseButton));
closeButton->setIconSize(QSize(closeButtonSize, closeButtonSize));
closeButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
closeButton->setFixedSize(closeButtonSize, closeButtonSize);
QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
QLabel *msgLabel = new QLabel;
#ifdef Q_WS_WINCE
f.setBold(false);
msgLabel->setFont(f);
#endif
msgLabel->installEventFilter(this);
msgLabel->setText(message);
msgLabel->setTextFormat(Qt::PlainText);
msgLabel->setAlignment(Qt::AlignTop | Qt::AlignLeft);
// smart size for the message label
#ifdef Q_WS_WINCE
int limit = QApplication::desktop()->availableGeometry(msgLabel).size().width() / 2;
#else
int limit = QApplication::desktop()->availableGeometry(msgLabel).size().width() / 3;
#endif
if (msgLabel->sizeHint().width() > limit) {
msgLabel->setWordWrap(true);
if (msgLabel->sizeHint().width() > limit) {
msgLabel->d_func()->ensureTextControl();
if (QTextControl *control = msgLabel->d_func()->control) {
QTextOption opt = control->document()->defaultTextOption();
opt.setWrapMode(QTextOption::WrapAnywhere);
control->document()->setDefaultTextOption(opt);
}
}
#ifdef Q_WS_WINCE
// Make sure that the text isn't wrapped "somewhere" in the balloon widget
// in the case that we have a long title label.
setMaximumWidth(limit);
#else
// Here we allow the text being much smaller than the balloon widget
// to emulate the weird standard windows behavior.
msgLabel->setFixedSize(limit, msgLabel->heightForWidth(limit));
#endif
}
QIcon si;
switch (icon) {
case QSystemTrayIcon::Warning:
si = style()->standardIcon(QStyle::SP_MessageBoxWarning);
break;
case QSystemTrayIcon::Critical:
si = style()->standardIcon(QStyle::SP_MessageBoxCritical);
break;
case QSystemTrayIcon::Information:
si = style()->standardIcon(QStyle::SP_MessageBoxInformation);
break;
case QSystemTrayIcon::NoIcon:
default:
break;
}
QGridLayout *layout = new QGridLayout;
if (!si.isNull()) {
QLabel *iconLabel = new QLabel;
iconLabel->setPixmap(si.pixmap(iconSize, iconSize));
iconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
iconLabel->setMargin(2);
layout->addWidget(iconLabel, 0, 0);
layout->addWidget(titleLabel, 0, 1);
} else {
layout->addWidget(titleLabel, 0, 0, 1, 2);
}
layout->addWidget(closeButton, 0, 2);
layout->addWidget(msgLabel, 1, 0, 1, 3);
//.........这里部分代码省略.........
示例8: createWidgets
void KMix::createWidgets()
{
QPixmap miniDevPM;
QPixmap WMminiIcon = globalKIL->loadIcon("mixer_mini.xpm");
// keep this enum local. It is really only needed here
enum {audioIcon, bassIcon, cdIcon, extIcon, microphoneIcon,
midiIcon, recmonIcon,trebleIcon, unknownIcon, volumeIcon };
#ifdef ALSA /* not sure if this is for ALSA in general or just my SB16 */
char DefaultMixerIcons[]={
volumeIcon, bassIcon, trebleIcon, midiIcon, audioIcon,
extIcon, microphoneIcon, cdIcon, recmonIcon, recmonIcon, unknownIcon
};
const unsigned char numDefaultMixerIcons=11;
#else
char DefaultMixerIcons[]={
volumeIcon, bassIcon, trebleIcon, midiIcon, audioIcon,
unknownIcon, extIcon, microphoneIcon, cdIcon, recmonIcon,
audioIcon, recmonIcon, recmonIcon, recmonIcon, extIcon,
extIcon, extIcon
};
const unsigned char numDefaultMixerIcons=17;
#endif
// Init DnD: Set up drop zone and drop handler
// dropZone = new KDNDDropZone( this, DndURL );
//connect( dropZone, SIGNAL( dropAction( KDNDDropZone* )),
// SLOT( onDrop( KDNDDropZone*)));
// Window title
setCaption( globalKapp->getCaption() );
// Create a big container containing every widget of this toplevel
Container = new QWidget(this);
setView(Container);
// Create Menu
createMenu();
setMenu(mainmenu);
// Create Sliders (Volume indicators)
MixDevice *MixPtr = mix->First;
while (MixPtr) {
// If you encounter a relayout signal from a mixer device, obey blindly ;-)
connect((QObject*)MixPtr, SIGNAL(relayout()), this, SLOT(placeWidgets()));
int devnum = MixPtr->device_num;
// Figure out default icon
unsigned char iconnum;
if (devnum < numDefaultMixerIcons)
iconnum=DefaultMixerIcons[devnum];
else
iconnum=unknownIcon;
switch (iconnum) {
// TODO: Should be replaceable by user.
case audioIcon:
miniDevPM = globalKIL->loadIcon("mix_audio.xpm"); break;
case bassIcon:
miniDevPM = globalKIL->loadIcon("mix_bass.xpm"); break;
case cdIcon:
miniDevPM = globalKIL->loadIcon("mix_cd.xpm"); break;
case extIcon:
miniDevPM = globalKIL->loadIcon("mix_ext.xpm"); break;
case microphoneIcon:
miniDevPM = globalKIL->loadIcon("mix_microphone.xpm");break;
case midiIcon:
miniDevPM = globalKIL->loadIcon("mix_midi.xpm"); break;
case recmonIcon:
miniDevPM = globalKIL->loadIcon("mix_recmon.xpm"); break;
case trebleIcon:
miniDevPM = globalKIL->loadIcon("mix_treble.xpm"); break;
case unknownIcon:
miniDevPM = globalKIL->loadIcon("mix_unknown.xpm"); break;
case volumeIcon:
miniDevPM = globalKIL->loadIcon("mix_volume.xpm"); break;
default:
miniDevPM = globalKIL->loadIcon("mix_unknown.xpm"); break;
}
QLabel *qb = new QLabel(Container);
if (! miniDevPM.isNull()) {
qb->setPixmap(miniDevPM);
qb->installEventFilter(this);
}
else
cerr << "Pixmap missing.\n";
MixPtr->picLabel=qb;
qb->resize(miniDevPM.width(),miniDevPM.height());
QSlider *VolSB = new QSlider( 0, 100, 10, MixPtr->Left->volume,\
QSlider::Vertical, Container, "VolL");
MixPtr->Left->slider = VolSB; // Remember the Slider (for the eventFilter)
connect( VolSB, SIGNAL(valueChanged(int)), MixPtr->Left, SLOT(VolChanged(int)));
VolSB->installEventFilter(this);
// Create a second slider, when the current channel is a stereo channel.
bool BothSliders = (MixPtr->is_stereo == true );
if ( BothSliders) {
QSlider *VolSB2 = new QSlider( 0, 100, 10, MixPtr->Right->volume,\
//.........这里部分代码省略.........
示例9: showRoomGrid
void MainWindow::showRoomGrid()
{
if(0!=Grid || 0!=scroll || 0!=layout)
{
delete Grid;
delete scroll;
delete layout;
}
layout = new QVBoxLayout();
scroll = new QScrollArea(this);
Grid = new QGridLayout(this);
Grid->setHorizontalSpacing(6);
Grid->setVerticalSpacing(6);
scroll->setLayout(Grid);
layout->addWidget(scroll);
ui->Tabs2->widget(0)->setLayout(layout);
vector<Room> Room;
QString RoomNumTitle,RoomFloor;
Room = RM.fetchAllRooms();
int RoomSize=Room.size();
int i=0,j=0;
int num=0,RoomNum=0;
while(num!=RoomSize)
{
QLabel * RoomLabel = new QLabel(this);
RoomLabel->setGeometry(0,0,310,180);
RoomLabel->setFrameShape(QFrame::Box);
RoomLabel->setFrameShadow(QFrame::Sunken);
RoomLabel->setAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
RoomLabel->setFont(QFont( "Comic Sans MS", 8, QFont::Bold ));
//-----------------------------------------------------------
RoomNumTitle.setNum(Room[RoomNum].getRoomNumber());
RoomFloor.setNum(Room[RoomNum].getRoomFloor());
RoomLabel->setObjectName(RoomNumTitle);
RoomLabel->setText("Num:"+RoomNumTitle+"\n Floor:"+RoomFloor);
//-----------------------------------------------------------
if(RM.getStatus(Room[RoomNum].getRoomNumber(),QDate::currentDate(),QDate::currentDate())==false)
RoomLabel->setStyleSheet("color: white; background-color:green;");
else
RoomLabel->setStyleSheet("color: white; background-color:red;");
//-----------------------------------------------------------
RoomLabel->installEventFilter(this);
Grid->addWidget(RoomLabel,i,j);
num++;
if(j<5)
{
j++;
}
else
{
j=0;
i++;
}
RoomNum++;
}
}
示例10: defaults
AccountInfoPanel::AccountInfoPanel(Service * service, QWidget * parent)
: QWidget(parent), service(service), serviceNameAlternative(false)
{
// Get defaults
QVariantMap defaults(Utopia::defaults());
serviceInfoLayout = new QGridLayout(this);
// Account type (hidden until there are more possibilities)
QLabel * serviceTypeLabel = new QLabel("Account type:");
serviceInfoLayout->addWidget(serviceTypeLabel, 0, 0, Qt::AlignRight);
serviceTypeLabel->hide();
serviceType = new QLabel;
serviceInfoLayout->addWidget(serviceType, 0, 1, 1, 2);
serviceType->hide();
// Service name
QLabel * serviceNameLabel = new QLabel("Service name:");
serviceNameLabel->installEventFilter(this);
serviceInfoLayout->addWidget(serviceNameLabel, 1, 0, Qt::AlignRight);
serviceName = new QLabel;
serviceName->installEventFilter(this);
serviceInfoLayout->addWidget(serviceName, 1, 1, 1, 2);
// Account description
serviceInfoLayout->addWidget(new QLabel("Description:"), 2, 0, Qt::AlignRight);
descriptionLineEdit = new QLineEdit;
connect(descriptionLineEdit, SIGNAL(textEdited(const QString &)), this, SLOT(onDescriptionChanged(const QString &)));
serviceInfoLayout->addWidget(descriptionLineEdit, 2, 1, 1, 2);
// Credentials
// The following renaming is a temporary fix for commercial users whose usernames
// are not email addresses
userNameLabel = new QLabel(defaults.value("rename_username", "Email address").toString() + ":");
serviceInfoLayout->addWidget(userNameLabel, 3, 0, Qt::AlignRight);
userName = new QLineEdit;
connect(userName, SIGNAL(textEdited(const QString &)), this, SLOT(onUserNameChanged(const QString &)));
serviceInfoLayout->addWidget(userName, 3, 1);
registerLabel = new QLabel("<a href='register' style='text-decoration: none'>Register</a>");
registerLabel->setProperty("class", "link");
connect(registerLabel, SIGNAL(linkActivated(const QString &)), this, SLOT(onLinkActivated(const QString &)));
serviceInfoLayout->addWidget(registerLabel, 3, 2);
passwordLabel = new QLabel("Password:");
serviceInfoLayout->addWidget(passwordLabel, 4, 0, Qt::AlignRight);
password = new QLineEdit;
password->setEchoMode(QLineEdit::Password);
serviceInfoLayout->addWidget(password, 4, 1);
connect(password, SIGNAL(textEdited(const QString &)), this, SLOT(onPasswordChanged(const QString &)));
resetPasswordLabel = new QLabel("<a href='resetPassword' style='text-decoration: none'>Reset Password</a>");
resetPasswordLabel->setProperty("class", "link");
connect(resetPasswordLabel, SIGNAL(linkActivated(const QString &)), this, SLOT(onLinkActivated(const QString &)));
serviceInfoLayout->addWidget(resetPasswordLabel, 4, 2);
anonymousCheckBox = new QCheckBox("Use anonymously");
connect(anonymousCheckBox, SIGNAL(clicked(bool)), this, SLOT(onAnonymousChanged(bool)));
serviceInfoLayout->addWidget(anonymousCheckBox, 5, 1, 1, 2, Qt::AlignTop);
profileButton = new QPushButton("User profile...");
connect(profileButton, SIGNAL(clicked()), this, SLOT(onProfileButtonClicked()));
serviceInfoLayout->addWidget(profileButton, 6, 0, 1, 3, Qt::AlignRight);
// Disclaimer text
disclaimer = new QLabel;
disclaimer->setAlignment(Qt::AlignBottom | Qt::AlignLeft);
disclaimer->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
disclaimer->setObjectName("disclaimer");
serviceInfoLayout->addWidget(disclaimer, 6, 1, 1, 2);
// Layout
serviceInfoLayout->setColumnStretch(0, 0);
serviceInfoLayout->setColumnStretch(1, 1);
serviceInfoLayout->setRowStretch(0, 0);
serviceInfoLayout->setRowStretch(1, 0);
serviceInfoLayout->setRowStretch(2, 0);
serviceInfoLayout->setRowStretch(3, 0);
serviceInfoLayout->setRowStretch(4, 0);
serviceInfoLayout->setRowStretch(5, 1);
serviceInfoLayout->setRowStretch(6, 1);
refreshInformation();
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
connect(service, SIGNAL(serviceStateChanged(Kend::Service::ServiceState)), this, SLOT(onServiceStateChanged(Kend::Service::ServiceState)));
onServiceStateChanged(service->serviceState());
}
示例11: LayeredWidget
PlayerWidget::PlayerWidget(QWidget *parent) :
QWidget(parent),
m_subtitle(0),
m_translationMode(false),
m_showTranslation(false),
m_overlayLine(0),
m_playingLine(0),
m_fullScreenTID(0),
m_fullScreenMode(false),
m_player(Player::instance()),
m_lengthString(UNKNOWN_LENGTH_STRING),
m_updatePositionControls(1),
m_updateVideoPosition(false),
m_updateVolumeControls(true),
m_updatePlayerVolume(false),
m_showPositionTimeEdit(app()->playerConfig()->showPositionTimeEdit())
{
m_layeredWidget = new LayeredWidget(this);
m_layeredWidget->setAcceptDrops(true);
m_layeredWidget->installEventFilter(this);
m_layeredWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
m_player->initialize(m_layeredWidget, app()->playerConfig()->playerBackend());
connect(m_player, SIGNAL(backendInitialized(ServiceBackend *)), this, SLOT(onPlayerBackendInitialized()));
m_textOverlay = new TextOverlayWidget(m_layeredWidget);
m_textOverlay->setAlignment(Qt::AlignHCenter | Qt::AlignBottom);
m_seekSlider = new PointingSlider(Qt::Horizontal, this);
m_seekSlider->setTickPosition(QSlider::NoTicks);
m_seekSlider->setTracking(false);
m_seekSlider->setMinimum(0);
m_seekSlider->setMaximum(1000);
m_seekSlider->setPageStep(10);
m_seekSlider->setFocusPolicy(Qt::NoFocus);
m_infoControlsGroupBox = new QGroupBox(this);
m_infoControlsGroupBox->setAcceptDrops(true);
m_infoControlsGroupBox->installEventFilter(this);
QLabel *positionTagLabel = new QLabel(m_infoControlsGroupBox);
positionTagLabel->setText(i18n("<b>Position</b>"));
positionTagLabel->installEventFilter(this);
m_positionLabel = new QLabel(m_infoControlsGroupBox);
m_positionEdit = new TimeEdit(m_infoControlsGroupBox);
m_positionEdit->setFocusPolicy(Qt::NoFocus);
QLabel *lengthTagLabel = new QLabel(m_infoControlsGroupBox);
lengthTagLabel->setText(i18n("<b>Length</b>"));
lengthTagLabel->installEventFilter(this);
m_lengthLabel = new QLabel(m_infoControlsGroupBox);
QLabel *fpsTagLabel = new QLabel(m_infoControlsGroupBox);
fpsTagLabel->setText(i18n("<b>FPS</b>"));
fpsTagLabel->installEventFilter(this);
m_fpsLabel = new QLabel(m_infoControlsGroupBox);
m_fpsLabel->setMinimumWidth(m_positionEdit->sizeHint().width()); // sets the minimum width for the whole group
m_volumeSlider = new PointingSlider(Qt::Vertical, this);
m_volumeSlider->setFocusPolicy(Qt::NoFocus);
m_volumeSlider->setTickPosition(QSlider::NoTicks);
// m_volumeSlider->setInvertedAppearance( true );
m_volumeSlider->setTracking(true);
m_volumeSlider->setPageStep(5);
m_volumeSlider->setMinimum(0);
m_volumeSlider->setMaximum(100);
m_volumeSlider->setFocusPolicy(Qt::NoFocus);
QGridLayout *videoControlsLayout = new QGridLayout();
videoControlsLayout->setMargin(0);
videoControlsLayout->setSpacing(2);
videoControlsLayout->addWidget(createToolButton(this, ACT_PLAY_PAUSE, 16), 0, 0);
videoControlsLayout->addWidget(createToolButton(this, ACT_STOP, 16), 0, 1);
videoControlsLayout->addWidget(createToolButton(this, ACT_SEEK_BACKWARDS, 16), 0, 2);
videoControlsLayout->addWidget(createToolButton(this, ACT_SEEK_FORWARDS, 16), 0, 3);
videoControlsLayout->addItem(new QSpacerItem(2, 2), 0, 4);
videoControlsLayout->addWidget(createToolButton(this, ACT_SEEK_TO_PREVIOUS_LINE, 16), 0, 5);
videoControlsLayout->addWidget(createToolButton(this, ACT_SEEK_TO_NEXT_LINE, 16), 0, 6);
videoControlsLayout->addItem(new QSpacerItem(2, 2), 0, 7);
videoControlsLayout->addWidget(createToolButton(this, ACT_SET_CURRENT_LINE_SHOW_TIME, 16), 0, 8);
videoControlsLayout->addWidget(createToolButton(this, ACT_SET_CURRENT_LINE_HIDE_TIME, 16), 0, 9);
videoControlsLayout->addItem(new QSpacerItem(2, 2), 0, 10);
videoControlsLayout->addWidget(createToolButton(this, ACT_CURRENT_LINE_FOLLOWS_VIDEO, 16), 0, 11);
videoControlsLayout->addWidget(m_seekSlider, 0, 12);
QGridLayout *audioControlsLayout = new QGridLayout();
audioControlsLayout->setMargin(0);
audioControlsLayout->addWidget(createToolButton(this, ACT_TOGGLE_MUTED, 16), 0, 0, Qt::AlignHCenter);
audioControlsLayout->addWidget(m_volumeSlider, 1, 0, Qt::AlignHCenter);
QGridLayout *infoControlsLayout = new QGridLayout(m_infoControlsGroupBox);
infoControlsLayout->setSpacing(5);
infoControlsLayout->addWidget(fpsTagLabel, 0, 0);
infoControlsLayout->addWidget(m_fpsLabel, 1, 0);
infoControlsLayout->addItem(new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding), 2, 0);
infoControlsLayout->addWidget(lengthTagLabel, 3, 0);
infoControlsLayout->addWidget(m_lengthLabel, 4, 0);
//.........这里部分代码省略.........