Example #1
0
CGMainWindow::CGMainWindow(QWidget *parent, Qt::WindowFlags flags)
    : QMainWindow(parent, flags) {
    resize(604, 614);

    // Create a menu
    QMenu *file = new QMenu("&File", this);
    file->addAction("Load polygon", this, SLOT(loadPolygon()), Qt::CTRL + Qt::Key_L);
    file->addAction("Duplicate active polygon", this, SLOT(duplicatePolygon()), Qt::CTRL + Qt::Key_D);
    file->addAction("Quit", qApp, SLOT(quit()), Qt::CTRL + Qt::Key_Q);
    menuBar()->addMenu(file);

    // Create a nice frame to put around the OpenGL widget
    QFrame *f = new QFrame(this);
    f->setFrameStyle(QFrame::Sunken | QFrame::Panel);
    f->setLineWidth(2);

    // Create our OpenGL widget
    ogl = new CGView(this, f);

    // Put the GL widget inside the frame
    QHBoxLayout *layout = new QHBoxLayout();
    layout->addWidget(ogl);
    layout->setMargin(0);
    f->setLayout(layout);

    setCentralWidget(f);

    statusBar()->showMessage("Ready", 1000);
}
Example #2
0
FilesSelectionWizardPage::FilesSelectionWizardPage(GenericProjectWizardDialog *genericProjectWizard, QWidget *parent)
    : QWizardPage(parent), m_genericProjectWizardDialog(genericProjectWizard), m_model(0), m_finished(false)
{
    QVBoxLayout *layout = new QVBoxLayout(this);

    QHBoxLayout *hbox = new QHBoxLayout;
    m_filterLabel = new QLabel;
    m_filterLabel->setText(tr("Hide files matching:"));
    m_filterLabel->hide();
    hbox->addWidget(m_filterLabel);
    m_filterLineEdit = new QLineEdit;

    m_filterLineEdit->setText("Makefile*; *.o; *.obj; *~; *.files; *.config; *.creator; *.user; *.includes");
    m_filterLineEdit->hide();
    hbox->addWidget(m_filterLineEdit);
    m_applyFilterButton = new QPushButton(tr("Apply Filter"), this);
    m_applyFilterButton->hide();
    hbox->addWidget(m_applyFilterButton);
    layout->addLayout(hbox);

    m_view = new QTreeView;
    m_view->setMinimumSize(500, 400);
    m_view->setHeaderHidden(true);
    m_view->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::MinimumExpanding);
    m_label = new QLabel;
    m_label->setMaximumWidth(500);

    layout->addWidget(m_view);
    layout->addWidget(m_label);

    connect(m_applyFilterButton, SIGNAL(clicked()), this, SLOT(applyFilter()));
}
Example #3
0
void MainWindow::about()
{
    QLabel *label = new QLabel;
    QLabel *pix   = new QLabel;
    label->setText(tr("<p><b>关于</b></p> "
                      "<p>版本:    1.0</p>"
                      "<p>库:      Qt 4.8.1</p>"
                      "<p>数据库:  Sqlite</p>"
                      "<p>作者:    唐昊</p> "
                      "<p>Email:thddaniel92gmail.com</p>"));
    pix->setPixmap(QPixmap("images/money.png"));
    QToolButton *btn = new QToolButton;
    btn->setMinimumSize(60,40);
    btn->setText(tr("关闭"));
    QHBoxLayout *layout = new QHBoxLayout;
    layout->addWidget(pix);
    layout->addWidget(label);
    QHBoxLayout *layout2 = new QHBoxLayout;
    //layout2->addStretch(12);
    layout2->addWidget(btn,Qt::AlignHCenter);
    //layout2->addStretch(12);
    QVBoxLayout *layout3 = new QVBoxLayout;
    layout3->addLayout(layout);
    layout3->addLayout(layout2);
    QDialog *dlg = new QDialog;
    connect(btn,SIGNAL(clicked()),dlg,SLOT(close()));
    dlg->setWindowTitle(tr("关于"));
    dlg->setAttribute(Qt::WA_DeleteOnClose);
    dlg->setLayout(layout3);
    dlg->exec();


}
FileSelectWidget::FileSelectWidget(QWidget *parent) : QWidget(parent), CommonMyWidgetWrapper(this)
{
	QFrame *frameTextAndButton = new QFrame;
	QHBoxLayout *layoutTextAndButton = new QHBoxLayout;
	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->setContentsMargins(0, 0, 0, 0);
	layout->setSpacing(2);
	layoutTextAndButton->setContentsMargins(0, 0, 0, 0);
	layoutTextAndButton->setSpacing(2);
	lineEdit = new QLineEdit;
	button = new QPushButton;
	labelImage = new QLabel;
	labelImage->setAlignment(Qt::AlignTop | Qt::AlignHCenter);
	labelImage->setContentsMargins(0, 0, 0, 0);
	labelImage->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
	labelImage->setMaximumHeight(150);
	labelImage->setMaximumWidth(300);
	labelImage->setStyleSheet(
		"QLabel { color: red; font-weight: bold; border: 1px solid black;"
		"background-color: white; padding: 1px; }");
	QIcon iconFolder = QIcon::fromTheme("folder", QIcon(":/system/icons/folder.svg"));
	button->setIcon(iconFolder);
	layoutTextAndButton->addWidget(lineEdit);
	layoutTextAndButton->addWidget(button);
	frameTextAndButton->setLayout(layoutTextAndButton);

	layout->addWidget(frameTextAndButton);
	layout->addWidget(labelImage);

	defaultValue = "";
	connect(button, SIGNAL(clicked()), this, SLOT(slotSelectFile()));
	connect(lineEdit, SIGNAL(editingFinished()), this, SLOT(slotChangedFile()));
}
Example #5
0
DisplayWindow::DisplayWindow( QWidget* parent )
: QWidget(parent)
{
#ifndef RELEASE
    CallStackEntry entry("DisplayWindow::DisplayWindow");
#endif
    matrix_ = 0;

    // For the real matrix
    QHBoxLayout* matrixLayout = new QHBoxLayout();
    display_ = new DisplayWidget<double>();
    scroll_ = new QScrollArea();
    scroll_->setWidget( display_ );
    matrixLayout->addWidget( scroll_ );

    // Add two buttons at the bottom
    QHBoxLayout* buttonLayout = new QHBoxLayout();
    QPushButton* localButton = new QPushButton("Local");
    QPushButton* globalButton = new QPushButton("Global");
    buttonLayout->addWidget( localButton );
    buttonLayout->addWidget( globalButton );

    // Stack the matrix on top of the buttons
    QVBoxLayout* mainLayout = new QVBoxLayout();
    mainLayout->addLayout( matrixLayout );
    mainLayout->addLayout( buttonLayout );
    setLayout( mainLayout );

    connect( localButton, SIGNAL(clicked()), this, SLOT(UseLocalScale()) );
    connect( globalButton, SIGNAL(clicked()), this, SLOT(UseGlobalScale()) );
    setAttribute( Qt::WA_DeleteOnClose );

    // Elemental needs to know if a window was opened for cleanup purposes
    OpenedWindow();
}
Example #6
0
EditWithLabel::EditWithLabel( QString label, int id, QWidget* parent ) :
    QFrame( parent )
{
    m_id = id;

    QVBoxLayout* vLayout = new QVBoxLayout();

    QHBoxLayout* hLayout = new QHBoxLayout();
    m_label = new QLabel( label, this );
    hLayout->addWidget( m_label );
    hLayout->addStretch();

    QHBoxLayout* hLayout2 = new QHBoxLayout();
    m_lineEdit = new QLineEdit( this );
    hLayout2->addWidget( m_lineEdit );
    hLayout2->addStretch();

    vLayout->addLayout( hLayout );
    vLayout->addLayout( hLayout2 );
    vLayout->setContentsMargins( 1,1,1,1 );

    setLayout( vLayout );

    connect( m_lineEdit, SIGNAL( textEdited( QString ) ), this, SLOT( slotTextChanged( QString ) ) );

    setFrameStyle( QFrame::Panel | QFrame::Raised );

    setStyleSheet( "QLabel { font:  bold 12px; margin-bottom: -1px }"
                   "QLineEdit { font: 12px; max-height: 14px; margin-top: -1px }"
                 );
}
Example #7
0
CLogin::CLogin(QWidget *parent) :
    QDialog(parent)
{
    QGridLayout* grid = new QGridLayout;
    grid->addWidget(new QLabel("用户名:"), 0, 0);
    grid->addWidget(_username = new QLineEdit, 0, 1);
    grid->addWidget(new QLabel("密码:"), 1, 0);
    grid->addWidget(_password = new QLineEdit, 1, 1);

    QPushButton* buttonOK = new QPushButton("登录");
    QPushButton* buttonClose = new QPushButton("关闭");
    QHBoxLayout* hBox = new QHBoxLayout;
    hBox->addStretch(1);
    hBox->addWidget(buttonOK);
    hBox->addWidget(buttonClose);

    QVBoxLayout* vLayout = new QVBoxLayout;
    vLayout->addLayout(grid);
    vLayout->addLayout(hBox);

    QGridLayout* layout = new QGridLayout;
    layout->addLayout(vLayout, 1, 1);
    layout->setColumnStretch(0, 1);
    layout->setColumnStretch(2, 1);
    layout->setRowStretch(0, 1);
    layout->setRowStretch(2, 1);

    setLayout(layout);

    _password->setEchoMode(QLineEdit::Password);

    connect(buttonOK, SIGNAL(clicked()), this, SLOT(doLogin()));
    connect(buttonClose, SIGNAL(clicked()), this, SLOT(reject()));
}
Example #8
0
HelloWorld::HelloWorld(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::HelloWorld)
{
    //Configuração da UI
    ui->setupUi(this);

    //Criação de uma campo de texto
    QLabel * label = new QLabel(QString("Hello World!"));

    //Layout para organização dos elementos gráficos
    QHBoxLayout * hlay = new QHBoxLayout(this);

    //Adicionando uma widget dentro do layout
    hlay->addWidget(label);

    //Adicionando o layout na aplicação
    setLayout(hlay);

    //Informa que a altura máxima e mínima serão calculadas de acordo com as widgets
    //não redimensiona
//    setMaximumSize(hlay->sizeHint());
//    setFixedSize(sizeHint());
    layout()->setSizeConstraint(QLayout::SetFixedSize);

    //Modifica o título da aplicação
    setWindowTitle(QString("Hello World"));
}
Example #9
0
widget::widget(boost::function<void(widget *, std::size_t)> callback, QWidget *parent)
    : QDialog(parent)
    , no_threads(50)
    , callback_(callback)
{
    QHBoxLayout * layout = new QHBoxLayout;

    QSpinBox * thread_number_widget = new QSpinBox;
    thread_number_widget->setValue(50);
    thread_number_widget->setRange(1, 100000);
    QObject::connect(thread_number_widget, SIGNAL(valueChanged(int)),
        this, SLOT(set_threads(int)));

    run_button = new QPushButton("Run");
    QObject::connect(run_button, SIGNAL(clicked(bool)), this, SLOT(run_clicked(bool)));

    layout->addWidget(new QLabel("Number of threads: "));
    layout->addWidget(thread_number_widget);
    layout->addWidget(run_button);

    QVBoxLayout * main_layout = new QVBoxLayout;
    main_layout->addLayout(layout);

    list = new QListWidget;
    main_layout->addWidget(list);

    setLayout(main_layout);
}
Example #10
0
DeckViewContainer::DeckViewContainer(int _playerId, TabGame *parent)
    : QWidget(parent), playerId(_playerId)
{
    loadLocalButton = new QPushButton;
    loadRemoteButton = new QPushButton;
    readyStartButton = new ToggleButton;
    readyStartButton->setEnabled(false);
    sideboardLockButton = new ToggleButton;
    sideboardLockButton->setEnabled(false);

    connect(loadLocalButton, SIGNAL(clicked()), this, SLOT(loadLocalDeck()));
    connect(loadRemoteButton, SIGNAL(clicked()), this, SLOT(loadRemoteDeck()));
    connect(readyStartButton, SIGNAL(clicked()), this, SLOT(readyStart()));
    connect(sideboardLockButton, SIGNAL(clicked()), this, SLOT(sideboardLockButtonClicked()));
    connect(sideboardLockButton, SIGNAL(stateChanged()), this, SLOT(updateSideboardLockButtonText()));

    QHBoxLayout *buttonHBox = new QHBoxLayout;
    buttonHBox->addWidget(loadLocalButton);
    buttonHBox->addWidget(loadRemoteButton);
    buttonHBox->addWidget(readyStartButton);
    buttonHBox->addWidget(sideboardLockButton);
    buttonHBox->addStretch();
    deckView = new DeckView;
    connect(deckView, SIGNAL(newCardAdded(AbstractCardItem *)), this, SIGNAL(newCardAdded(AbstractCardItem *)));
    connect(deckView, SIGNAL(sideboardPlanChanged()), this, SLOT(sideboardPlanChanged()));

    QVBoxLayout *deckViewLayout = new QVBoxLayout;
    deckViewLayout->addLayout(buttonHBox);
    deckViewLayout->addWidget(deckView);
    setLayout(deckViewLayout);

    retranslateUi();
}
Example #11
0
MonetaAmountField::MonetaAmountField(QWidget *parent):
        QWidget(parent), amount(0), currentUnit(-1)
{
    amount = new QDoubleSpinBox(this);
    amount->setLocale(QLocale::c());
    amount->setDecimals(8);
    amount->installEventFilter(this);
    amount->setMaximumWidth(170);
    amount->setSingleStep(0.001);

    QHBoxLayout *layout = new QHBoxLayout(this);
    layout->addWidget(amount);
    unit = new QValueComboBox(this);
    unit->setModel(new MonetaUnits(this));
    layout->addWidget(unit);
    layout->addStretch(1);
    layout->setContentsMargins(0,0,0,0);

    setLayout(layout);

    setFocusPolicy(Qt::TabFocus);
    setFocusProxy(amount);

    // If one if the widgets changes, the combined content changes as well
    connect(amount, SIGNAL(valueChanged(QString)), this, SIGNAL(textChanged()));
    connect(unit, SIGNAL(currentIndexChanged(int)), this, SLOT(unitChanged(int)));

    // Set default based on configuration
    unitChanged(unit->currentIndex());
}
Example #12
0
QLayout * PageNetGame::footerLayoutDefinition()
{
    QHBoxLayout * bottomLayout = new QHBoxLayout;

    // Ready button

    BtnGo = new QPushButton(this);
    BtnGo->setIcon(QIcon(":/res/lightbulb_off.png"));
    BtnGo->setIconSize(QSize(25, 34));
    BtnGo->setMinimumWidth(50);
    BtnGo->setMinimumHeight(50);

    bottomLayout->addStretch();
    bottomLayout->addWidget(BtnGo);

    // Start button

    const QIcon& lp = QIcon(":/res/Start.png");
    QSize sz = lp.actualSize(QSize(65535, 65535));
    BtnStart = new QPushButton();
    BtnStart->setText(tr("Start"));
    BtnStart->setMinimumWidth(sz.width() + 60);
    BtnStart->setIcon(lp);
    BtnStart->setFixedHeight(50);
    BtnStart->setIconSize(sz);
    BtnStart->setFlat(true);
    BtnStart->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    bottomLayout->addWidget(BtnStart);

    return bottomLayout;
}
Example #13
0
Editor::Editor(SquadreModel*sm, ArbitriModel*am, QWidget *parent) :
    QDialog(parent), squadre(sm), arbitri(am)
{   
    createMainEditor();
    if(squadre){
        createTesseratoEditor();
        createSquadraEditor();
    }
    if(arbitri){
        createArbitroEditor();
    }

    layouts = new QStackedLayout;
    layouts->addWidget(tesseratoWidget);
    layouts->addWidget(squadraWidget);
    layouts->addWidget(arbitroWidget);

    QHBoxLayout* editorLayout = new QHBoxLayout;
    editorLayout->addWidget(listView);
    editorLayout->addLayout(layouts);

    mainLayout = new QVBoxLayout;
    mainLayout->addWidget(radioGroup);
    mainLayout->addLayout(editorLayout);
    mainLayout->addLayout(pushLayout);
    pushLayout->setAlignment(mainLayout, Qt::AlignRight);

    setLayout(mainLayout);
    setWindowTitle(tr("Editor"));
    setMinimumSize(sizeHint());
    setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);

    updateList(squadreComboBox->currentIndex());

}
Example #14
0
/****************************************************************************
**
** Copyright (C) 2015
**
** This file is generated by the Magus toolkit
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
****************************************************************************/

// Include
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QMessageBox>
#include <QDir>
#include <QImageReader>
#include "tool_simple_texturewidget.h"

namespace Magus
{
    //****************************************************************************/
    QtSimpleTextureWidget::QtSimpleTextureWidget(QWidget* parent) : QWidget(parent)
    {
        setWindowTitle(QString("Texture selection"));
        mNameTexture = QString("");
        mBaseNameTexture = QString("");
        mTextureSize = QSize(128, 128);
        mOriginIsFile = true;
        QHBoxLayout* mainLayout = new QHBoxLayout;
        QVBoxLayout* textureSelectionLayout = new QVBoxLayout;

        // Define selection widget (QListView)
        mSelectionList = new QListView(this);
        mSelectionList->setViewMode(QListView::IconMode);
        mSelectionList->setIconSize(mTextureSize);
        mSelectionList->setSpacing(0);
        mSelectionList->setMovement(QListView::Snap);
        mSelectionList->setFlow(QListView::LeftToRight);
        mSelectionList->setWrapping(true);
        mSelectionList->setDragEnabled(true);
        mSelectionList->setAcceptDrops(false);
        mSelectionList->setDropIndicatorShown(false);
        mSelectionList->setMouseTracking(true);
        mSelectionModel = new QtSimpleTextureModel();
        mSelectionList->setModel(mSelectionModel);
        connect(mSelectionList, SIGNAL(clicked(QModelIndex)), this, SLOT(handleSelected(QModelIndex)));
        connect(mSelectionList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(handleDoubleClicked(QModelIndex)));
        connect(mSelectionList, SIGNAL(entered(QModelIndex)), this, SLOT(mouseOver(QModelIndex)));

        // Layout
        textureSelectionLayout->addWidget(mSelectionList);
        mainLayout->addLayout(textureSelectionLayout);
        setLayout(mainLayout);
    }
GraphViewerWidget::GraphViewerWidget(QWidget *parent)
  : QWidget(parent),
    mWidget(new GraphWidget(this))
{
  mModel = ObjectBroker::model("com.kdab.GammaRay.ObjectVisualizerModel");

  QSortFilterProxyModel *objectFilter = new KRecursiveFilterProxyModel(this);
  objectFilter->setSourceModel(mModel);
  objectFilter->setDynamicSortFilter(true);

  QVBoxLayout *vbox = new QVBoxLayout;
  KFilterProxySearchLine *objectSearchLine = new KFilterProxySearchLine(this);
  objectSearchLine->setProxy(objectFilter);
  vbox->addWidget(objectSearchLine);
  QTreeView *objectTreeView = new QTreeView(this);
  objectTreeView->setModel(objectFilter);
  objectTreeView->setSortingEnabled(true);
  vbox->addWidget(objectTreeView);

  mObjectTreeView = objectTreeView;

  QWidget *treeViewWidget = new QWidget(this);
  treeViewWidget->setLayout(vbox);

  QSplitter *splitter = new QSplitter(this);
  splitter->addWidget(treeViewWidget);
  splitter->addWidget(mWidget);
  QHBoxLayout *hbox = new QHBoxLayout(this);
  hbox->addWidget(splitter);

  QMetaObject::invokeMethod(this, "delayedInit", Qt::QueuedConnection);
}
Example #16
0
dTopicTextEditEx::dTopicTextEditEx( QWidget * _parent):
        QTextEdit(_parent)
{
    application = qobject_cast<dChatApplication*>(QApplication::instance());
   
    topicEditor = new QWidget();
    topicEditor->setWindowTitle(tr("Редактор заголовка"));
    topicEditor->setWindowIcon(QIcon(tr("pic/book64x64.png")));
    QVBoxLayout *layout = new QVBoxLayout;
    layout->setMargin(1);
    layout->setSpacing(5);
    
    topicEditorTextEdit = new QTextEdit();
    layout->addWidget(topicEditorTextEdit); 
    
        QHBoxLayout *layoutButton = new QHBoxLayout;
        layoutButton->setSpacing(5);
        QPushButton *sendButton = new QPushButton(tr("Отправить"));
        sendButton->setDefault(true);
    //   skinPushButton->setIcon(QIcon(tr("pic/open32x32.png")));
        connect(sendButton, SIGNAL(clicked()), this, SLOT(clickedSendButton()));
        layoutButton->addWidget(sendButton); 
        QPushButton *closeButton = new QPushButton(tr("Закрыть"));
        connect(closeButton, SIGNAL(clicked()), topicEditor, SLOT(close()));
        layoutButton->addWidget( closeButton ); 
        layoutButton->addStretch ( 1 );
    
    layout->addItem(layoutButton);
    topicEditor->resize(size());    
    topicEditor->setLayout(layout);

};
Example #17
0
ClipWindow::ClipWindow(QWidget *parent)
    : QMainWindow(parent)
{
    clipboard = QApplication::clipboard();

    QWidget *centralWidget = new QWidget(this);
    QWidget *currentItem = new QWidget(centralWidget);
    QLabel *mimeTypeLabel = new QLabel(tr("MIME types:"), currentItem);
    mimeTypeCombo = new QComboBox(currentItem);
    QLabel *dataLabel = new QLabel(tr("Data:"), currentItem);
    dataInfoLabel = new QLabel("", currentItem);

    previousItems = new QListWidget(centralWidget);

//! [0]
    connect(clipboard, SIGNAL(dataChanged()), this, SLOT(updateClipboard()));
//! [0]
    connect(mimeTypeCombo, SIGNAL(activated(QString)),
            this, SLOT(updateData(QString)));

    QVBoxLayout *currentLayout = new QVBoxLayout(currentItem);
    currentLayout->addWidget(mimeTypeLabel);
    currentLayout->addWidget(mimeTypeCombo);
    currentLayout->addWidget(dataLabel);
    currentLayout->addWidget(dataInfoLabel);
    currentLayout->addStretch(1);

    QHBoxLayout *mainLayout = new QHBoxLayout(centralWidget);
    mainLayout->addWidget(currentItem, 1);
    mainLayout->addWidget(previousItems);

    setCentralWidget(centralWidget);
    setWindowTitle(tr("Clipboard"));
}
/** Initializes this object. */
void CSearchDialog::initView() {
    namespace DU = util::directory;

    QVBoxLayout* verticalLayout = new QVBoxLayout(this);
    setLayout(verticalLayout);

    m_searchOptionsArea = new BtSearchOptionsArea(this);
    verticalLayout->addWidget(m_searchOptionsArea);

    m_searchResultArea = new BtSearchResultArea(this);
    verticalLayout->addWidget(m_searchResultArea);

    QHBoxLayout* horizontalLayout = new QHBoxLayout();

    m_analyseButton = new QPushButton(tr("&Analyze results..."), 0);
    m_analyseButton->setToolTip(tr("Show a graphical analysis of the search result"));
    QSpacerItem* spacerItem = new QSpacerItem(1, 1, QSizePolicy::Expanding, QSizePolicy::Minimum);
    horizontalLayout->addWidget(m_analyseButton);
    horizontalLayout->addItem(spacerItem);

    m_closeButton = new QPushButton(this);
    m_closeButton->setText(tr("&Close"));
    m_closeButton->setIcon(DU::getIcon(CResMgr::searchdialog::close_icon));
    horizontalLayout->addWidget(m_closeButton);

    verticalLayout->addLayout(horizontalLayout);

    loadDialogSettings();
}
Example #19
0
DLineEdit::DLineEdit(QWidget *parent, const char *name) :
  QWidget(parent)
{
  setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
  setFocusPolicy(Qt::StrongFocus);
  setMaximumWidth(200);
  setObjectName(name);

  QHBoxLayout *hbox = new QHBoxLayout(this);
  hbox->addWidget(&_lineedit);
  hbox->addWidget(&_calbutton);
  hbox->setSpacing(1);
  hbox->setMargin(0);

  QPixmap pixmap(":/widgets/images/calendar_24.png"); 
  _calbutton.setIconSize(QSize(24,24));
  _calbutton.setIcon(QIcon(pixmap));
  _calbutton.setFlat(true);
  _calbutton.setMaximumSize(pixmap.size());
  _calbutton.setFocusPolicy(Qt::NoFocus);

  connect(&_calbutton,            SIGNAL(clicked()), &_lineedit, SLOT(showCalendar()));
  connect(&_lineedit,     SIGNAL(editingFinished()), &_lineedit, SLOT(parseDate()));
  connect(&_lineedit,SIGNAL(newDate(const QDate &)), this,       SIGNAL(newDate(const QDate &)));

  setFocusProxy(&_lineedit);
}
LogFilePicker::LogFilePicker(QString defaultFile, QWidget *parent) :
    QDialog(parent)
{
    QVBoxLayout *vbox = new QVBoxLayout(this);
    setLayout(vbox);

    vbox->addWidget(new QLabel("Read a Log File"));

    QHBoxLayout *hbox = new QHBoxLayout();
    vbox->addLayout(hbox);
    m_fileEditBox = new QLineEdit();
    m_fileEditBox->setText(defaultFile);
    hbox->addWidget(m_fileEditBox);

    QPushButton *browserButton = new QPushButton(tr("Browse..."));
    hbox->addWidget(browserButton);
    connect(browserButton, SIGNAL(clicked()), this, SLOT(openBrowseWindow()));


    vbox->addWidget(m_skipToEnd = new QCheckBox(tr("Start Reading at the End of the File")));

    QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal, this);
    vbox->addWidget(buttonBox);

    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
}
Example #21
0
void AdGraphicsView::init()
{
    width = this->adMap.width();
    height = this->adMap.height();
    QLabel *cornerLabel = new QLabel(QStringLiteral("¹ã¸æ"));

    adScene = new QGraphicsScene(this);

    adScene->setSceneRect(-width/2, -height/2, width, height);

    this->setScene(adScene);
    this->setCacheMode(CacheBackground);

    QVBoxLayout *advLayout = new QVBoxLayout;
    advLayout->addWidget(cornerLabel);
    advLayout->setMargin(15);
    advLayout->addStretch();

    QHBoxLayout *adhLayout = new QHBoxLayout;
    adhLayout->addLayout(advLayout);
    adhLayout->addStretch();
    adhLayout->setDirection(QBoxLayout::RightToLeft);

    this->setLayout(adhLayout);
}
Example #22
0
TabBar::TabBar(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::TabBar)
{
    enter
    ui->setupUi(this);
    ui->cmdScrollLeft->hide();
    ui->cmdScrollRight->hide();

    QHBoxLayout *layout = new QHBoxLayout();
    layout->addItem(new QSpacerItem(1,1, QSizePolicy::Expanding, QSizePolicy::Expanding));
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(2);
    ui->scrollContent->setLayout(layout);

    ui->cmdScrollLeft->hide();
    ui->cmdScrollRight->hide();
    ui->scroll->adjustSize();
    ui->scrollContent->adjustSize();
    updateScrollButtonsVisibility();

    connect(Core::ui(), SIGNAL(createTab(QString, bool)), SLOT(createTab(QString, bool)));
    connect(Core::ui(), SIGNAL(activateTab(QString)), SLOT(activateTab(QString)));
    connect(Core::ui(), SIGNAL(setTabName(QString,QString)), SLOT(setTabName(QString,QString)));
    connect(Core::ui(), SIGNAL(setTabIcon(QString,QString)), SLOT(setTabIcon(QString,QString)));
    connect(Core::ui(), SIGNAL(highlight(QString)), SLOT(highlight(QString)));
    connect(Core::ui(), SIGNAL(closeTab(QString)), SLOT(closeTab(QString)));
    connect(ui->cmdScrollLeft, SIGNAL(clicked()), SLOT(scrollLeft()));
    connect(ui->cmdScrollRight, SIGNAL(clicked()), SLOT(scrollRight()));
    leave
}
KOTodoViewQuickSearch::KOTodoViewQuickSearch( Calendar *calendar, QWidget *parent )
  : QWidget( parent ), mCalendar( calendar )
{
  QHBoxLayout *layout = new QHBoxLayout( this );
  // no special margin because it is added by the view
  layout->setContentsMargins( 0, 0, 0, 0 );

  mSearchLine = new KLineEdit( this );
  mSearchLine->setClickMessage( i18nc( "@label in QuickSearchLine", "Search" ) );
  mSearchLine->setClearButtonShown( true );
  connect( mSearchLine, SIGNAL(textChanged(const QString &)),
           this, SIGNAL(searchTextChanged(const QString &)) );

  layout->addWidget( mSearchLine, 3 );

  mCategoryCombo = new KPIM::KCheckComboBox( this );
  mCategoryCombo->setDefaultText( i18nc( "@item:inlistbox", "Select Categories" ) );
  mCategoryCombo->setSeparator( i18nc( "@item:intext delimiter for joining category names", "," ) );

  connect( mCategoryCombo, SIGNAL(checkedItemsChanged(const QStringList &)),
           this, SIGNAL(searchCategoryChanged(const QStringList &)) );

  layout->addWidget( mCategoryCombo, 1 );
  fillCategories();

  setLayout( layout );
}
Example #24
0
 void createOne()
 {
     auto content = FlexManager::instance()->createFlexWidget(Flex::HybridView, this, Flex::widgetFlags());
     QHBoxLayout* box = new QHBoxLayout(this);
     box->setContentsMargins(0, 0, 0, 0);
     box->addWidget(content);
 }
Example #25
0
void MainWindow::setupUi() {

    // Create widget
    pdf_commands_view = new PdfCommandsView(this);
    QVBoxLayout *vlayout = qobject_cast<QVBoxLayout*>(commandsSection->layout());
    vlayout->addWidget(pdf_commands_view);

    // Set model
    pdf_commands_view->setModel(pdf_commands);

    // Create widget
    property_editor = new PropertyEditor::PropertyEditor(this);
    property_editor->setObject(document);
    vlayout = qobject_cast<QVBoxLayout*>(dockWidgetContents->layout());
    vlayout->addWidget(property_editor);

    // Set model
    pdfView->setScene(pdf_scene);

    // Create widget
    pdf_objects_view = new PdfCommandsView(this);
    QHBoxLayout *hlayout = qobject_cast<QHBoxLayout*>(objectBrowserTab->layout());
    hlayout->insertWidget(0, pdf_objects_view);

    // Set model
    pdf_objects_view->setModel(pdf_objects);
}
Example #26
0
void FilePathPropertyEditor::onInitialize()
{
   QWidget* frame = new QWidget( this );
   QHBoxLayout* layout = new QHBoxLayout( frame );
   layout->setSpacing( 0 );
   layout->setMargin( 0 );
   frame->setLayout( layout );
   addWidget( frame );

   // a field that shows the resource
   m_droppedFilePath = new DropArea( frame, new FSNodeMimeData( m_paths ) );
   connect( m_droppedFilePath, SIGNAL( changed() ), this, SLOT( valChanged() ) );
   m_droppedFilePath->setMinimumSize( 20, 20 );
   m_droppedFilePath->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
   layout->addWidget( m_droppedFilePath );

   // a button for NULLing the resource
   QToolButton* eraseButton = new QToolButton( frame );
   eraseButton->setIcon( QIcon( ":/TamyEditor/Resources/Icons/Editor/quit.png" ) );
   eraseButton->setToolTip( "Reset value" );
   connect( eraseButton, SIGNAL( clicked( bool ) ), this, SLOT( valErased( bool ) ) );
   eraseButton->setMinimumSize( 20, 20 );
   eraseButton->setMaximumSize( 20, 20 );
   eraseButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
   layout->addWidget( eraseButton );

   refreshPropertyName();
}
Example #27
0
CWindowAlarm::CWindowAlarm(QWidget *parent, Qt::WindowFlags flags)
{
	//Groupe de la liste des alarmes
	formGroupBox = new QGroupBox(tr("Alarmes"));
	listWidget = new QListWidget();
	QFormLayout *formLayout = new QFormLayout(formGroupBox);
	formLayout->addWidget(listWidget);
	formGroupBox->setLayout(formLayout);
	
	//Groupe du bouton close
	btClose = new QPushButton("Close");
	btAcquitter = new QPushButton("Acquitter");
	verticalGroupBox = new QGroupBox(tr("Actions"));
	QHBoxLayout *HBoxLayout = new QHBoxLayout(verticalGroupBox);
	HBoxLayout->addWidget(btClose);
	HBoxLayout->addWidget(btAcquitter);

	verticalGroupBox->setLayout(HBoxLayout);


	mainLayout = new QGridLayout(this);
	//this->setLayout(mainLayout);

	mainLayout->addWidget(formGroupBox,0,0);
	mainLayout->addWidget(verticalGroupBox,1,0);
	mainLayout->setRowStretch ( 0, 90 );
	mainLayout->setRowStretch ( 1, 10 );
	//mainLayout->setColumnStretch( 1, 10 );

	setConnections();

}
Example #28
0
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QFileSystemModel model;
    QWidget window;
    QTreeView *tree = new QTreeView(&window);
    tree->setMaximumSize(1000, 600);

    QHBoxLayout *layout = new QHBoxLayout;
    layout->setSizeConstraint(QLayout::SetFixedSize);
    layout->addWidget(tree);

    window.setLayout(layout);
    model.setRootPath("");
    tree->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
    tree->setModel(&model);

    tree->setAnimated(false);
    tree->setIndentation(20);
    tree->setSortingEnabled(true);
    tree->header()->setStretchLastSection(false);

    window.setWindowTitle(QObject::tr("Dir View"));
    tree->header()->setSectionResizeMode(QHeaderView::ResizeToContents);

    window.show();

    return app.exec();
}
Example #29
0
ViewCert::ViewCert(QList<QSslCertificate> cl, QWidget *p) : QDialog(p) {
	qlCerts = cl;

	setWindowTitle(tr("Certificate Chain Details"));

	QHBoxLayout *h;
	QVBoxLayout *v;
	QGroupBox *qcbChain, *qcbDetails;

	qcbChain=new QGroupBox(tr("Certificate chain"), this);
	h = new QHBoxLayout(qcbChain);
	qlwChain = new QListWidget(qcbChain);
	qlwChain->setObjectName(QLatin1String("Chain"));

	foreach(QSslCertificate c, qlCerts)
		qlwChain->addItem(tr("%1 %2").arg(decode_utf8_qssl_string(c.subjectInfo(QSslCertificate::CommonName)), decode_utf8_qssl_string(c.subjectInfo(QSslCertificate::Organization))));
	h->addWidget(qlwChain);

	qcbDetails=new QGroupBox(tr("Certificate details"), this);
	h = new QHBoxLayout(qcbDetails);
	qlwCert = new QListWidget(qcbDetails);
	h->addWidget(qlwCert);

	QDialogButtonBox *qdbb = new QDialogButtonBox(QDialogButtonBox::Ok, Qt::Horizontal, this);

	v = new QVBoxLayout(this);
	v->addWidget(qcbChain);
	v->addWidget(qcbDetails);
	v->addWidget(qdbb);

	QMetaObject::connectSlotsByName(this);
	connect(qdbb, SIGNAL(accepted()), this, SLOT(accept()));

	resize(510,300);
}
Example #30
0
void OBSPropertiesView::AddColor(obs_property_t *prop, QFormLayout *layout,
		QLabel *&label)
{
	QPushButton *button     = new QPushButton;
	QLabel      *colorLabel = new QLabel;
	const char  *name       = obs_property_name(prop);
	long long   val         = obs_data_get_int(settings, name);
	QColor      color       = color_from_int(val);

	button->setText(QTStr("Basic.PropertiesWindow.SelectColor"));

	colorLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel);
	colorLabel->setText(color.name(QColor::HexArgb));
	colorLabel->setPalette(QPalette(color));
	colorLabel->setAutoFillBackground(true);
	colorLabel->setAlignment(Qt::AlignCenter);

	QHBoxLayout *subLayout = new QHBoxLayout;
	subLayout->setContentsMargins(0, 0, 0, 0);

	subLayout->addWidget(colorLabel);
	subLayout->addWidget(button);

	WidgetInfo *info = new WidgetInfo(this, prop, colorLabel);
	connect(button, SIGNAL(clicked()), info, SLOT(ControlChanged()));
	children.emplace_back(info);

	label = new QLabel(QT_UTF8(obs_property_description(prop)));
	layout->addRow(label, subLayout);
}