Пример #1
0
QTFAbstractPanel::QTFAbstractPanel(QWidget* parent):QWidget(parent), m_isHidden(false), m_isCollapsable(true),
								   m_checked(QString(":/arrow-collapsed.png")), m_unchecked(QString(":/arrow-expanded.png")), m_widgets(NULL) {
	m_pTFEditor = (QTFEditor*)parent;
	m_showButton = new QToolButton(this);
	m_showButton->setIconSize(QSize(20,20));
	m_showButton->setIcon(m_unchecked);
	m_showButton->setAutoRaise(true);
	connect(m_showButton, SIGNAL(clicked()),
			this, SLOT(toggleHide()));
	if(!m_isCollapsable)
		m_showButton->hide();
}
Пример #2
0
PanelPage::PanelPage(QGraphicsItem *parent): MApplicationPage(parent)
{
    m_panelmgr = new McaPanelManager(this);
    m_panelmgr->setCategories(QStringList() << "email" << "social" << "im");
    m_panelmgr->initialize("sample");

    m_frozen = false;
    m_hiding = false;

    QGraphicsLinearLayout *linear = new QGraphicsLinearLayout(Qt::Vertical, centralWidget());

    QGraphicsLinearLayout *toolbar = new QGraphicsLinearLayout(Qt::Horizontal);
    linear->addItem(toolbar);

    MButton *button = new MButton("Search");
    connect(button, SIGNAL(clicked()), this, SLOT(openSearch()));
    toolbar->addItem(button);

    button = new MButton("Settings");
    connect(button, SIGNAL(clicked()), this, SLOT(openSettings()));
    toolbar->addItem(button);

    m_freezeButton = new MButton("Freeze");
    connect(m_freezeButton, SIGNAL(clicked()), this, SLOT(toggleFreeze()));
    toolbar->addItem(m_freezeButton);

    m_hideButton = new MButton("Mode: Default");
    connect(m_hideButton, SIGNAL(clicked()), this, SLOT(toggleHide()));
    toolbar->addItem(m_hideButton);

    MList *list = new MList;
    linear->addItem(list);
    list->setPreferredWidth(800);
    list->setItemModel(m_panelmgr->feedModel());
    PanelCellCreator *cellCreator = new PanelCellCreator;
    cellCreator->m_page = this;
    list->setCellCreator(cellCreator);
}