/** 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 #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
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
    this->setWindowFlags( Qt::FramelessWindowHint );

    tasks = new Tasks();
    tasks->construct();

    trayIcon = new TrayIcon( this );

    QVBoxLayout *layout = new QVBoxLayout( this );
    layout->addWidget( tasks->getTasksWidget() );

    QWidget *wid = new QWidget( this );
//    wid->setContentsMargins( -10, -10, -10, -10 );
    this->setStyleSheet( /*"border: 4px solid red;"*/
                         "border-radius: 6px;");
    setCentralWidget( wid );
    wid->setLayout( layout );
    wid->setStyleSheet( baseColor );

    tasks->addTask( "test", 7 );
    tasks->addTask( "test", 7 );
    tasks->addTask( "test", 7 );
    tasks->removeTask( 2 );
    tasks->addTask( "test", 7 );

    connect( trayIcon, SIGNAL( quitPressed() ), this, SLOT( close() ) );

}
Example #4
0
MainWindow::MainWindow()
{
    setWindowIcon(QIcon(":/images/seafile.png"));
    setWindowTitle(SEAFILE_CLIENT_BRAND);

    // Qt::Tool hides the taskbar entry on windows
    // setWindowFlags(Qt::FramelessWindowHint | Qt::Tool | Qt::WindowStaysOnTopHint);

    setWindowFlags(Qt::Window
                   | Qt::FramelessWindowHint
                   | Qt::WindowSystemMenuHint
                   | Qt::WindowMinimizeButtonHint);

    cloud_view_ = new CloudView;

    QVBoxLayout *layout = new QVBoxLayout;
    layout->setContentsMargins(0, 0, 0, 0);
    layout->addWidget(cloud_view_);

    QWidget *widget = new QWidget;
    widget->setObjectName("mainWrapper");
    widget->setLayout(layout);

    setCentralWidget(widget);

    createActions();
    setAttribute(Qt::WA_TranslucentBackground, true);
}
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
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 #7
0
//!-------------------------------------------------------------------------
//! create a material dialog widget (not embedded mode)
//!-------------------------------------------------------------------------
void MEMaterialPort::manageDialog()
{
    m_dialog = new QDialog(0);
    m_dialog->setWindowIcon(MEMainHandler::instance()->pm_logo);
    QString title = node->getTitle() + ":" + portname;
    m_dialog->setWindowTitle(MEMainHandler::instance()->generateTitle(title));
    connect(m_dialog, SIGNAL(finished(int)), this, SLOT(folderCB()));

    m_chooser = new MEMaterialChooser();
    connect(m_chooser, SIGNAL(materialChanged(const QVector<float> &)), this, SLOT(materialChanged(const QVector<float> &)));
    m_chooser->setParent(m_dialog);

    QVBoxLayout *vbox = new QVBoxLayout(m_dialog);
    vbox->addWidget(m_chooser, 1);

    // create the dialog buttons
    QDialogButtonBox *bb = new QDialogButtonBox();
    QPushButton *pb = NULL;
    pb = bb->addButton("Apply", QDialogButtonBox::AcceptRole);
    pb = bb->addButton("Close", QDialogButtonBox::RejectRole);
    connect(bb, SIGNAL(accepted()), this, SLOT(applyCB()));
    connect(bb, SIGNAL(rejected()), this, SLOT(materialMapClosed()));
    pb = bb->addButton(QDialogButtonBox::Reset);
    connect(pb, SIGNAL(clicked()), this, SLOT(resetCB()));
    vbox->addWidget(bb);

    // user can close the window pressing ESC
    QAction *m_escape_a = new QAction("Escape", this);
    m_escape_a->setShortcut(Qt::Key_Escape);
    connect(m_escape_a, SIGNAL(triggered()), this, SLOT(materialMapClosed()));
    m_dialog->addAction(m_escape_a);
}
Example #8
0
Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
//! [0]
    QWidget *firstPageWidget = new QWidget;
    QWidget *secondPageWidget = new QWidget;
    QWidget *thirdPageWidget = new QWidget;

    QStackedWidget *stackedWidget = new QStackedWidget;
    stackedWidget->addWidget(firstPageWidget);
    stackedWidget->addWidget(secondPageWidget);
    stackedWidget->addWidget(thirdPageWidget);

//! [0] //! [1]
    QComboBox *pageComboBox = new QComboBox;
    pageComboBox->addItem(tr("Page 1"));
    pageComboBox->addItem(tr("Page 2"));
    pageComboBox->addItem(tr("Page 3"));
    connect(pageComboBox, SIGNAL(activated(int)),
            stackedWidget, SLOT(setCurrentIndex(int)));

//! [1] //! [2]
    QVBoxLayout *layout = new QVBoxLayout;
//! [2]
    layout->addWidget(pageComboBox);
//! [3]
    layout->addWidget(stackedWidget);
    setLayout(layout);
//! [3]
}
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);
}
TabDialog::TabDialog(QWidget *parent)
    : QDialog(parent)
{

    tabWidget = new QTabWidget;

    /*
     * TO DO: Populate tabWidget with tabs retrieved from parsed XML
     */

    parseXML();

    buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);

    connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
    connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));

    QVBoxLayout *mainLayout = new QVBoxLayout;
    mainLayout->setSizeConstraint(QLayout::SetNoConstraint);
    mainLayout->addWidget(tabWidget);
    mainLayout->addWidget(buttonBox);
    setLayout(mainLayout);

    setWindowTitle(tr("FinTP Config GUI"));
}
Example #11
0
WidgetBox::WidgetBox(QDesignerFormEditorInterface *core, QWidget *parent, Qt::WindowFlags flags)
    : QDesignerWidgetBox(parent, flags),
      m_core(core),
      m_view(new WidgetBoxTreeWidget(m_core))
{

    QVBoxLayout *l = new QVBoxLayout(this);
    l->setMargin(0);
    l->setSpacing(0);

    // Prevent the filter from grabbing focus since Our view has Qt::NoFocus
    QToolBar *toolBar = new QToolBar(this);
    QLineEdit *filterWidget = new WidgetBoxFilterLineEdit(toolBar);
    filterWidget->setPlaceholderText(tr("Filter"));
    filterWidget->setClearButtonEnabled(true);
    connect(filterWidget, SIGNAL(textChanged(QString)), m_view, SLOT(filter(QString)));
    toolBar->addWidget(filterWidget);
    l->addWidget(toolBar);

    // View
    connect(m_view, SIGNAL(pressed(QString,QString,QPoint)),
            this, SLOT(handleMousePress(QString,QString,QPoint)));
    l->addWidget(m_view);

    setAcceptDrops (true);
}
FormMetallisation::FormMetallisation(metallisation* metal, QWidget *parent) :
    FormElementBase(metal,parent)
{
    this->metal=metal;

    setWindowTitle("Créer métallisation");

    QVBoxLayout * layoutPrincipal = new QVBoxLayout();

    QGroupBox * groupGeo = new QGroupBox("Métallisation");

    QFormLayout * layout = new QFormLayout;

    lineEditConductivite = new QDoubleSpinBox();
    layout->addRow("Conductivité:",lineEditConductivite);

    layout->addRow(getWidgetElementBase());

    layout->setAlignment(Qt::AlignTop);

    groupGeo->setLayout(layout);

    layoutPrincipal->addWidget(groupGeo);

    setLayout(layoutPrincipal);

    init();

}
int main(int argc, char **argv)
{
    BrowserApplication application(argc, argv);
    QCoreApplication::setApplicationName(QLatin1String("urllineeditexample"));
    QMainWindow w;

    QWidget *window = new QWidget;
    QComboBox *comboBox = new QComboBox(window);
    comboBox->setEditable(true);
    QLineEdit *lineEdit = new QLineEdit(window);
    LocationBar *s1 = new LocationBar(window);
    LocationBar *s2 = new LocationBar(window);
    WebView *view = new WebView(window);
    view->setUrl(QUrl("http://www.google.com"));
    s2->setWebView(view);

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(comboBox);
    layout->addWidget(lineEdit);
    layout->addWidget(s1);
    layout->addWidget(s2);
    layout->addWidget(view);
    window->setLayout(layout);
    w.show();
    w.setCentralWidget(window);

    QToolBar *bar = w.addToolBar("foo");
    QSplitter *splitter = new QSplitter(window);
    splitter->addWidget(new LocationBar);
    splitter->addWidget(new QLineEdit);
    bar->addWidget(splitter);
    return application.exec();
}
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()));
}
void PVImageListViewer::initGUI()
{
    this->setFixedWidth(250);
    QVBoxLayout *mainLayout = new QVBoxLayout;
    this->setLayout(mainLayout);
    //init listview
    m_listView = new QListView;
    m_listView->setFixedWidth(200);
    m_listView->setViewMode(QListView::IconMode);
    m_listView->setIconSize(QSize(180,180));
    m_listView->setGridSize(QSize(200,100));
    m_listView->setResizeMode(QListView::Adjust);
    m_listView->setUpdatesEnabled(true);
    m_dataModel = new PVIconModel();
    m_listView->setModel(m_dataModel);
    mainLayout->addWidget(m_listView);
    m_listView->update();
    m_listView->show();

    //init image path label
    m_imagePathLabel = new QLabel;
    m_imagePathLabel->setAlignment(Qt::AlignLeft);
    m_imagePathLabel->setBaseSize(250, 200);
    m_imagePathLabel->setWordWrap(true);
    m_imagePathLabel->setText(tr("Nothing selected"));
    mainLayout->addWidget(m_imagePathLabel);
}
TestbedWebcamDialog::TestbedWebcamDialog( const QString &contactId, QWidget * parent, const char * name )
: KDialogBase( KDialogBase::Plain, Qt::WDestructiveClose, parent, name, false, i18n( "Webcam for %1" ).arg( contactId ),
                   KDialogBase::Close, KDialogBase::Close, true /*seperator*/ )
{
	setInitialSize( QSize(320,290), false );
	
	setEscapeButton( KDialogBase::Close );
//	QObject::connect( this, SIGNAL( closeClicked() ), this, SIGNAL( closingWebcamDialog() ) );

	QWidget *page = plainPage();
	setMainWidget(page);

	QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() );	
	mImageContainer = new Kopete::WebcamWidget( page );
	mImageContainer->setMinimumSize(320,240);
	mImageContainer->setText( i18n( "No webcam image received" ) );
	mImageContainer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
	topLayout->add( mImageContainer );
	
	show();
	
	mVideoDevicePool = Kopete::AV::VideoDevicePool::self();
	mVideoDevicePool->open();
	mVideoDevicePool->setSize(320, 240);
	mVideoDevicePool->startCapturing();
	mVideoDevicePool->getFrame();
	mVideoDevicePool->getImage(&mImage);
kdDebug() << "Just captured 1st frame" << endl;

	mPixmap=QPixmap(320,240,-1, QPixmap::DefaultOptim);
	if (mPixmap.convertFromImage(mImage,0) == true)
		mImageContainer->updatePixmap(mPixmap);
	connect(&qtimer, SIGNAL(timeout()), this, SLOT(slotUpdateImage()) );
	qtimer.start(0,FALSE);
}
Example #17
0
int main(int argc, char *argv[])
{

    QApplication a(argc, argv);

    DrawingArea *area = new DrawingArea();

    QPushButton *triangualteBut = new QPushButton();
    triangualteBut->setText("Triangulate");

    QVBoxLayout *lay = new QVBoxLayout();
    lay->addWidget(area);
    //lay->addWidget(triangualteBut);

    QWidget window;
    window.setLayout(lay);
    window.show();

    Triangulator *t = new Triangulator(area);

    QObject::connect(triangualteBut,SIGNAL(clicked()),t,SLOT(triangulate()));
    t->triangulate();

    return a.exec();
}
Example #18
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"));
}
Example #19
0
/*
********************************************************************************
*                                                                              *
*    Class ShortcutDialog                                                      *
*                                                                              *
********************************************************************************
*/
ShortcutDialog::ShortcutDialog(QString key, QString shortcut, QWidget *parent) : DialogBase(parent)
{
    m_key          = key;
    m_old_shortcut = shortcut;

    //! ui
    this->setTitle(tr("Change shortcut"));
    this->resize(400, 170);


    QLabel * label= new QLabel(this);
    label->setAlignment(Qt::AlignCenter);
    label->setWordWrap(false);
    label->setText(tr("Press a keys that you want to set as a shortcut"));

    m_currentShortcut = new QLabel(this);
    m_currentShortcut->setAlignment(Qt::AlignCenter);
    m_currentShortcut->setText(m_old_shortcut);


    QVBoxLayout * layout = new QVBoxLayout();
    layout->addWidget(label);
    layout->addWidget(m_currentShortcut);

    setContentLayout(layout);
    
    //! connection
    connect(buttonBox(), SIGNAL(rejected()),this, SLOT(close()));
    connect(buttonBox(), SIGNAL(accepted()),this, SLOT(accept()));

    //! List legal modifiers
    m_modifier_keys << Qt::ControlModifier << Qt::AltModifier << Qt::MetaModifier << Qt::ShiftModifier;
}
Example #20
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 #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
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
tCZoneMainLayer::tCZoneMainLayer( 
        QWidget* pParent, 
        tCZoneModesModel& modesModel)
: tCZoneMainLayerBase( pParent )
, m_ModesModel(modesModel)
{
    m_pLoadingModesLabel = new QLabel( tr("Loading modes"), this );
    m_pLoadingModesLabel->setAlignment( Qt::AlignCenter );
    m_pLoadingModesLabel->hide();

    m_pGrid = new tGridMenu( 3, 3, this );
    m_pGrid->SetIndexing( ( style()->styleHint( NSH( tNOSStyle::NSH_GridMenuIndexing ) ) !=0 ) );

    QVBoxLayout* pVLayout = new QVBoxLayout();
    int margin = style()->pixelMetric( NPM( tNOSStyle::NPM_GridMenuMargin ) );
    pVLayout->setContentsMargins( margin, margin, margin, margin );
    pVLayout->addWidget( m_pLoadingModesLabel );
    pVLayout->addWidget( m_pGrid );
    setLayout( pVLayout );
    
    CreateFixedItems();

    if ( m_ModesModel.IsPopulated() )
    {
        CreateModeItems();
    }
    else
    {
        m_pLoadingModesLabel->show();
        Connect( &m_ModesModel, SIGNAL( Populated() ), this, SLOT( CreateModeItems() ) );
    }
}
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 #24
0
int main(int argc, char * argv[])
{
    QApplication a(argc, argv);

    QWidget window;

    QVBoxLayout * mainLayout = new QVBoxLayout(&window);
    QLabel * label = new QLabel("0");
    QSpinBox * spinBox = new QSpinBox;
    QSlider * slider = new QSlider(Qt::Horizontal);

    mainLayout->addWidget(label);
    mainLayout->addWidget(spinBox);
    mainLayout->addWidget(slider);

    QObject::connect(spinBox, SIGNAL(valueChanged(int)),
                     label, SLOT(setNum(int)));

    QObject::connect(spinBox, SIGNAL(valueChanged(int)),
                     slider, SLOT(setValue(int)));

    QObject::connect(slider, SIGNAL(valueChanged(int)),
                     label, SLOT(setNum(int)));
    QObject::connect(slider, SIGNAL(valueChanged(int)),
                     spinBox, SLOT(setValue(int)));

    window.show();
    a.exec();
}
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
Widget::Widget(QWidget *parent) :
    QWidget(parent)
{
    setWindowTitle("A test for shared video renderer. QtAV" + QtAV_Version_String_Long() + " wbsecg1@gmail.com");
    QVBoxLayout *main_layout = new QVBoxLayout;
    QHBoxLayout *btn_layout = new QHBoxLayout;
    renderer = new WidgetRenderer;
    renderer->setFocusPolicy(Qt::StrongFocus);
    renderer->resizeRenderer(640, 480);
    for (int i = 0; i < 2; ++i) {
        player[i] = new AVPlayer(this);
        player[i]->setRenderer(renderer);
        QVBoxLayout *vb = new QVBoxLayout;
        play_btn[i] = new QPushButton(this);
        play_btn[i]->setText(QString("Play-%1").arg(i));
        file_btn[i] = new QPushButton(this);
        file_btn[i]->setText(QString("Choose video-%1").arg(i));
        connect(play_btn[i], SIGNAL(clicked()), SLOT(playVideo()));
        connect(file_btn[i], SIGNAL(clicked()), SLOT(setVideo()));
        vb->addWidget(play_btn[i]);
        vb->addWidget(file_btn[i]);
        btn_layout->addLayout(vb);
    }
    QPushButton *net_btn = new QPushButton(tr("Test online video(rtsp)"));
    connect(net_btn, SIGNAL(clicked()), SLOT(testRTSP()));
    main_layout->addWidget(renderer);
    main_layout->addWidget(net_btn);
    main_layout->addLayout(btn_layout);
    setLayout(main_layout);
    resize(720, 600);
}
Example #27
0
/*!
    \class MainWindow mainwindow.h
    \brief Class fills graphical user interface with controls.
*/
MainWindow::MainWindow()
    : QWidget(0, Qt::FramelessWindowHint), m_embedded(false)
{
    // create a widget we can access in CSS: QWidget#PatientCare
    QWidget* top = new QWidget(this);

#if defined(Q_WS_HILDON) || defined(Q_WS_S60) || defined(Q_WS_QWS) || defined(Q_OS_WINCE)
    m_embedded = true;
#endif
    if (QApplication::arguments().contains("-embedded"))
        m_embedded = true;
    if (QApplication::arguments().contains("-no-embedded"))
        m_embedded = false;

    ui.setupUi(top);

    setWindowTitle("Pulse Oximeter");
    setWindowIcon(QIcon(":/qt-logo32x32"));

    m_controller = new PatientCareController(&ui, this);

    if (!m_embedded) {
        updateDecoration();
        top->setGeometry(153, 95, 636, 476);
    } else {
        QVBoxLayout *lay = new QVBoxLayout(this);
        lay->setContentsMargins(0, 0, 0, 0);
        lay->addWidget(top);

        qApp->setOverrideCursor(Qt::BlankCursor);
        setWindowState(Qt::WindowFullScreen);
    }
}
Example #28
0
VVidPBView::VVidPBView(ClientFactory &pFactory, QWidget *parent, QTabWidget &pTabbed, QString strName)
    : m_pFactory(pFactory), QWidget(parent), m_pTabbed(pTabbed), m_currentFocus(-1),
      m_bControlEnable(TRUE), m_strName(strName), m_bFloated(FALSE),
      m_TimerTour(NULL)
{
    ui.setupUi(this);
    m_pParent = parent;
    m_lastHoverTime = time(NULL);

    this->setAttribute(Qt::WA_Hover,true);
    QVBoxLayout* layout = new QVBoxLayout();
    m_pVideo = new VVidPBWall(m_pFactory, this->ui.widget);
    m_pVideo->hide();
    //layout->setSpacing(10);

    layout->addWidget(m_pVideo);
    layout->setMargin(0);

    this->ui.widget->setLayout(layout);

    m_pVideo->show();

    SetupConnections();
    createContentMenu();

    //ui.pushButton8x8->hide();
    setMouseTracking(true);

    m_Timer = new QTimer(this);
    connect(m_Timer,SIGNAL(timeout()),this,SLOT(UpdateVideoControl()));
    m_Timer->start(1000);

    ShowFocusClicked(0);
}
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
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);

};