Ejemplo n.º 1
0
void BitcoinGUI::createToolBars2()
{
    QLabel *mylabel = new QLabel (this);
   mylabel->setPixmap(QPixmap(":images/head"));
   mylabel->show();

    QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
    toolbar->setObjectName("toolbar");
    addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setMovable( false );
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar->setIconSize(QSize(50,25));
    toolbar->addWidget(mylabel);
    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->addAction(blockAction);
    toolbar->addAction(statisticsAction);
    toolbar->addAction(optionsAction);

    QWidget* spacer = new QWidget();
    spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    toolbar->addWidget(spacer);
    spacer->setObjectName("spacer");
    toolbar->setStyleSheet(
    "#toolbar { font-weight:600;border:none;height:100%;padding-top:20px; background: rgb(37,40,46); text-align: left; color: white;min-width:180px;max-width:180px;}"
    "QToolBar QToolButton:hover {background:rgb(28,29,33);}"
    "QToolBar QToolButton:checked {background:rgba(28,29,33,100);}"
    "QToolBar QToolButton { font-weight:600;font-size:10px;font-family:'Century Gothic';padding-left:20px;padding-right:181px;padding-top:5px;padding-bottom:5px; width:100%; color: white; text-align: left; background:transparent;text-transform:uppercase; }");

    wId = new QWidget(this);
    wId3 = new QWidget(this);
    QToolBar *toolbars = addToolBar(tr("Settings2"));
    addToolBar(Qt::RightToolBarArea,toolbars);
    toolbars->setOrientation(Qt::Horizontal);
    toolbars->setMovable( false );
    toolbars->setStyleSheet("QToolBar QToolButton {border:0px;margin-right:3px} QToolBar{ border:0px; }");
    toolbars->setIconSize(QSize(102,25));
    QHBoxLayout *vbox5 = new QHBoxLayout();
    vbox5->addWidget(toolbars);
    vbox5->setContentsMargins(0,0,0,0);
    wId3->setFixedSize(250,30);
    wId3->move(260,10);
    wId3->setLayout(vbox5);
    wId3->setFocus();
    wId3->raise();
    QMenu *menu = new QMenu(tr("Mini"));
    menu->setStyleSheet("border:none;background:none;");
    menu->addAction(toggleHideAction);
    menu->menuAction()->setIcon(QIcon(":/icons/mini"));
    QHBoxLayout *vbox3 = new QHBoxLayout();
    vbox3->setContentsMargins(0,0,0,0);
    wId->setFixedSize(120,40);
    wId->move(915,1);
    wId->setLayout(vbox3);
    wId->setFocus();
}
Ejemplo n.º 2
0
void MainWindow::createToolBar(){
	QToolBar* toolBar = new QToolBar();
	toolBar->setMovable(false);

	newFileButton = new QPushButton();
	newFileButton->setIcon(QIcon(":new-file.png"));
	newFileButton->setIconSize(QSize(20,20));
	newFileButton->setToolTip(tr("Create a new file"));
	newFileButton->setMaximumWidth(28);
	newFileButton->setCursor(Qt::PointingHandCursor);
	connect(newFileButton,SIGNAL(released()),this,SLOT(createNewFile()));
	toolBar->addWidget(newFileButton);

	openFileButton = new QPushButton();
	openFileButton->setIcon(QIcon(":open-file.png"));
	openFileButton->setIconSize(QSize(20,20));
	openFileButton->setToolTip(tr("Open a file"));
	openFileButton->setMaximumWidth(28);
	openFileButton->setCursor(Qt::PointingHandCursor);
	connect(openFileButton,SIGNAL(released()),this,SLOT(openFile()));
	toolBar->addWidget(openFileButton);

	saveFileButton = new QPushButton();
	saveFileButton->setIcon(QIcon(":save-file.png"));
	saveFileButton->setIconSize(QSize(20,20));
	saveFileButton->setToolTip(tr("Save the current file"));
	saveFileButton->setMaximumWidth(28);
	saveFileButton->setCursor(Qt::PointingHandCursor);
	saveFileButton->setShortcut(QKeySequence("Ctrl+S"));
	connect(saveFileButton,SIGNAL(released()),this,SLOT(saveFile()));
	toolBar->addWidget(saveFileButton);

	addToolBar(toolBar);
}
Ejemplo n.º 3
0
    void MainWindow::createMenus()
    {
        QAction * quitAction = new QAction("Quit", this);
        QObject::connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));

        QIcon quitIcon;
        quitIcon.addPixmap(QPixmap("data/images/QuitIcon.png"), QIcon::Normal);
        quitAction->setIcon(quitIcon);

        QToolBar * toolBar = addToolBar("oriToolBar");
        toolBar->setMovable(false);

        QWidget* spacer = new QWidget();
        spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);

        toolBar->addAction("Left-aligned button");


        QAction * startAction = new QAction("Start", this);
        QObject::connect(startAction, SIGNAL(triggered()), this, SLOT(start()));
        toolBar->addAction(startAction);


        toolBar->addWidget(spacer);
        toolBar->addAction(quitAction);

    }
Ejemplo n.º 4
0
/* \x41\x41\x41\x41\x41\x41\x41 */
TempleWin::TempleWin(QWidget *parent)
    : QMainWindow(parent) {

    lang = new TempleLang();
    std::cout << "==========" << std::endl;
    //menu
    QAction *quit = new QAction("&Quit", this);

    QMenu *file;
    file = menuBar()->addMenu("&File");
    file->addAction(quit);

    connect(quit, SIGNAL(triggered()), qApp, SLOT(quit()));

    //toolbar
    QToolBar *tb = new QToolBar("TOOLBAR");

    TBar *tbw = new TBar(this, lang);
    tb->addWidget(tbw);
    tb->setMovable(false);
    addToolBar(Qt::RightToolBarArea, tb);

    GLWidget *widGl = new GLWidget(this, lang);
    widGl->show();
    widGl->resize(200,200);
    setCentralWidget(widGl);
}
Ejemplo n.º 5
0
void BitcoinGUI::createToolBars()
{
    QToolBar *toolbar = addToolBar(tr("Screens toolbar"));
    toolbar->setObjectName("toolbar");
    addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setMovable( false );
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar->setIconSize(QSize(50,25));
    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->addAction(exportAction);
    toolbar->addAction(optionsAction);

    QWidget* spacer = new QWidget();
    spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    toolbar->addWidget(spacer);
    spacer->setObjectName("spacer");


    QToolBar *toolbar2 = addToolBar(tr("Actions toolbar"));
    toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar2->addAction(openRPCConsoleAction);
    toolbar2->setVisible(false);
}
Ejemplo n.º 6
0
void BitcoinGUI::createToolBars()
{
    QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
    toolbar->setObjectName("toolbar");
    addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setFixedWidth(205);
    toolbar->setMovable( false );
    toolbar->setToolButtonStyle(Qt::ToolButtonTextOnly);

    QLabel* header = new QLabel();
    header->setMinimumSize(156,156);
    header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    header->setPixmap(QPixmap(":/images/header"));
    header->setMaximumSize(156,156);
    header->setContentsMargins(26,26,0,0);
    header->setScaledContents(true);
    toolbar->addWidget(header);

	QLabel *l = new QLabel(this);
    l->setPixmap(QPixmap(":/images/spacer"));
    toolbar->addWidget(l);
    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->setStyleSheet("#toolbar {background: transparent; text-align: center; color: black;padding-right: 30px;} QToolBar QToolButton:hover {background-color: transparent;} QToolBar QToolButton:selected {background-color: transparent;} QToolBar QToolButton:checked {background-color: transparent;} QToolBar QToolButton:pressed {background-color: transparent;} QToolBar QToolButton {font-family:Steps; font-size:15px; font-weight: bold; min-width:125px;max-width:125px; min-height:25px;max-height:25px; color: white; text-align: left; }");

}
Ejemplo n.º 7
0
void BitcoinGUI::createToolBars()
{

    QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
	toolbar->setObjectName("toolbar");
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
	addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setMovable(false);

    QWidget* header = new QWidget();
    header->setMinimumSize(140, 45);
    header->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    header->setStyleSheet("QWidget { background-color: rgb(0,0,0); background-repeat: no-repeat; background-image: url(:/images/header); background-position: top center; }");
    toolbar->addWidget(header);

    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
	toolbar->addAction(bittrexPageAction);
	toolbar->addAction(shockBotAction);
    toolbar->addAction(blockAction);
    toolbar->addAction(socialPageAction);
	toolbar->addAction(chatAction);
    toolbar->addAction(exportAction);
}
Ejemplo n.º 8
0
void spincoinGUI::createToolBars()
{
    QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
    toolbar->setObjectName("toolbar");
    addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setMovable( false );
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar->setIconSize(QSize(50,25));
    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
	toolbar->addAction(statisticsAction);
	toolbar->addAction(blockAction);
	toolbar->addAction(unlockWalletAction);
	toolbar->addAction(lockWalletAction);
//	toolbar->addAction(exportAction);
    QWidget* spacer = new QWidget();
    spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    toolbar->addWidget(spacer);
    spacer->setObjectName("spacer");


}
Ejemplo n.º 9
0
void FujicoinGUI::createToolBars()
{
    if(walletFrame)
    {
        QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
        appToolBar = toolbar;
        toolbar->setContextMenuPolicy(Qt::PreventContextMenu);
        toolbar->setMovable(false);
        toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
        toolbar->addAction(overviewAction);
        toolbar->addAction(sendCoinsAction);
        toolbar->addAction(receiveCoinsAction);
        toolbar->addAction(historyAction);
        overviewAction->setChecked(true);

#ifdef ENABLE_WALLET
        QWidget *spacer = new QWidget();
        spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
        toolbar->addWidget(spacer);

        m_wallet_selector = new QComboBox();
        connect(m_wallet_selector, SIGNAL(currentIndexChanged(int)), this, SLOT(setCurrentWalletBySelectorIndex(int)));

        m_wallet_selector_label = new QLabel();
        m_wallet_selector_label->setText(tr("Wallet:") + " ");
        m_wallet_selector_label->setBuddy(m_wallet_selector);

        m_wallet_selector_label_action = appToolBar->addWidget(m_wallet_selector_label);
        m_wallet_selector_action = appToolBar->addWidget(m_wallet_selector);

        m_wallet_selector_label_action->setVisible(false);
        m_wallet_selector_action->setVisible(false);
#endif
    }
}
Ejemplo n.º 10
0
void BitcoinGUI::createToolBars()
{
    QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
    toolbar->setObjectName("toolbar");
    addToolBar(Qt::LeftToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Vertical);
    toolbar->setMovable( false );
    toolbar->setToolButtonStyle(Qt::ToolButtonTextOnly);
	QLabel *l = new QLabel(this);
    l->setPixmap(QPixmap(":/images/spacer"));
    toolbar->addWidget(l);
    toolbar->addAction(overviewAction);
    toolbar->addAction(statisticsAction);
    toolbar->addAction(blockAction);
    toolbar->addAction(chatAction);
#ifdef ENABLE_TRADE_REQUIRE_QT5
    toolbar->addAction(TradingAction);
#endif
//    toolbar->addAction(radioAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->setStyleSheet("#toolbar { border:1px;height:100%;padding-top:100px; background: transparent; text-align: center; color: #4DD0F0;min-width:200px;max-width:200px;} QToolBar QToolButton:hover {background-image: url(:images/1); background-color: transparent;} QToolBar QToolButton:selected {background-color: transparent;} QToolBar QToolButton:checked {background-image: url(:images/2); background-color: transparent;} QToolBar QToolButton:pressed {background-color: transparent;} QToolBar QToolButton { margin: 2px; background-image:url(:images/3); font-family:'Bebas'; font-size:14px; min-width:160px;max-width:160px; min-height:40px;max-height:40px; color: white; text-align: center; }");
}
Ejemplo n.º 11
0
void BitcoinGUI::createToolBars()
{
    if(walletFrame)
    {
        QToolBar *toolbar = new QToolBar(tr("Tabs toolbar"));
        toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
        toolbar->addAction(overviewAction);
        toolbar->addAction(sendCoinsAction);
        toolbar->addAction(receiveCoinsAction);
        toolbar->addAction(historyAction);
        toolbar->setMovable(false); // remove unused icon in upper left corner
        overviewAction->setChecked(true);

        /** Create additional container for toolbar and walletFrame and make it the central widget.
            This is a workaround mostly for toolbar styling on Mac OS but should work fine for every other OSes too.
        */
        QVBoxLayout *layout = new QVBoxLayout;
        layout->addWidget(toolbar);
        layout->addWidget(walletFrame);
        layout->setSpacing(0);
        layout->setContentsMargins(QMargins());
        QWidget *containerWidget = new QWidget();
        containerWidget->setLayout(layout);
        setCentralWidget(containerWidget);
    }
}
Ejemplo n.º 12
0
void MainWindow::createSpriteView(SpriteModel* model)
{
	QMainWindow* window = new QMainWindow;

	QToolBar* bar = new QToolBar( window );
	bar->addAction( ui.actionSpritesNewFolder );
	bar->addAction( ui.actionSpritesNewSprite );
	bar->addAction( ui.actionSpritesMoveSprite );
	bar->addAction( ui.actionSpritesRemoveItem );
	bar->setMovable( false );

	window->addToolBar( bar );
	window->setParent( ui.dockWidgetComposition );

	spriteView = new SpriteView( this );
	spriteView->setModel(model);
	spriteView->addAction( ui.actionSpritesNewFolder );
	spriteView->addAction( ui.actionSpritesNewSprite );
	spriteView->addAction( ui.actionSpritesMoveSprite );
	spriteView->addAction( ui.actionSpritesRemoveItem );
	spriteView->setContextMenuPolicy( Qt::ActionsContextMenu );

	window->setCentralWidget( spriteView );
	ui.dockWidgetSprites->setWidget( window );

	connect( ui.actionSpritesNewFolder, SIGNAL( triggered() ), this, SLOT( actionSpritesNewFolder() ) );
	connect( ui.actionSpritesNewSprite, SIGNAL( triggered() ), this, SLOT( actionSpritesNewSprite() ) );
	connect( ui.actionSpritesMoveSprite, SIGNAL( triggered() ), this, SLOT( actionSpritesMoveSprite() ) );
	connect( ui.actionSpritesRemoveItem, SIGNAL( triggered() ), this, SLOT( actionSpritesRemoveItem() ) );
}
Ejemplo n.º 13
0
void IdealController::addView(Qt::DockWidgetArea area, View* view)
{
    IdealDockWidget *dock = new IdealDockWidget(this, m_mainWindow);
    // dock object name is used to store toolview settings
    QString dockObjectName = view->document()->title();
    // support different configuration for same docks opened in different areas
    if (m_mainWindow->area())
        dockObjectName += '_' + m_mainWindow->area()->objectName();

    dock->setObjectName(dockObjectName);

    KAcceleratorManager::setNoAccel(dock);
    QWidget *w = view->widget(dock);
    if (w->parent() == 0)
    {
        /* Could happen when we're moving the widget from
           one IdealDockWidget to another.  See moveView below.
           In this case, we need to reparent the widget. */
        w->setParent(dock);
    }

    QList<QAction *> toolBarActions = view->toolBarActions();
    if (toolBarActions.isEmpty()) {
      dock->setWidget(w);
    } else {
      QMainWindow *toolView = new QMainWindow();
      QToolBar *toolBar = new QToolBar(toolView);
      int iconSize = m_mainWindow->style()->pixelMetric(QStyle::PM_SmallIconSize);
      toolBar->setIconSize(QSize(iconSize, iconSize));
      toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
      toolBar->setWindowTitle(i18n("%1 Tool Bar", w->windowTitle()));
      toolBar->setFloatable(false);
      toolBar->setMovable(false);
      toolBar->addActions(toolBarActions);
      toolView->setCentralWidget(w);
      toolView->addToolBar(toolBar);
      dock->setWidget(toolView);
    }

    dock->setWindowTitle(view->widget()->windowTitle());
    dock->setWindowIcon(view->widget()->windowIcon());
    dock->setFocusProxy(dock->widget());

    if (IdealButtonBarWidget* bar = barForDockArea(area)) {
        QAction* action = bar->addWidget(
            view->document()->title(), dock,
            static_cast<MainWindow*>(parent())->area(), view);
        m_dockwidget_to_action[dock] = m_view_to_action[view] = action;

        m_docks->addAction(action);
        connect(dock, &IdealDockWidget::closeRequested, action, &QAction::toggle);
    }

    connect(dock, &IdealDockWidget::dockLocationChanged, this, &IdealController::dockLocationChanged);

    dock->hide();

    docks.insert(dock);
}
Ejemplo n.º 14
0
static QToolBar* createToolBar(const QString& name, QWidget* parent, bool visible) {
    QToolBar* bar = new QToolBar(parent);
    bar->setObjectName(name);
    bar->setFloatable(false);
    bar->setMovable(true);
    bar->setVisible(visible);
    return bar;
}
Ejemplo n.º 15
0
EditWidget::EditWidget(IMessageWidgets *AMessageWidgets, IMessageWindow *AWindow, QWidget *AParent) : QWidget(AParent)
{
	ui.setupUi(this);
	ui.medEditor->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);

	FWindow = AWindow;
	FMessageWidgets = AMessageWidgets;
	
	FBufferPos = -1;
	FSendEnabled = true;
	FEditEnabled = true;
	setRichTextEnabled(false);

	QToolBar *toolBar = new QToolBar;
	toolBar->setMovable(false);
	toolBar->setFloatable(false);
	toolBar->setIconSize(QSize(16,16));
	toolBar->layout()->setMargin(0);
	toolBar->setStyleSheet("QToolBar { border: none; }");
	toolBar->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);

	FEditToolBar = new ToolBarChanger(toolBar);
	FEditToolBar->setMinimizeWidth(true);
	FEditToolBar->setSeparatorsVisible(false);
	connect(FEditToolBar,SIGNAL(itemRemoved(QAction *)),SLOT(onUpdateEditToolBarVisibility()));
	connect(FEditToolBar,SIGNAL(itemInserted(QAction *, QAction *, Action *, QWidget *, int)),SLOT(onUpdateEditToolBarVisibility()));

	ui.wdtSendToolBar->setLayout(new QHBoxLayout);
	ui.wdtSendToolBar->layout()->setMargin(0);
	ui.wdtSendToolBar->layout()->addWidget(toolBar);

	FSendAction = new Action(toolBar);
	FSendAction->setToolTip(tr("Send"));
	FSendAction->setIcon(RSR_STORAGE_MENUICONS,MNI_MESSAGEWIDGETS_SEND);
	connect(FSendAction,SIGNAL(triggered(bool)),SLOT(onSendActionTriggered(bool)));
	FEditToolBar->insertAction(FSendAction,TBG_MWEWTB_SENDMESSAGE);

	ui.medEditor->installEventFilter(this);
	ui.medEditor->setContextMenuPolicy(Qt::CustomContextMenu);
	Shortcuts::insertWidgetShortcut(SCT_MESSAGEWINDOWS_EDITNEXTMESSAGE,ui.medEditor);
	Shortcuts::insertWidgetShortcut(SCT_MESSAGEWINDOWS_EDITPREVMESSAGE,ui.medEditor);
	connect(ui.medEditor,SIGNAL(createDataRequest(QMimeData *)),SLOT(onEditorCreateDataRequest(QMimeData *)));
	connect(ui.medEditor,SIGNAL(canInsertDataRequest(const QMimeData *, bool &)),
		SLOT(onEditorCanInsertDataRequest(const QMimeData *, bool &)));
	connect(ui.medEditor,SIGNAL(insertDataRequest(const QMimeData *, QTextDocument *)),
		SLOT(onEditorInsertDataRequest(const QMimeData *, QTextDocument *)));
	connect(ui.medEditor->document(),SIGNAL(contentsChange(int,int,int)),SLOT(onEditorContentsChanged(int,int,int)));
	connect(ui.medEditor,SIGNAL(customContextMenuRequested(const QPoint &)),SLOT(onEditorCustomContextMenuRequested(const QPoint &)));

	onOptionsChanged(Options::node(OPV_MESSAGES_EDITORAUTORESIZE));
	onOptionsChanged(Options::node(OPV_MESSAGES_EDITORMINIMUMLINES));
	connect(Options::instance(),SIGNAL(optionsChanged(const OptionsNode &)),SLOT(onOptionsChanged(const OptionsNode &)));

	connect(Shortcuts::instance(),SIGNAL(shortcutUpdated(const QString &)),SLOT(onShortcutUpdated(const QString &)));
	connect(Shortcuts::instance(),SIGNAL(shortcutActivated(const QString &, QWidget *)),SLOT(onShortcutActivated(const QString &, QWidget *)));

	onUpdateEditToolBarVisibility();
}
Ejemplo n.º 16
0
ViewWindow::ViewWindow( Record::Server& server, QWidget* parent, Qt::WFlags flags )
    : QMainWindow( parent, flags )
    , server( server )
    , pShow1x1( new QAction( QIcon( ":/icons/1x1.png" ), "1x1", this ) )
    , pShow2x1( new QAction( QIcon( ":/icons/2x1.png" ), "2x1", this ) )
    , pShow1x2( new QAction( QIcon( ":/icons/1x2.png" ), "1x2", this ) )
    , pShow2x2( new QAction( QIcon( ":/icons/2x2.png" ), "2x2", this ) )
{
    QToolBar* toolbar = addToolBar( "View" );
    toolbar->setMovable( false );

    toolbar->addAction( pShow1x1 );
    toolbar->addAction( pShow2x1 );
    toolbar->addAction( pShow1x2 );
    toolbar->addAction( pShow2x2 );

    connect( pShow1x1, SIGNAL( triggered() ), this, SLOT( show1x1() ) );
    connect( pShow2x1, SIGNAL( triggered() ), this, SLOT( show2x1() ) );
    connect( pShow1x2, SIGNAL( triggered() ), this, SLOT( show1x2() ) );
    connect( pShow2x2, SIGNAL( triggered() ), this, SLOT( show2x2() ) );

    pShow1x1->setCheckable( true );
    pShow2x1->setCheckable( true );
    pShow1x2->setCheckable( true );
    pShow2x2->setCheckable( true );

    // -----------------------------------------------------------------

    QToolButton* pAcquireButton = new QToolButton( toolbar );
    QMenu* pAcquireMenu = new QMenu( pAcquireButton );
    pAcquireButton->setMenu( pAcquireMenu );
    pAcquireButton->setPopupMode( QToolButton::InstantPopup );
    pAcquireButton->setText( "&Acquire" );
    pAcquireButton->setMinimumHeight( 32 );

    toolbar->setIconSize( QSize( 24, 24 ) );
    toolbar->addSeparator();
    toolbar->addWidget( pAcquireButton );

    for( auto it  = ComponentRegister::instance().factories.begin();
              it != ComponentRegister::instance().factories.end();
            ++it )
    {
        ComponentLauncher* launcher = new ComponentLauncher( **it, *this, this );
        pAcquireMenu->addAction( launcher->action );
    }

    // -----------------------------------------------------------------

    areaArray = new EmbedAreaArray();
    this->setCentralWidget( areaArray );

    // -----------------------------------------------------------------

    componentWindowfactory.reset( new ViewWindowComponentWindowFactory( *this, *areaArray ) );

    pShow1x1->trigger();
}
Ejemplo n.º 17
0
MobileShellWindow::MobileShellWindow( DocumentManager* documentManager/*, ViewManager *viewManager*/ )
  : KMainWindow(),
    mDocumentManager( documentManager ),
    mView( 0 )
{
    QToolBar* toolBar = new QToolBar( this );
    toolBar->setMovable( false );
    addToolBar( Qt::BottomToolBarArea, toolBar );
}
Ejemplo n.º 18
0
PropertiesDock::PropertiesDock(QWidget *parent)
    : QDockWidget(parent)
    , mDocument(nullptr)
    , mPropertyBrowser(new PropertyBrowser)
{
    setObjectName(QLatin1String("propertiesDock"));

    mActionAddProperty = new QAction(this);
    mActionAddProperty->setEnabled(false);
    mActionAddProperty->setIcon(QIcon(QLatin1String(":/images/16x16/add.png")));
    connect(mActionAddProperty, &QAction::triggered,
            this, &PropertiesDock::openAddPropertyDialog);

    mActionRemoveProperty = new QAction(this);
    mActionRemoveProperty->setEnabled(false);
    mActionRemoveProperty->setIcon(QIcon(QLatin1String(":/images/16x16/remove.png")));
    mActionRemoveProperty->setShortcuts(QKeySequence::Delete);
    connect(mActionRemoveProperty, &QAction::triggered,
            this, &PropertiesDock::removeProperties);

    mActionRenameProperty = new QAction(this);
    mActionRenameProperty->setEnabled(false);
    mActionRenameProperty->setIcon(QIcon(QLatin1String(":/images/16x16/rename.png")));
    connect(mActionRenameProperty, &QAction::triggered,
            this, &PropertiesDock::renameProperty);

    Utils::setThemeIcon(mActionAddProperty, "add");
    Utils::setThemeIcon(mActionRemoveProperty, "remove");
    Utils::setThemeIcon(mActionRenameProperty, "rename");

    QToolBar *toolBar = new QToolBar;
    toolBar->setFloatable(false);
    toolBar->setMovable(false);
    toolBar->setIconSize(Utils::smallIconSize());
    toolBar->addAction(mActionAddProperty);
    toolBar->addAction(mActionRemoveProperty);
    toolBar->addAction(mActionRenameProperty);

    QWidget *widget = new QWidget(this);
    QVBoxLayout *layout = new QVBoxLayout(widget);
    layout->setMargin(0);
    layout->setSpacing(0);
    layout->addWidget(mPropertyBrowser);
    layout->addWidget(toolBar);
    widget->setLayout(layout);

    setWidget(widget);

    mPropertyBrowser->setContextMenuPolicy(Qt::CustomContextMenu);
    connect(mPropertyBrowser, &PropertyBrowser::customContextMenuRequested,
            this, &PropertiesDock::showContextMenu);
    connect(mPropertyBrowser, &PropertyBrowser::selectedItemsChanged,
            this, &PropertiesDock::updateActions);

    retranslateUi();
}
Ejemplo n.º 19
0
void BitcoinGUI::createToolBars()
{
	mainIcon = new QLabel (this);
    mainIcon->setPixmap(QPixmap(":icons/logo"));
    mainIcon->show();
	
	// For another time
	mainIcon2 = new QLabel (this);
    mainIcon2->setPixmap(QPixmap(":icons/logo2"));
    mainIcon2->show();
	
	QToolBar *toolbar2 = addToolBar(tr("BrexitCoin top-logo"));
	addToolBar(Qt::TopToolBarArea,toolbar2);
    toolbar2->setOrientation(Qt::Horizontal);
    toolbar2->setFloatable(false);
    toolbar2->setMovable(false);
    toolbar2->addWidget(mainIcon);
	
    QToolBar *toolbar = addToolBar(tr("Top toolbar"));
	addToolBar(Qt::TopToolBarArea,toolbar);
    toolbar->setOrientation(Qt::Horizontal);
	toolbar->setFloatable(false);
    toolbar->setMovable(false);
    toolbar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);

    QToolBar *toolbar3 = addToolBar(tr("Side toolbar"));
	addToolBar(Qt::LeftToolBarArea,toolbar3);
    toolbar3->setOrientation(Qt::Vertical);
	toolbar3->setFloatable(false);
    toolbar3->setMovable(false);
    toolbar3->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
	toolbar3->addAction(chatAction);
   	toolbar3->addAction(stakeReportAction);
	toolbar3->addAction(charityAction);	
    toolbar3->addAction(blockAction);	
    toolbar3->addAction(openRPCConsoleAction);
    //toolbar3->addAction(exportAction);
	
	//For another time
	QWidget *spacer = makeToolBarSpacer();
	QToolBar *toolbar4 = addToolBar(tr("BrexitCoin side-logo"));
	addToolBar(Qt::LeftToolBarArea,toolbar4);
    toolbar4->setOrientation(Qt::Vertical);
    toolbar4->setFloatable(false);
    toolbar4->setMovable(false);
	toolbar4->addWidget(spacer);
    toolbar4->addWidget(mainIcon2);
	
}
Ejemplo n.º 20
0
void FixtureManager::initToolBar()
{
	QToolBar* toolbar = new QToolBar(tr("Fixture manager"), this);
	toolbar->setFloatable(false);
	toolbar->setMovable(false);
	layout()->setMenuBar(toolbar);
	toolbar->addAction(m_addAction);
	toolbar->addAction(m_removeAction);
	toolbar->addSeparator();
	toolbar->addAction(m_propertiesAction);
}
Ejemplo n.º 21
0
bool WinControl::callQTModule( const string &nm )
{
    vector<string> list;

    AutoHD<TModule> qt_mod = mod->owner().modAt(nm);
    QMainWindow *(TModule::*openWindow)( );
    qt_mod.at().modFunc("QMainWindow *openWindow();",(void (TModule::**)()) &openWindow);
    QMainWindow *new_wnd = ((&qt_mod.at())->*openWindow)( );
    if(!new_wnd) return false;

    //> Make Qt starter toolbar
    QToolBar *toolBar = NULL;
    QMenu *menu = NULL;
    if(!new_wnd->property("QTStarterToolDis").toBool())
    {
	toolBar = new QToolBar("QTStarter",new_wnd);
	toolBar->setObjectName("QTStarterTool");
	new_wnd->addToolBar(Qt::TopToolBarArea,toolBar);
	toolBar->setMovable(true);
    }
    if(!new_wnd->property("QTStarterMenuDis").toBool() && !new_wnd->menuBar()->actions().empty())
	menu = new_wnd->menuBar()->addMenu("QTStarter");

    mod->owner().modList(list);
    for(unsigned i_l = 0; i_l < list.size(); i_l++)
	if(mod->owner().modAt(list[i_l]).at().modInfo("SubType") == "QT" &&
	    mod->owner().modAt(list[i_l]).at().modFuncPresent("QMainWindow *openWindow();"))
    {
	AutoHD<TModule> qt_mod = mod->owner().modAt(list[i_l]);

	QIcon icon;
	if( mod->owner().modAt(list[i_l]).at().modFuncPresent("QIcon icon();") )
	{
	    QIcon(TModule::*iconGet)();
	    mod->owner().modAt(list[i_l]).at().modFunc("QIcon icon();",(void (TModule::**)()) &iconGet);
	    icon = ((&mod->owner().modAt(list[i_l]).at())->*iconGet)( );
	}
	else icon = QIcon(":/images/oscada_qt.png");
	QAction *act_1 = new QAction(icon,qt_mod.at().modName().c_str(),new_wnd);
	act_1->setObjectName(list[i_l].c_str());
	//act_1->setShortcut(Qt::CTRL+Qt::SHIFT+Qt::Key_1);
	act_1->setToolTip(qt_mod.at().modName().c_str());
	act_1->setWhatsThis(qt_mod.at().modInfo("Description").c_str());
	QObject::connect(act_1, SIGNAL(triggered()), this, SLOT(callQTModule()));

	if( toolBar ) toolBar->addAction(act_1);
	if( menu ) menu->addAction(act_1);
    }

    new_wnd->show();

    return true;
}
Ejemplo n.º 22
0
TextOutputI::TextOutputI(const std::string& name, QWidget *parent)
    : QMainWindow(parent) {
    Logos logos;

    QPixmap myPic;
    myPic.loadFromData(logos.gistLogo, logos.gistLogoSize);
    setWindowIcon(myPic);

    QFont font;
    QString fontFamily("Courier");
    font.setFamily(fontFamily);
    font.setFixedPitch(true);
    font.setPointSize(12);


    editor = new QTextEdit;
    editor->setFont(font);
    editor->setReadOnly(true);
    editor->setLineWrapMode(QTextEdit::FixedColumnWidth);
    editor->setLineWrapColumnOrWidth(80);
    os = new GistOutputStream(editor);

    QAction* clearText = new QAction("Clear", this);
    clearText->setShortcut(QKeySequence("Ctrl+K"));
    this->addAction(clearText);
    connect(clearText, SIGNAL(triggered()), editor,
            SLOT(clear()));

    QAction* closeWindow = new QAction("Close window", this);
    closeWindow->setShortcut(QKeySequence("Ctrl+W"));
    this->addAction(closeWindow);
    connect(closeWindow, SIGNAL(triggered()), this,
            SLOT(close()));

    QToolBar* t = addToolBar("Tools");
    t->setFloatable(false);
    t->setMovable(false);
    t->addAction(clearText);

    stayOnTop = new QAction("Stay on top", this);
    stayOnTop->setCheckable(true);
    t->addAction(stayOnTop);
    connect(stayOnTop, SIGNAL(changed()), this,
            SLOT(changeStayOnTop()));

    changeStayOnTop();
    setCentralWidget(editor);
    setWindowTitle(QString((std::string("Gist Console: ") + name).c_str()));

    setAttribute(Qt::WA_QuitOnClose, false);
    setAttribute(Qt::WA_DeleteOnClose, false);
    resize(600,300);
}
Ejemplo n.º 23
0
void BitcoinGUI::createToolBars()
{
    if(walletFrame)
    {
        QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
        toolbar->setMovable(false);
        toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
        toolbar->addAction(overviewAction);
        toolbar->addAction(sendCoinsAction);
        toolbar->addAction(receiveCoinsAction);
        toolbar->addAction(historyAction);
        overviewAction->setChecked(true);
    }
}
Ejemplo n.º 24
0
ScriptDock::ScriptDock(QWidget *parent)
    : QDockWidget(parent),
    mFileName(tr("untitled.lua")),
    mMapDocument(0)
{
    setObjectName(QLatin1String("scriptViewDock"));

    mScriptArea = new ScriptEditor(this);
    mScriptArea->setLineWrapMode(QPlainTextEdit::NoWrap);
    connect(mScriptArea, SIGNAL(textChanged()),
            SLOT(scriptChanged()));

    mOutputArea = new QPlainTextEdit(this);
    mOutputArea->setReadOnly(true);

    highlighter = new ScriptHighlighter(mScriptArea->document());


    QToolBar *buttonContainer = new QToolBar(this);
    buttonContainer->setFloatable(false);
    buttonContainer->setMovable(false);
    buttonContainer->setIconSize(QSize(16, 16));

    QAction *runAction = new QAction(this);
    runAction->setShortcut(tr("Ctrl+Shift+R"));
    runAction->setIcon(
            QIcon(QLatin1String(":/images/16x16/script_run.png")));

    buttonContainer->addAction(runAction);

    connect(runAction, SIGNAL(triggered()),
            SLOT(runScript()));

    QWidget *widget = new QWidget(this);
    QVBoxLayout *layout = new QVBoxLayout(widget);
    layout->setMargin(5);

    QSplitter *splitter = new QSplitter(Qt::Vertical, widget);
    splitter->addWidget(mScriptArea);
    splitter->addWidget(mOutputArea);
    layout->addWidget(splitter);
    layout->addWidget(buttonContainer);

    QList<int> sizeList;
    sizeList << 500 << 100;
    splitter->setSizes(sizeList);

    setWidget(widget);
    retranslateUi();
}
Ejemplo n.º 25
0
ServerWidget::ServerWidget(QWidget *parent,
		const QString &nodeName, int listenPort)
		: QMainWindow(parent) {
	m_contents = new QTextEdit(this);
	QFont font("Monospace");
	font.setStyleHint(QFont::TypeWriter);
	m_contents->setFont(font);
	m_contents->setReadOnly(true);
	QPalette palette;
	palette.setColor(QPalette::Base, Qt::black);
	m_contents->setPalette(palette);
	setPalette(palette);
	QToolBar *toolBar = new QToolBar(this);
	toolBar->setMovable(false);
	toolBar->setAllowedAreas(Qt::TopToolBarArea);
	toolBar->setIconSize(QSize(32, 32));
	toolBar->setToolButtonStyle(Qt::ToolButtonIconOnly);
	toolBar->setFloatable(false);

	QAction *actionClear = new QAction(this);
	QIcon clearIcon;
	clearIcon.addFile(QString::fromUtf8(":/resources/clear.png"), QSize(), QIcon::Normal, QIcon::Off);
	actionClear->setIcon(clearIcon);
    actionClear->setToolTip(tr("Clear"));
    actionClear->setText(tr("Clear"));
	connect(actionClear, SIGNAL(triggered()), m_contents, SLOT(clear()));
	toolBar->addAction(actionClear);

#if defined(__OSX__)
	toolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
#endif

    addToolBar(Qt::TopToolBarArea, toolBar);
	setCentralWidget(m_contents);
    setUnifiedTitleAndToolBarOnMac(true);
	setMenuBar(NULL);
	setWindowTitle(tr("Server Log"));
	resize(QSize(1000, 500));

	QConsoleAppender *consoleAppender = new QConsoleAppender();

	m_logger = new Logger(Thread::getThread()->getLogger()->getLogLevel());
	m_logger->addAppender(consoleAppender);
	m_logger->setFormatter(new DefaultFormatter());
	connect(consoleAppender, SIGNAL(textMessage(ELogLevel, const QString &)),
		this, SLOT(onTextMessage(ELogLevel, const QString &)), Qt::QueuedConnection);

	m_thread = new ServerThread(m_logger, listenPort, nodeName.toStdString());
	m_thread->start();
}
Ejemplo n.º 26
0
FilesystemWidget::FilesystemWidget(QWidget *parent)
{
    setParent(parent);

    // Create the toolbar
    QToolBar *fsToolbar = new QToolBar();
    fsToolbar->setMovable(false);

    goUpAction = new QAction(IconFactory::fromTheme("go-up"), tr("Go up"), this);
    connect(goUpAction, SIGNAL(triggered()), this, SLOT(goUp()));
    fsToolbar->addAction(goUpAction);

    goHomeAction = new QAction(IconFactory::fromTheme("go-home"), tr("Go to the home folder"), this);
    connect(goHomeAction, SIGNAL(triggered()), this, SLOT(goHome()));
    fsToolbar->addAction(goHomeAction);

    // TODO: use placeholderText in Qt 4.7.
    filterEdit = new QLineEdit();
    QLabel* filterLabel = new QLabel(tr("Filter:"));
    filterLabel->setContentsMargins(5, 0, 5, 0);
    fsToolbar->addSeparator();
    fsToolbar->addWidget(filterLabel);
    fsToolbar->addWidget(filterEdit);
    connect(filterEdit, SIGNAL(textChanged(QString)), this, SLOT(setNameFilter(QString)));

    // Create the filesystem view
    fsWidgetModel = new QFileSystemModel();
    fsWidgetModel->setNameFilterDisables(false);
    fsWidgetModel->setFilter(QDir::AllDirs|QDir::Files|QDir::NoDotAndDotDot);
    fsListView = new QListView();
    fsListView->setSelectionMode(QAbstractItemView::ExtendedSelection);
    fsListView->setDragEnabled(true);
    fsListView->setModel(fsWidgetModel);

    // We shall use this to filter available file extensions from Phonon
    //fsWidgetModel->setFilter(getPhononExtensions());

    connect(fsWidgetModel, SIGNAL(rootPathChanged(QString)), this, SLOT(pathChanged()));
    connect(fsListView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(doubleClickAt(QModelIndex)));

    // Create a new horizontal box
    QVBoxLayout *vlayout = new QVBoxLayout();
    vlayout->addWidget(fsToolbar);
    vlayout->addWidget(fsListView);
    goHome();

    this->setLayout(vlayout);
}
Ejemplo n.º 27
0
void BitcoinGUI::createToolBars()
{
    QToolBar *toolbar = addToolBar(tr("Tabs toolbar"));
    toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar->addAction(overviewAction);
    toolbar->addAction(sendCoinsAction);
    toolbar->addAction(receiveCoinsAction);
    toolbar->addAction(historyAction);
    toolbar->addAction(addressBookAction);
    toolbar->setMovable(false);

    QToolBar *toolbar2 = addToolBar(tr("Actions toolbar"));
    toolbar2->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
    toolbar2->addAction(exportAction);
    toolbar2->setMovable(false);
}
Ejemplo n.º 28
0
WebViewWindow::WebViewWindow(QWidget *parent) :
    QMainWindow(parent)
{
    QAction* reloadAction = new QAction(QApplication::style()->standardIcon(QStyle::SP_BrowserReload), tr("Reload"), this);
    reloadAction->setShortcut(QKeySequence(QKeySequence::Refresh));

    QToolBar* toolBar = new QToolBar(tr("ToolBar"), this);
    mAddressBar = new QLineEdit(toolBar);
    mAddressBar->setReadOnly(true);
    toolBar->addWidget(mAddressBar);
    toolBar->addAction(reloadAction);
    toolBar->setMovable(false);
    toolBar->hide();
    toolBar->installEventFilter(this);
    mToolBar = toolBar;
    addToolBar(toolBar);

    QMenuBar* menuBar = this->menuBar();
    QMenu* fileMenu = menuBar->addMenu(tr("&File"));
    fileMenu->addAction(reloadAction);
    QAction* quitAction = fileMenu->addAction(QIcon(":/media/application_exit.png"), tr("Quit"));
    connect(quitAction, SIGNAL(triggered()), this, SLOT(close()));
    QMenu* viewMenu = menuBar->addMenu(tr("&View"));
    viewMenu->addAction(toolBar->toggleViewAction());
    QMenu* debugMenu = menuBar->addMenu(tr("&Debug"));
    QAction* inspectAction = debugMenu->addAction(tr("Inspect"));
    connect(inspectAction, SIGNAL(triggered()), this, SLOT(showWebInspector()));

    mWebView = new QWebView(this);
    mWebInspector = 0;
    QWebSettings* webSettings = mWebView->settings();
    webSettings->setAttribute(QWebSettings::LocalStorageEnabled, true);
    webSettings->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);

    QWidget* centralWidget = new QWidget(this);
    QVBoxLayout* layout = new QVBoxLayout(centralWidget);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->addWidget(mWebView);
    layout->setAlignment(mWebView, Qt::AlignCenter);
    setCentralWidget(centralWidget);
    setWindowModality(Qt::WindowModal);

    connect(reloadAction, SIGNAL(triggered()), mWebView, SLOT(reload()));

    loadWebInspector();
}
Ejemplo n.º 29
0
  Viewport::Viewport(QWidget* parent) : QWidget(parent)
  {
    QVBoxLayout* layout = new QVBoxLayout(this);
    layout->setMargin(0);
    layout->setSpacing(0);

    m_gl_widget = MainWindow::instance().createGL<GLWidget>(this);
    layout->addWidget(m_gl_widget);

    QToolBar* tb = new QToolBar(this);
    tb->setFloatable(false);
    tb->setMovable(false);
    tb->setIconSize(QSize(16, 16));
    layout->addWidget(tb);

    m_new_object = tb->addAction(QIcon(":/icons/new_object.png"), "New object", this, SLOT(newObject()));
    m_new_light = tb->addAction(QIcon(":/icons/new_light.png"), "New light", this, SLOT(newLight()));
    m_new_light->setEnabled(false);
    tb->addSeparator();
    m_translate = tb->addAction(QIcon(":/icons/translate.png"), "Translate (W)", this, SLOT(translateGizmo()));
    m_translate->setCheckable(true);
    m_translate->setChecked(true);
    m_rotate = tb->addAction(QIcon(":/icons/rotate.png"), "Rotate (E)", this, SLOT(rotateGizmo()));
    m_rotate->setCheckable(true);
    m_rotate->setChecked(false);
    m_scale = tb->addAction(QIcon(":/icons/scale.png"), "Scale (R)", this, SLOT(scaleGizmo()));
    m_scale->setCheckable(true);
    m_scale->setChecked(false);
    m_scale->setEnabled(false);
    tb->addSeparator();
    m_frame_selection = tb->addAction(QIcon(":/icons/frame.png"), "Frame selection (F)", this, SLOT(frameSelection()));
    m_frame_selection->setEnabled(false);
    m_frame_all = tb->addAction(QIcon(":/icons/frame_all.png"), "Frame all (A)", this, SLOT(frameAll()));
    m_frame_all->setEnabled(false);
    tb->addSeparator();
    m_scene_mode = tb->addAction(QIcon(":/icons/blueprint.png"), "Blueprint mode (B)", this, SLOT(sceneMode()));
    m_scene_mode->setChecked(true);
    m_scene_mode->setEnabled(false);
    m_render_mode = tb->addAction(QIcon(":/icons/shader.png"), "Render mode (G)", this, SLOT(renderMode()));
    m_render_mode->setEnabled(false);
    tb->addSeparator();
    m_delete_object = tb->addAction(QIcon(":/icons/delete.png"), "Delete object", this, SLOT(deleteObject()));

    translateGizmo();
  }
Ejemplo n.º 30
0
BookmarkList::BookmarkList( Okular::Document *document, QWidget *parent )
    : QWidget( parent ), m_document( document ), m_currentDocumentItem( 0 )
{
    QVBoxLayout *mainlay = new QVBoxLayout( this );
    mainlay->setMargin( 0 );
    mainlay->setSpacing( 6 );

    m_searchLine = new KTreeWidgetSearchLine( this );
    mainlay->addWidget( m_searchLine );

    m_tree = new QTreeWidget( this );
    mainlay->addWidget( m_tree );
    QStringList cols;
    cols.append( "Bookmarks" );
    m_tree->setContextMenuPolicy(  Qt::CustomContextMenu );
    m_tree->setHeaderLabels( cols );
    m_tree->setSortingEnabled( false );
    m_tree->setRootIsDecorated( true );
    m_tree->setAlternatingRowColors( true );
    m_tree->setItemDelegate( new PageItemDelegate( m_tree ) );
    m_tree->header()->hide();
    m_tree->setSelectionBehavior( QAbstractItemView::SelectRows );
    m_tree->setEditTriggers( QAbstractItemView::EditKeyPressed );
    connect( m_tree, SIGNAL(itemActivated(QTreeWidgetItem*,int)), this, SLOT(slotExecuted(QTreeWidgetItem*)) );
    connect( m_tree, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotContextMenu(QPoint)) );
    m_searchLine->addTreeWidget( m_tree );

    QToolBar * bookmarkController = new QToolBar( this );
    mainlay->addWidget( bookmarkController );
    bookmarkController->setObjectName( QLatin1String( "BookmarkControlBar" ) );
    // change toolbar appearance
    bookmarkController->setIconSize( QSize( 16, 16 ) );
    bookmarkController->setMovable( false );
    QSizePolicy sp = bookmarkController->sizePolicy();
    sp.setVerticalPolicy( QSizePolicy::Minimum );
    bookmarkController->setSizePolicy( sp );
    // insert a togglebutton [show only bookmarks in the current document]
    m_showBoomarkOnlyAction = bookmarkController->addAction( KIcon( "bookmarks" ), i18n( "Current document only" ) );
    m_showBoomarkOnlyAction->setCheckable( true );
    connect( m_showBoomarkOnlyAction, SIGNAL(toggled(bool)), this, SLOT(slotFilterBookmarks(bool)) );

    connect( m_document->bookmarkManager(), SIGNAL(bookmarksChanged(KUrl)), this, SLOT(slotBookmarksChanged(KUrl)) );

    rebuildTree( m_showBoomarkOnlyAction->isChecked() );
}