示例#1
0
KNMusicTreeViewBase::KNMusicTreeViewBase(QWidget *parent) :
    QTreeView(parent)
{
    //Set properties.
    setAllColumnsShowFocus(true);
    setAlternatingRowColors(true);
    setContentsMargins(0,0,0,0);
    setDragDropMode(QAbstractItemView::DragOnly);
    setDropIndicatorShown(true);
    setFrameShape(QFrame::NoFrame);
    setIndentation(0);
    setMouseTracking(true);
    setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
    setSelectionBehavior(QAbstractItemView::SelectRows);
    setSelectionMode(QAbstractItemView::ExtendedSelection);
    setUniformRowHeights(true);
    setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);

    //Set scroll bar properties.
    horizontalScrollBar()->setSingleStep(5);
    horizontalScrollBar()->setPageStep(5);
    verticalScrollBar()->setSingleStep(4);
    verticalScrollBar()->setPageStep(4);

    //Using frame updater to set palette.
    onActionMouseInOut(0);

    //Set animation header.
    KNMusicTreeViewHeader *header=new KNMusicTreeViewHeader(this);
    connect(header, &KNMusicTreeViewHeader::requireResizeColumnToContents,
            this, &KNMusicTreeViewBase::resizeColumnToContents);
    setHeader(header);

    //Set delegate.
    setItemDelegateForColumn(Rating,
                             new KNMusicRatingDelegate(this));
    setItemDelegateForColumn(AlbumRating,
                             new KNMusicRatingDelegate(this));

    //Initial menu connections.
    m_soloConnections=new KNConnectionHandler(this);
    m_multiConnections=new KNConnectionHandler(this);

    //Initial mouse sense animation.
    m_mouseIn=new QTimeLine(200, this);
    configureTimeLine(m_mouseIn);
    m_mouseIn->setEndFrame(m_maxOpacity);
    m_mouseOut=new QTimeLine(200, this);
    configureTimeLine(m_mouseOut);
    m_mouseOut->setEndFrame(0);

    //Initial reacts.
    connect(this, &KNMusicTreeViewBase::activated,
            this, &KNMusicTreeViewBase::playIndex);

    //Initial actions.
    initialActions();
}
示例#2
0
ProcessView::ProcessView(QWidget *parent)
	: QTableView(parent)
{
	initialActions();

	connect(m_refresh, SIGNAL(triggered()), this, SLOT(onRefreshActionTriggered()));
	connect(m_modules, SIGNAL(triggered()), this, SLOT(onModulesActionTriggered()));
	connect(m_threads, SIGNAL(triggered()), this, SLOT(onThreadsActionTriggered()));
	connect(m_location, SIGNAL(triggered()), this, SLOT(onLocationActionTriggered()));
}
示例#3
0
MainWindow::MainWindow (QWidget *parent, Qt::WindowFlags f) :
  QMainWindow(parent, f),
  ui(new Ui::MainWindow)
{
  ui->setupUi(this);

  setAttribute ( Qt::WA_DeleteOnClose );

  initialTree();
  initialStatusBar();
  initialFindDock();
  initialActions();

  setCentralWidget( tree );
  modelTouched ();
}
示例#4
0
DocumentPropertiesDialog::DocumentPropertiesDialog (QWidget *parent, Qt::WindowFlags f) :
  QDialog(parent, f),
  ui(new Ui::DocumentPropertiesDialog)
{
  ui->setupUi(this);
  setAttribute ( Qt::WA_DeleteOnClose );  

  initialActions();
  fillComboBox();

  piModel = new QStringListModel( this );
  ui->listViewPI->setModel ( piModel );

  connect ( ui->listViewPI->selectionModel(), SIGNAL( currentChanged (QModelIndex, QModelIndex) ), this, SLOT( indexChanged (QModelIndex, QModelIndex) ) );
  connect ( ui->pushButtonPIAdd, SIGNAL ( clicked () ), this, SLOT ( piAdd () ) );
  connect ( ui->pushButtonPIRemove, SIGNAL ( clicked () ), this, SLOT ( piRemove () ) );
  connect ( ui->lineEditPITarget, SIGNAL ( textEdited (QString) ), this, SLOT (piTargetChanged(QString)) );
  connect ( ui->lineEditPIData, SIGNAL ( textEdited (QString) ), this, SLOT (piDataChanged(QString)) );

  ui->groupBoxPIEdit->setVisible ( ui->pushButtonPIEditToggle->isChecked() );
}