first commit
This commit is contained in:
33
project/fm_viewer/ui/rm_filename_title.cpp
Normal file
33
project/fm_viewer/ui/rm_filename_title.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#include "rm_filename_title.h"
|
||||
#if (MODEL_WATEX)
|
||||
#include <QHBoxLayout>
|
||||
#include <QFileInfo>
|
||||
#include "../core/rm_player.h"
|
||||
#include "../data/rm_video_item_2ch.h"
|
||||
RMFileNameTitle::RMFileNameTitle(QWidget *parent) : RMWidgetStyleBase(parent,"frame_filename",false)
|
||||
{
|
||||
RMPlayer* player = RMPlayer::instance();
|
||||
connect(player,SIGNAL(playEvent(PLAY_EVENT,RMVideoItem*)),SLOT(onPlayEvent(PLAY_EVENT,RMVideoItem*)));
|
||||
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
layout->setContentsMargins(10,0,0,0);
|
||||
layout->setSpacing(0);
|
||||
layout->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
|
||||
|
||||
titleLabel = new QLabel(this);
|
||||
titleLabel->setObjectName("title_filename");
|
||||
layout->addWidget(titleLabel);
|
||||
titleLabel->setText("");
|
||||
}
|
||||
void RMFileNameTitle::onPlayEvent(PLAY_EVENT event,RMVideoItem* item)
|
||||
{
|
||||
if(event == PLAY_DID_LIST_SELECTED && item != NULL)
|
||||
{
|
||||
QFileInfo info = QFileInfo(item->anyFilePath());
|
||||
titleLabel->setText(info.fileName());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif // #if (MODEL_WATEX)
|
||||
Reference in New Issue
Block a user